Michele Simionato a écrit : > 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).
IIRC, Haskell's 'variables' are constant (ie: you cannot rebind nor mutate them). -- http://mail.python.org/mailman/listinfo/python-list