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

Re: postfix dereference syntax

Thread Previous | Thread Next
From:
Brad Baxter
Date:
August 26, 2013 16:43
Subject:
Re: postfix dereference syntax
Message ID:
CANBtU9YqbfDQNdPiCiaLttY7NLZ01xWfRnrEG99LVUp0ssiXPw@mail.gmail.com
On Mon, Aug 26, 2013 at 12:27 PM, Brad Baxter <bmb@mail.libs.uga.edu> wrote:

> On Fri, Aug 16, 2013 at 9:23 PM, Brad Baxter <bmb@mail.libs.uga.edu>
> wrote:
> >
> >
> > I do wish we could do without the trailing asterisk, but I appreciate
> that the choices are limited.  I wish these worked
> >
> > ->[]
> > ->{}
> > ->$
> >
>
> What's the chance we might just reverse the arrow for postfix dereference?
>
> perl -e
> ​ ​
> '$x<-@'
> perl -e
> ​ ​
> '$x<-@[1,2]'
> perl -e
> ​ ​
> '$x<-@[0..10]'
> perl -e
> ​ ​
> '$x<-%'
> perl -e
> ​ ​
> '$x<-%{"x","y"}'
> perl -e
> ​ ​
> '$x<-
> ​$'​
>
>
> All of the above give syntax errors.
>
> ​Brad
> ​
>

​But, of course, these are not errors ...​

perl -e '$x<-$x'
perl -e '$x<-@x'
perl -e '$x<-%x'

S
​o maybe it'd have to be this:
​

perl -e '$x<-@[]'
perl -e '$x<-@[1,2]'
perl -e '$x<-@[0..10]'
perl -e '$x<-%{}'
perl -e '$x<-%{"x","y"}'
perl -e '$x<-${}'

​Brad​

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