This repository was archived by the owner on Jun 1, 2023. It is now read-only.
This repository was archived by the owner on Jun 1, 2023. It is now read-only.
Make nested function definitions lexical by default #383
Open
Description
sub makeAddr($x) {
sub adder($y) {
return $x + $y
}
\&adder
}
as if declared as my sub adder
, adder is not added to the global namespace. But if the function is declared within eval string it is global, even when in another function block.
You can also declare it as our sub adder
to extend the scope to the current package, to be found with the method dispatch. The CV itself is stored in the lexical pad of makeAddr though still.
See also http://www.erights.org/elib/capability/ode/ode-objects.html