Also keep in mind that defs are *global* names, even if the def form
appears inside another form. They are really meant for static (immutable)
values.

So, something like

(defn foo []
  (def a {})
  ...)

does NOT define a local variable a within foo, but a global a.

On the other hand,

(defn foo []
  (let [a (atom {})]
    ..))

does define a local name for a mutable reference.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to