James Mastros wrote:
> 
> Oh, here's an idea WRT extending the concept to cover both scalar and list
> assignment:  Have $^R be the return in scalar context, and @^R be the return
> in list context.  If @^R is unset, then a one-element list of $^R is returned.

I don't like where this is leading.  Currently perl does not allow
modification of lists (vs. arrays).  The operations supported for
lists are a tiny subset of those supported for arrays: assignment-from,
single-item index, and last-element-of.  Simply setting up an array
alias to a list won't magically give us all those array operations
for the list.  In order to C< push @^R >, there has to be a data
structure there that supports the push operator.  And if that is
going to be the case, then I don't see the point in all this over
having your own array variable and returning that when you're done.

-- 
John Porter

You can't keep Perl6 Perl5.

Reply via email to