develooper Front page | perl.perl5.porters | Postings from January 2001

Re: `Final' lvsub patch: arrays and hashes

Thread Previous | Thread Next
From:
Simon Cozens
Date:
January 5, 2001 02:59
Subject:
Re: `Final' lvsub patch: arrays and hashes
Message ID:
20010105105749.A5248@deep-dark-truthful-mirror.perlhacker.org
On Thu, Jan 04, 2001 at 11:08:12PM -0800, Stephen McCamant wrote:
> * I've decided that my idea of turning on both the private flag and
>   OPf_MOD (or OPf_REF) won't work because the op might have OPf_MOD
>   for some other reason,

Right, yes. You wouldn't want to do that anyway.

> * Checking for real syntactic lvalue-ness significantly narrows the
>   range of what subs can be lvalues.

Don't do that, then. :) I would set the flag on ops which were about to add
something to the stack. That'd mean that things like "shift" would still work.

> * What should
> 
>   sub f :lvalue {@a}; f() = "foo\n"; print "@a";
> 
>   do?

It should do @a = "foo\n";

-- 
dd.c:	sbrk(64);	/* For good measure */
    - plan9 has a bad day

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