I'm sorry, but I gotta get back on the
no-global grail trail for at least one
more post.


> The granularity [of currying] can be
> controlled on a sub-by-sub or on a
> class-by-class basis.

If one could do something like this:

  {
   my $src  = 'oldname1';
   my $dest = 'newname1';
   use FileUtils.default($src, $dest);
   # FileUtils subs now use $src and/or
   # $dest if $src and/or $dest args are
   # not supplied at run-time:
   &foo;
   &foo('oldname2','newname2');
  }
  # FileUtils subs revert to normal

  sub foo (;$src, $dest) {
   &FileUtils::rename($src, $dest);
  }

where FileUtils is a module (ie one can
curry classes OR modules), and where the
use XXX.default has something akin to the
effect of currying FileUtils sub calls
/if the relevant args do not exist/ till
the end of the enclosing lexical scope
for the current execution thread, and
where all of this can be done without a
significant hit to performance, then you
appear to have completely eliminated the
practical need for creating globals and
replaced it with a succinct and intuitive
way to express what's going on (even if
my example above isn't the clearest way
to explain it).

--
ralph

Reply via email to