Changes for clojure.core/binding

zkim on Wed, 20 Oct 2010
;; Here are the definitions.
(defn mymax [x y]
  (min x y))

(defn find-max [x y]
  (max x y))

user=> (let [max mymax]
         (find-max 10 20))

20 ;let is ineffective outside current lexical scope


user=> (binding [max mymax]
         (find-max 10 20))

10 ;because max is now acting as min
kumarshantanu on Wed, 11 Aug 2010
(defn mymax [x y]
  (min x y))

(defn find-max [x y]
  (max x y))


They are the definitions.

(let [max mymax]
  (find-max 10 20))

Output: 20 (let is ineffective outside current lexical scope)

(binding [max mymax]
  (find-max 10 20))

Output: 10 (because max is now acting as min)
kumarshantanu on Wed, 11 Aug 2010
(defn mymax [x y]
  (min x y))

(binding [max mymax]
  (max 10 20))

Output: 10 (because max is now acting as min)