Re: RFC 132 (v1) subroutines should be able to return an lvalue
[email protected] ((Johan Vromans)) 18 Aug 2000 19:26:55 +0200
| Newsgroups | perl.perl6.language.subs |
|---|---|
| Message-ID | <[email protected]> |
[email protected] (Randal L. Schwartz) writes: > How do you indicate to the compiler at the time of compiling: > > lvsub() = FOO > > that FOO should be evaluated in list context? Or scalar context? In all cases but one the context is scalar anyway. The only case when the context could be list context is with lvsub() = ( ...listy thingy... ); So always enforce scalar context would not cause real pain. > Or do you imagine invoking your subroutine before evaluating the > right side of the code (so it can return a scalar/list flag of some > kind), thereby breaking the normal model of assignment where the > right side gets run first? Why not? I couldn't find in the Camel that the right side must be evaluated first (at least not where the assignment operator = is discussed according to the index). -- Johan