Damian Conway <[EMAIL PROTECTED]> writes:

> [EMAIL PROTECTED] (Randal L. Schwartz) writes:
> 
> > So is that something we've agreed, that lvalue subs are *always*
> > scalars?  That'd mean we can move on to the various implementation
> > details. :)
> 
> Err, I for one would like to see *any* data types lreturn-able.

So do I. But, as Randal pointed out, there seems to be a catch here.

With the "scalar lreturn" proposal the sub definition does not need
something special (like an :lvalue attribute) and, more important, the
compiler need not know whether a sub call might involve an lvalue
returning sub, or a sub that chooses to actually do an lreturn.
A sub is not lvalued by declaration, it may return an lvalue if it
decides to do so.

All other proposals I've seen not only require special attributes
and/or parameter specs for the subroutine definition (which is not a
problem per se), but also seem to require that the compiler knows it's
compiling an lvalue sub call, and hence this sub must be predeclared
or otherwise made known to the compiler. A sub is lvalued or not, and
the compiler must know. And this seems to be virtually impossible when
method calls are involved.

-- Johan

Reply via email to