develooper Front page | perl.perl5.porters | Postings from June 2022

Re: Pre-RFC: Optional Chaining

Thread Previous | Thread Next
From:
Karen Etheridge
Date:
June 19, 2022 01:43
Subject:
Re: Pre-RFC: Optional Chaining
Message ID:
CAPJsHfBVYZ9V0dkfoB_zBE_knEUu4NFvZtyzfPjnbfN8M6yPgw@mail.gmail.com
On Sat, Jun 4, 2022 at 4:16 PM Oodler 577 via perl5-porters <
perl5-porters@perl.org> wrote:

> I like this, but what distinction does "defined" or "truthy"
> hold with references?
>
> It seems necessary for this to even be "true", the following
> conditions must hold:
>
> * it's not undef
> * it's blessed
> * it "can" EXPR2
>

For $foo?->{bar}?->{baz}, nothing needs to be blessed. Watering this
feature down to only supporting method dispatch would be very disappointing.

These should all be possible too:

$foo?->*
$foo?->[0]
$foo?->@*
$foo?->%*
$foo?->()

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About