Buddha Buck wrote:
> Why is [...] better than
>
> 1 until defined($foo=getvalue()); return $foo;
small incremental improvement to [read|writ]ability
writability:
one less thing to write
one less variable name to have to remember not to collide with
readability:
keyword "it" means look at very recent code, instead of starting
at the top of the block and reading down to find what $foo
is (trivially solvable by reading backwards...)
when they're all calls to the same function it doesn't help, but
if they are possible return points from a long routine, it would
be nice to formalize the object-of-defined construction.
It would not be difficult to implement. Would it? the it.pm
module would export "it" as a function that returns whatever is
in $nicol::it::itstash and invoke a source filter that replaces
the last instance of exists or defined before an occurance of "it"
with an alternate implementation that sets the stash.
--
David Nicol 816.235.1187 dnicol@cstp.umkc.edu
# die smiling;
Thread Previous
|
Thread Next