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

Re: Why views are useful, and why their syntax doesn't matter much

Thread Previous | Thread Next
From:
Eric Brine
Date:
July 14, 2011 11:01
Subject:
Re: Why views are useful, and why their syntax doesn't matter much
Message ID:
CALJW-qGoRjd9UDpjdziGaSYmwKBwxd2AzAp98-g1ULk=EE=cKw@mail.gmail.com
On Wed, Jul 13, 2011 at 8:35 PM, Aristotle Pagaltzis <pagaltzis@gmx.de>wrote:

> If you write ++${\10} that should yield 11 no matter how often
> you evaluate it. You should get a copy (or rather, via CoW,
> a potential copy) when you evaluate a constant, and that’s what
> you’re then mutating. If you want it read-only then make it
> read-only.
>

It would fix the following nicely

$ perl -E'for (1..2) { for ((),1..3) { print $_++; } say ""; }'
123
234

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