Re: RFC 118 (v1) lvalue subs: parameters, explicit assignment, and wantarray() changes

[email protected] (Graham Barr) Fri, 18 Aug 2000 07:37:15 +0100
Newsgroups perl.perl6.language.subs
Message-ID <[email protected]>
On Thu, Aug 17, 2000 at 05:10:40PM -0400, Buddha Buck wrote:

> SO what you are saying is that the proper execution of "$p->foo(@args) += 
> $val;" should be (equivalent to):
> 
> 1. Evaluate $val and get an rvalue $rval.
> 2. Evaluate $p->foo(@args) and get an lvalue $lfoo.

The order of those two is debatable. How do you know what context to evaluate
the RHS in ?

> 3. Add $rval to the rvalue associated with $lfoo, to get $rbar.

> 4. call $lfoo->operator=($rbar) to do the actual assignment.

No. you perform normal assignment. If the lvalue return has = overloaded
then it will be called.

Graham.