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