Damian Conway wrote:
> 
> The lvalue accessor *shouldn't* be doing the assignment (what if an assignment
> isn't what I want?).
> 
> The (overloaded) operator = should do the assignment. To whatever lvalue
> the lvalue subroutine returns.
> 
> Or the "assignment" should be done by operator += or operator++ or
> whatever mutator I'm actually applying to the returned lvalue.

Good distinctions. So, if I'm reading you right, this won't work?

   @oldpath = $tree->path('L','R') = ('R');

Basically, the lvalue sub by your definition is just a "stupid" accessor
that returns an lvalue. @oldpath, by your definition, would have to
contain ('R').

My feeling is that $tree->path should be able to do anything it wants,
including returning a different value than was passed in. Otherwise, you
can't chain stuff together above, which is potentially really useful
(especially for us really lazy types).

I'd like to see both supported, but this does seem to require different
mechanisms. Maybe some combination of :lvalue and lreturn could
accomplish this?

-Nate

Reply via email to