Introduction:
while discussing fortranesque three-way comparative operators,
I imagined what I believe may be a workable syntax for differentiating
an in-place replacement from a callable subrouting, for Perl.
Idea:
Instead of introducing a new keyword, have any sub consisting of
only one expression get replaced in the op tree with that expression,
instead of a subroutine-calling mechanism. Complex in-place-expandables
could be implemented with
sub foo{ do {
...
}};
Possible problem:
redefinition of routines. The inline-expanded routine name could either
maintain a list of everywhere it appears in the op tree, for
rereplacement, or the in-place replacement optimization could only happen
when we are certain that *foo isn't going to get assigned to from
any coderefs.
--
David Nicol 816.235.1187
free Dmitry Skylarov
Thread Next