At 05:49 AM 8/18/00 +1000, Damian Conway wrote:
>And I keep pointing out that this is only one aspect of lvalue subroutines.
>The point of an lvalue subroutine is not to make assignment to the return
>value
>work, it is to make the return value an *lvalue*. That's a much more general
>thing, because it allows every other type of modification to work too.
>
>The lvalue accessor *shouldn't* be doing the assignment (what if an assignment
>isn't what I want?).
>
>The (overloaded) operator = should do the assignment. To whatever lvalue
>the lvalue subroutine returns.
>
>Or the "assignment" should be done by operator += or operator++ or
>whatever mutator I'm actually applying to the returned lvalue.
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.
3. Add $rval to the rvalue associated with $lfoo, to get $rbar.
4. call $lfoo->operator=($rbar) to do the actual assignment.
Is that about right?
When is your RFC about lvalue subs coming, Damian?
>Damian