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

Re: postfix dereference syntax

Thread Previous | Thread Next
From:
David Golden
Date:
July 3, 2013 15:22
Subject:
Re: postfix dereference syntax
Message ID:
CAOeq1c-DZh5arr6d3vftpROEsGdPp4b8SJ3dQyGU5WMT=t_iHg@mail.gmail.com
On Wed, Jul 3, 2013 at 11:09 AM, Aristotle Pagaltzis <pagaltzis@gmx.de> wrote:
>
> However… *this* runs into big trouble:
>
>     $foo->bar->baz->{qw( foo bar baz )}

Damn.  I forgot about that in my excitement about parallelism.

I think echoing current slice syntax could be the way out of the
general conundrum, even if string interpolation doesn't work easily:

    $array->@[ qw/foo bar baz/ ]
    $hash->@{ qw/foo bar baz/ }

The latter could be ->%{ @list } I suppose, but that's a question for
whether mirroring existing syntax is better than introducing sigil
invariance but only for postfix.

David


--
David Golden <xdg@xdg.me>
Take back your inbox! → http://www.bunchmail.com/
Twitter/IRC: @xdg

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