David L. Nicol wrote:
>
>
> To answer my own question, the thing I found annoying about the syntax
> when it was shown to me was that it seemed to break portability: you can't
> cut from a function called A that returns something by assigning to A and
> paste into a function called B to get the same functionality.
Maybe that's a good thing, by discouraging cargo-culting.
Another issue is, what is the scope of the symbol?
AFAICT, it can't be lexical and it can't be dynamic.
The former, because it can't be closed over:
sub foo {
return sub {
foo = 5;
}
}
$cr = foo();
$cr->(); # what just happened?!
And it being dynamic is problematic too:
sub foo {
foo = 4; # supposed to work, but...
}
foo = 6; # makes no sense!
> make $__ mean "An alias for the
> L-value of what the subroutine return value will get assigned to, or
> ${undef} if we're not invoked as an R-value."
I think that's unnecessarily baroque. Just let $__ be an alias
to the return value stack, the place where return() puts its
args anyway. In fact, shouldn't it be @__ ?
Too bad it's too late to write an RFC...
--
John Porter
A pessimist says the CPU is 50% utilized.
An optimist says the CPU is 50% unutilized.
A realist says the network is the bottleneck.