5 ms·
> "first-class functions require references in Perl 5" yes thats what i meant. to put it simply. perl4 did not have lexical variables, first class functions, pr
by tomneo 17y ago
> "first-class functions require references in Perl 5"
yes thats what i meant. to put it simply.
perl4 did not have lexical variables, first class functions, proper syntax for nested data structures.
larry said let there be references. its one big hammer to solve all problems.
i think perl6 is using a different appoach based on laziness for nested data structures. there are always strings and do blocks which assign and return globs with randomised but unique name(gensym but perls gensym is returns a GLOB reference so you have to write ur own).
reference context == continuation right ??
in sub bar { ... $foo = sub { .... } ... return \$foo},
i think \$foo also captures the lexpad of bar using a single reference to $foos internals. thats all.
otherwise i think one would need continuations like in ruby or scheme or perl6.