Pascal's triangle: Difference between revisions

Content added Content deleted
(Clojure)
(Clojure)
Line 67: Line 67:
=={{header|Clojure}}==
=={{header|Clojure}}==


For n < 1, prints nothing, always returns nil. Copied from the Common Lisp implementation above, but with local functions and explicity tail-call-optimized recursion (recur).
For n < 1, prints nothing, always returns nil. Copied from the Common Lisp implementation above, but with local functions and explicit tail-call-optimized recursion (recur).
(defn pascal [n]
(defn pascal [n]
(let [newrow (fn newrow [lst ret]
(let [newrow (fn newrow [lst ret]