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

Re: postfix dereference syntax

Thread Previous | Thread Next
From:
Ricardo Signes
Date:
August 14, 2013 01:45
Subject:
Re: postfix dereference syntax
Message ID:
20130814014530.GA6043@cancer.codesimply.com
* Father Chrysostomos <sprout@cpan.org> [2013-08-13T21:16:27]
> I have added it, applied the tests to the branch, and fixed a few
> typos in the test script.

I also think, and I imagine this will raise some hackles, that we should
support this syntax in interpolation.

That is:  $x->@* should be co-equal with @$x, which includes "$x->@*" acting as
"@$x".

So, there is an obvious backward compatibility concern.  Users may have
written:

  "Some sort of $foo->@*"

  "Or maybe $x->$*" <-- would issue $* deprecation and mean "$x->" . undef

  "Or $x->@{....}"

...or a number of other structures.  In almost all cases, I feel that we have
nothing to fear.  The first example, really, is going to be a non-issue.
Unfortunately, the third most likely is:

  "$x->@{ \@b }"

What does "everybody else" think about permitting this?  Presumably we would
need to hide it behind a feature flag, unfortunately.

> Now we just need documentation.

I will look at producing some, if no one beats me to it.

-- 
rjbs

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