Re: RFC 107 (v1) lvalue subs should receive the rvalue as an argument

[email protected] (Piers Cawley)
Newsgroups perl.perl6.language,perl.perl6.announce
Message-ID <[email protected]>
Perl6 RFC Librarian <[email protected]> writes:
> This RFC proposes that lvalue subs, when invoked as such, should receive
> the rvalue being assigned to it as an argument.

I'm kind of in two minds about this. Most of the time the current
lvalue behaviour does pretty much the Right Thing, and simple lvalue
subs are simple to write. If you end up with the rvalue as an extra
argument you end up having to dance around whether or not the sub is
called in an lvalue context to possibly decide what to do with the
argument.

And if you want more complex functionality (say you want to write
something like substr) then it's possible to work round it using tie
magic. [Thinks: As soon as I have the tuits I'm going to turn that
into a module...]

-- 
Piers
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.