Skip to content

Instantly share code, notes, and snippets.

@athos
Created December 12, 2012 12:47
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save athos/4267473 to your computer and use it in GitHub Desktop.
Save athos/4267473 to your computer and use it in GitHub Desktop.
an example of *default-data-reader-fn*, a feature of Clojure 1.5
(ns reader-test)
(alter-var-root #'*default-data-reader-fn* (fn [_] cons))
#defn(fibs [n]
#letfn([#f([a b] #lazy-seq(#cons(a, #f(b, #+(a, b)))))]
#take(n, #f(0, 1))))
; #fibs(10) => (0 1 1 2 3 5 8 13 21 34)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment