Activity

TEttinger pointed out on IRC that the forms in the example run without error if you wrap them in a (do) block. Here is an example using files. Relevant code is in src/unbound_eg/tst[12].clj. Example output shown below.

Kevin Downey
added a comment - 18/Apr/14 12:23 AM this is just a fact of clojure's compilation model and how vars work.
a var is a little mutable cell
(declare foo) declares that a mutable cell exists with the name foo, it doesn't contain a value
foo then gets the value of the mutable cell (which has none)
(defn foo [] 1) then sets the value of the cell named foo to the function created from (fn [] 1)