On May 31, Randal L. Schwartz said:

>>>>>> "Jeff" == Jeff Pinyan <[EMAIL PROTECTED]> writes:
>
>Jeff> A closure is an ANONYMOUS function (constructed via $x = sub {
>Jeff> ... }) that contains LEXICAL variables that have been defined in
>Jeff> a scope visible to the closure itself.
>
>leave out the word ANONYMOUS there.
>
>ANONYMOUS and CLOSURE are orthogonal.
>
>in "BEGIN { my $x; sub foo { ... $x ... } }", foo is a CLOSURE
>and is not ANONYMOUS.

I was scolded highly about that by Uri, back when my article[1] about
closures.  I, too, felt that foo() should be called a closure, but Uri
seemed so convincing.  If you're going to let me say that functions that
refer to lexical variables in such a fashion are closures, thank you, I
can return my normal "sane" self.


[1] "Using Closures", by Jeff Pinyan, May 2000:
http://www.pobox.com/~japhy/articles/pm/2000-05.html

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
Are you a Monk?  http://www.perlmonks.com/     http://forums.perlguru.com/
Perl Programmer at RiskMetrics Group, Inc.     http://www.riskmetrics.com/
Acacia Fraternity, Rensselaer Chapter.         Brother #734
**        I no longer need a publisher for my Perl Regex book :)        **

Reply via email to