Hi all,
Sorry for my noob question (again). I'm trying to understand clojures
binding model.
Typing:
(def state {:status "foo"})
(def rule '(if (= (:status sate) "foo") (println "foo") (println
("bar")))

(defn fn []
  (let [state {:status "bar"}]
    (eval rule)))

This prints "foo". However, I would have expected the binding of state
created by let would shadow the global binding of state.
Now

(defn fn1 []
  (binding [state {:status "bar"}]
    (eval rule)))
Does the right thing. Can someone explain what's going on here please?

Kind Regards
Andreas

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to