|
|
|
|
|
by prollyignored
4785 days ago
|
|
> This decreases the syntactic pain use 5.018;
no warnings "experimental::lexical_subs";
use feature "lexical_subs";
Don't use perl experimental features. Not portable. Not well thought.May break horribly. "state sub creates a subroutine visible within the lexical scope in which it is declared. The subroutine is shared between calls to the outer sub." So you should be using "state sub" Or use python which has non-experimental "inner functions" |
|
But, somebody will probably write a "lexsub" pragma that does away with the "no warnings ...", and portability becomes less of an issue over the course of time, much like I can nowadays treat the features of v5.10 as given.
Perl had nested functions since v5, just with akward syntax. Does Python have proper <del>variable declarations</del> closures? That is more of a dealbraker than non-experimental nested function syntax for me ;-)