Skip to content

Instantly share code, notes, and snippets.

@marioaquino
Created May 12, 2014 03:00
Show Gist options
  • Save marioaquino/7da579b057cb0fb3a176 to your computer and use it in GitHub Desktop.
Save marioaquino/7da579b057cb0fb3a176 to your computer and use it in GitHub Desktop.
Clojure evaluation order
(defn left []
(println "Left")
"Left")
(defn right []
(println "Right")
"Right")
(defn middle [a b]
(println "Middle " a b)
"Middle")
(defn outermost [a b c]
(println "Outermost...")
(println "Outermost " (a) b (c)))
(outermost left (middle :a :b) right)
@puredanger
Copy link

without a REPL, I'd guess:

Middle :a :b
Outermost...
Left
Right
Outermost Left Middle Right

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment