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

Re: postfix dereference syntax

Thread Previous | Thread Next
Ricardo Signes
July 6, 2013 23:43
Re: postfix dereference syntax
Message ID:
* Father Chrysostomos <> [2013-07-05T11:24:19]
> rjbs:
> > Edge cases
> If foo->@* means @foo, then does foo->@*[0] mean @foo[0]?  That is
> useless if we have foo->@[0].
> If we have foo->@[0] and extend it to all sigils, we end up with:
> $_->*{foo} # means *$_{foo}
> $_->${foo} # means $$_{foo} (i.e., $_->{foo})
> $_->&(foo) # means $&_{foo} (i.e., $_->(foo))
> The last two are useless.  The dollar form steals existing syntax.

I agree with what I think your assessment is.  That is:  foo->@*[0] is not
@foo[0].  ->&() is not needed.  ->*{foo}, I'm not sure.  I think it may be
needed to get a purely-postfix entry out of a typeglob reference, but it's
something I've done so rarely that I'm not sure and I am writing this message
as I walk out the door.  I'd rather hit send than test.

If nothing else, it can wait!

> See sprout/postderef.  Caveat: It was late when I wrote it.

I am excited to test it.  Hopefully tomorrow, more likely Tuesday.

Thanks, though!


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About