develooper Front page | perl.perl5.porters | Postings from November 2000

Re: IDEA: more for-like map and grep?

Thread Previous | Thread Next
From:
Hugo
Date:
November 21, 2000 10:53
Subject:
Re: IDEA: more for-like map and grep?
Message ID:
200011211955.TAA21576@crypt.compulink.co.uk
In <20001121110421.D18619@chaos.wustl.edu>, Jarkko Hietaniemi writes:
:On Tue, Nov 21, 2000 at 02:37:55AM -0800, Abigail wrote:
:> On Tue, Nov 21, 2000 at 11:10:10AM +0000, Hugo wrote:
:> > 
:> > What is read-only? I often @a = map { s/foo/bar/; $_ } @b, or
:> > @a = map { s/foo/bar/; $_ } map "$_", @b.
:> 
:> 
:>     @a = map {s/foo/bar/; $_} qw /foo bar baz/;
:> 
:> will work in 5.005, but is no longer allowed in 5.006. :(
:
:Can anyone remember why this change was made?  I can see its simpler
:and safer from the implementor's viewpoint but from the user's
:viewpoint that is of course aggravating.  "Just make a copy-on-write
:copy of it, silly..."

AFAICR qw/constant list/ was originally compiled to a runtime split
of the constant string 'constant list'; we fixed this to do the split
at compile time, which additionally allowed us to fix the bug that
these constant words were previously not marked readonly.

Hugo

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