>>>>> "PRL" == Perl6 RFC Librarian <[EMAIL PROTECTED]> writes:

PRL> The key to the proposal is this: lvalue and rvalue versions of a sub
PRL> would work I<identically>, and both would be enabled by default.
PRL> I<However>, assignment is the only valid operator for these default
PRL> lvalue subs. Attempts to use other operators, such as ++ or s/// on
PRL> these subs would yield an error like:

PRL>    Attempt to modify simple lvalue sub, only = is allowed

Why this limitation?

Once perl has the object/reference/pointer to the lvalue, perl should
be free to modify it at will.

If the lvalue is a fundemental type (whatever that is) everything works
as if the lvalue were actually in place

        sub foo { return $a }
        foo =~ s///;            # same as $a =~ s///;

If $a is a user defined object, then the same _as if_ rule would apply
and the object would mediate the operation.

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

Reply via email to