>>>>> "Jeff" == Jeff Pinyan <[EMAIL PROTECTED]> writes:

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

Uri is occasionally confused. :-)

There's a school of (mis-)thought that "a coderef is a closure".  I
don't know how that got started, but it's wrong.  A closure is created
only when lexical variables go out of scope.  So a coderef without
external references is *not* a closure, and a named subroutine *can*
be a closure.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

Reply via email to