develooper Front page | perl.perl6.language | Postings from February 2005

Re: Fun with junctions (was Sets vs Junctions)

Thread Previous | Thread Next
From:
David Storrs
Date:
February 21, 2005 16:55
Subject:
Re: Fun with junctions (was Sets vs Junctions)
Message ID:
20050222005201.GA43189@megazone.bigpanda.com
On Mon, Feb 21, 2005 at 11:01:45AM -0800, Larry Wall wrote:
> 
> But rather than that, I suspect we'll see more use of constructs
> where the object to be mutated ends up being the topic, as in:
> 
>     some_complicated_lvalue() but= { .sortmyway(foo($_),bar($_)) }
> 
> which would presumably do the same as
> 
>     my $noun is rw := some_complicated_lvalue();
>     $noun = $noun but { .sortmyway(foo($_),bar($_)) };
> 
> which presumably means something like
> 
>     my $noun is rw := some_complicated_lvalue();
>     $noun = $noun.copy.=sortmyway(foo($noun),bar($noun));
> 
> Larry


I assume that $noun.copy means that we are making a copy of the object
and changing the copy.  That has memory and side-effect implications.

How would one do this as a mutation/in-place-edit, instead of a copy?

--Dks, who recognizes what "presumably means something like" means but
  is curious anyway

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