Python vs. Lisp -- please explain

Cameron Laird claird at lairds.us
Sun Feb 19 12:08:26 EST 2006


In article <roy-36D3DC.08084219022006 at reader2.panix.com>,
Roy Smith  <roy at panix.com> wrote:
>DH <no at spam.com> wrote:
>> -python has true closures (although nothing like ruby's blocks)
>
>What is a "true closure"?  Or, maybe what I'm asking is what kind of 
>closure wouldn't be a true closure?  Is there some kind of ersatz closure 
>other language try to pass off, in violation of truth in closure laws?

It's an apt question.

What's a "true closure"?  That's the easiest part, in some ways:  
Wikipedia, for example, tells that it's "a function that refers
to free variables in its lexical context" <URL:
http://en.wikipedia.org/wiki/Closure_%28computer_science%29 >,
that is the context of the domain of the function's definition.

Some languages--Lisp, but also many others--definitely have it.
Basic definitely didn't.  Tcl ... well, after weeks of discussion
<URL: http://wiki.tcl.tk/closures >, the conclusion was that Tcl
almost has as much as it can, given that "lexical context" just
doesn't have much standing in Tclonia.  So, yes, George Mikan and
Allen Iverson both definitely played basketball, and well, but,
at the same time, it's useful to distinguish the things they do
with a ball.



More information about the Python-list mailing list