[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

Re: closure in closure



Gurusamy Sarathy writes:
: On Wed, 15 Dec 1999 22:01:04 PST, Larry Wall wrote:
: >Pixel writes:
: >: This surprised me:
: >: 
: >: foreach my $t (1..5) {
: >:     push @bad, sub { sub { $t } };
: >: }
: >: foreach my $t (1..5) {
: >:     push @good, sub { my $t = $t; sub { $t } };
: >: }
: >: print "[", &{&$_}, "]\n" foreach @bad, @good;
: >
: >Looks to me like pad_findlex() needs to be rewritten to be recursive,
: >and upon each return install extra symbol table entries in the
: >in-between pads so all the cloning happens right.
: 
: This ought to fix it.

Neato cool.

: +				     * XXX fix pad_foo() to not use globals */

Shouldn't that be pad fu?

:-)

Hmm, maybe I should give a talk about Perl as a martial art...

Larry


Follow-Ups from:
Gurusamy Sarathy <gsar@ActiveState.com>
References to:
Gurusamy Sarathy <gsar@ActiveState.com>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]