Re: Python vs. Lisp -- please explain
Roy Smith wrote:[color=blue]
> DH <no@spam.com> wrote:[color=green]
> > -python has true closures (although nothing like ruby's blocks)[/color]
>
> 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?[/color]
A "true closure" is what Python doesn't have ;)
If you enclose variables in a certain functional context in which they
are not defined they are turned into something immutable in Python.
Assigning a value to the same name creates a new object instead of
rebinding the old name. This "readonly" semantics confuses many
programmers coming from other languages at least all Lispers/Schemers
I've talked to. Python does not provide a rebinding operator for free
variables by BDFL decision.
Kay
Roy Smith wrote:[color=blue]
> DH <no@spam.com> wrote:[color=green]
> > -python has true closures (although nothing like ruby's blocks)[/color]
>
> 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?[/color]
A "true closure" is what Python doesn't have ;)
If you enclose variables in a certain functional context in which they
are not defined they are turned into something immutable in Python.
Assigning a value to the same name creates a new object instead of
rebinding the old name. This "readonly" semantics confuses many
programmers coming from other languages at least all Lispers/Schemers
I've talked to. Python does not provide a rebinding operator for free
variables by BDFL decision.
Kay
Comment