News for hackers. Stuff that matters.
Re:Python’s lambda is broken by jrockway on Thursday April 09, 2009 @01:42PM (#554765)
The deeper issue here is "mutation is hard to reason about". Well, yeah.
Re:Python’s lambda is broken by miloshh on Thursday April 09, 2009 @03:45PM (#555000)
Well, I would disagree - the problem is that there is no apparent mutation in the given example. There is hidden mutation, in that the list comprehension mutates its variable. This is probably done for efficiency, but I would claim it's a bad design decision.
Re:Python’s lambda is broken by dreish on Thursday April 09, 2009 @03:46PM (#555002)
Since that's Clojure's motto, let's see how it does:

  user=> (def fs (vec (for [i (range 10)] #(+ i %))))
  #'user/fs
  user=> ((fs 3) 4)
  7
Looks good.