On Nov 6, 7:37 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > On Nov 6, 2007 6:23 PM, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > > Lots of people ask about this. The behavior you observed is the expected > > (by the implementors, anyway) behavior. > > Are there languages where closures *don't* behave like this? A closure > that used a copy of the state rather than the actual state itself > doesn't seem as useful. For references sake, JavaScript (the only > language that a) has closures and b) I have a handy way to test with) > does the same thing.
Closures in Haskell's list comprehensions work as Fernando (and many others would expect). See for instance this post: http://groups.google.com/group/comp.lang.python/browse_frm/thread/d691240a5cfebcdf/63234494ebbca54e?hl=en&lnk=gst&q=simionato+haskell#63234494ebbca54e Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list