develooper Front page | perl.perl5.porters | Postings from August 2013

Re: postfix dereference syntax

Thread Previous | Thread Next
From:
demerphq
Date:
August 14, 2013 18:39
Subject:
Re: postfix dereference syntax
Message ID:
CANgJU+Xy6wCfAoA2dsGFH7VG+yd5Xz7EtdnfDVTd1jNrtw-L=Q@mail.gmail.com
On 14 August 2013 20:22, Johan Vromans <jvromans@squirrel.nl> wrote:
> Father Chrysostomos <sprout@cpan.org> writes:
>
>> Ricardo Signes wrote:
>>> « $x->@* acts exactly like @$x » is the rule.  "Except in interpolation" would
>>> be the exception.
>>
>> So we allow "$x->@*" and "$$x->@*" and "$x->$*->@*".
>>
>> What about the brace forms?  How far does the equivalance of "@{...}"
>> and "...->@*" hold?
>>
>> "@{$foo}"     --> "$foo->@*"
>> "@{$foo[0]}"  --> "$foo[0]->@*"
>> "@{*$foo}" ???
>> "@{$foo->**}" --> "$foo->**->@*"
>> "@{$foo->()}" --> "$foo->()->@*"
>> "@{$foo++}"   --> "$foo++->@*"
>> "@{$foo ? bar() : []}" => "$foo ? bar() : []->@*"
>
> Which makes me think, once more, do we actualle *need* postfix
> dereference? Does it provide anything we cannot do already, albeit at
> the cost of an extra pair of braces? In other words: is it worth the
> effort?

I think it complicates an already complex subject without adding that
much benefit.

Yves


-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

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