>>>>> "Perl6" == Perl6 RFC Librarian <[EMAIL PROTECTED]> writes:
Perl6> If a sub wants to return an lvalue, this lvalue must be a real lvalue
Perl6> in all respects. In particular, all kinds of implicit and explicit
Perl6> value changes must be supported. For example,
Perl6> lvsub() = ...
Perl6> lvsub() += ...
Perl6> lvsub() =~ s///
Perl6> for ( lvsub() ) {
Perl6> $_ = ...
Perl6> }
Perl6> sysread($fh,lvsub(),...)
The big problem is context. You haven't solved the context problem yet.
What do you propose to do about that?
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?
Because FOO needs to know that while it is executing, before invoking
your subroutine. 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?
This is the sticky point that keeps hanging up lvalue subs. Perl's
context transfer on the assignment operator keeps getting overlooked.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!