Skip to content

Instantly share code, notes, and snippets.

@hiredman
Created June 7, 2011 19:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save hiredman/1013008 to your computer and use it in GitHub Desktop.
Save hiredman/1013008 to your computer and use it in GitHub Desktop.
(def foo (fn foo [x]
(if (zero? x)
x
(foo (dec x)))))
(dotimes [i 3]
(println "lexical binding run" i)
(time
(dotimes [i 1000]
(foo i))))
(def bar (fn [x]
(if (zero? x)
x
(bar (dec x)))))
(dotimes [i 3]
(println "var binding run" i)
(time
(dotimes [i 1000]
(bar i))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment