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

Re: key/value hash and index/valuse array slices syntax

Thread Previous | Thread Next
From:
Ruslan Zakirov
Date:
July 1, 2013 12:52
Subject:
Re: key/value hash and index/valuse array slices syntax
Message ID:
CAMOxC8s=ex60cnx5wAZHs2AiHx3sCeOrKOfJQ-YV+_mvvPAMJg@mail.gmail.com
On Sun, Jun 16, 2013 at 11:31 PM, Father Chrysostomos <sprout@cpan.org>wrote:

>
> On Jun 16, 2013, at 11:47 AM, Ruslan Zakirov <ruz@bestpractical.com>
> wrote:
> > I want to reject most lvalue operations:
> >
> > 1) %h{a} = ... as well as %h{qw(a b)} = ... should throw an error
> >
> > 2) I think lvalue subs should too as it's assignment
>
> $ ./perl -Ilib -le '$_ = "hello"; (sub : lvalue { %{{"hello" => 2}}{$_}
> }->()) = 3; print $_'
> 3
>

Can I check during compile time that an op is used as return value of a
lvalue sub? LVRET is runtime thing. Can not find example in the code. A
pointer or a list of flags to look at?


-- 
Best regards, Ruslan.

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