Re: RFC 118 (v1) lvalue subs: parameters, explicit assignment, and wantarray() changes
[email protected] (Graham Barr) Thu, 17 Aug 2000 18:32:30 +0100
| Newsgroups | perl.perl6.language.subs |
|---|---|
| Message-ID | <[email protected]> |
On Thu, Aug 17, 2000 at 07:04:40PM +0200, Johan Vromans wrote: > And, what would the lvalue routine return? Currently, $a = $b = $c > implies that both $b and $a get the value $c. But with lvalue subs I > can write something like > > yech($foo) = $bar > > that assigns $bar to $foo, and returns something else (e.g., the > previous value of $foo). > > $a = yech($foo) = $bar > > now $a will no longer get $bar assigned. > > Do we want that? You already do with $a = $b = $c if $b happens to be tied and FETCH returns a different value to what was passed to STORE $a = $b = $c Does not mean $a will be assign $c, it means $a will get the result of assigning $c to $a. That is something different. Graham.