setting variables in outer functions

Neil Cerutti horpner at yahoo.com
Thu Nov 1 10:28:33 EDT 2007


On 2007-11-01, Hrvoje Niksic <hniksic at xemacs.org> wrote:
> Duncan Booth <duncan.booth at invalid.invalid> writes:
>
>> In real life code methods are used to implement callbacks
>
> When I said "closures are used ...", I wasn't trying to be
> preachy about how I think callbacks should be implemented, just
> explaining the use (and usefulness) of *closures*.  I'm not
> saying closures are the only method of implementing stateful
> callbacks, nor that they're the best method around in all
> circumstances.
>
>> What is your point here?
>
> I was simply responding to a subthread that only evaluated
> closures as a SICP-style OOP implementation mechanism.  That is
> missing the point of closures.

It really depends on how wide your definition of primitive object
system is. Can you come up with a use-case for nonlocal that
doesn't appear to be a primitive object system?

-- 
Neil Cerutti
To succeed in the world it is not enough to be stupid, you must also be well-
mannered. --Voltaire



More information about the Python-list mailing list