Re: RFC 149 (v1) Lvalue subroutines: implicit and explicit assignment

[email protected] (Chaim Frenkel) 24 Aug 2000 20:07:39 -0400
Newsgroups perl.perl6.language.subs
Message-ID <[email protected]>
>>>>> "JM" == James Mastros <[email protected]> writes:

JM> If those two paragraps (and the two after them) are replaced with <<CUT,
JM> what's still wrong with the RFC?
JM> Therefore, return values of lvalue subs stay as their final GV, which is
JM> passed into the assignment, and is then assigned to the rvalue.
JM> CUT

JM> (Note that "stay as their final GV" is equivlent to that whole long
JM> paragraph, I think.  I'm not too good at internals yet (but I'm trying to
JM> learn).)

Stay away from implementation, specify the semantics. The internals will
probably have nothing to do with the old perl5 internals. I think all
of the SV, etc will probably go away. (A GV is a glob I believe not
something that holds a value. SV is a scalar, AV, is an array)

Perhaps you could simply specify that perl will take the return value
and treat it as a 'pointer', 'reference', 'lvalue' if it can.

I think of it as the return value being translated

	sub foo { return %hash }
	foo = %other;

as being

	%hash = %other

<chaim>
-- 
Chaim Frenkel					     Nonlinear Knowledge, Inc.
[email protected]				               +1-718-236-0183