Roy Smith wrote: > DH <[EMAIL PROTECTED]> 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?
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 -- http://mail.python.org/mailman/listinfo/python-list