News for hackers. Stuff that matters.
Re:Evolution of a Python programmer by brehaut on Friday January 29, 2010 @02:08PM (#1087253)
;; python programmer who reads HN and Proggit

(defn factorial [n] (reduce * (range 1 (inc n))))

Re:Evolution of a Python programmer by Torn on Friday January 29, 2010 @06:33PM (#1087861)

  ;; Any programmer reading HN long enough to experiment with some lisp / clojure ;)
  (defn factorial [n]
    (apply * (range 1 (+ n 1))))
Re:Evolution of a Python programmer by brehaut on Friday January 29, 2010 @06:47PM (#1087885)
I was torn between those two formulations, but decided on the reduce because the academic purity of an implicit hylomorphism ;) However, your formulation is more idiomatic of a lispy solution.