diff options
author | scgilardi <scgilardi@gmail.com> | 2009-03-01 15:20:01 +0000 |
---|---|---|
committer | scgilardi <scgilardi@gmail.com> | 2009-03-01 15:20:01 +0000 |
commit | d404530419fdb1f5b86cf7587305533d50bf8b5a (patch) | |
tree | 280792c9bcd9b0e2aa30b403e43793c157c7ea97 /src/clojure/contrib/probabilities | |
parent | 75b13a2a10df0209c75629750077a5bd3e88fbb5 (diff) |
interim: rename clojure.contrib.macros.letfn to letfn-kh because clojure.core now defines letfn. Making this change to allow clojure.contrib to compile/run until Konrad makes his preferred fix
Diffstat (limited to 'src/clojure/contrib/probabilities')
-rw-r--r-- | src/clojure/contrib/probabilities/dist.clj | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/clojure/contrib/probabilities/dist.clj b/src/clojure/contrib/probabilities/dist.clj index 4c1d321f..a5a07c80 100644 --- a/src/clojure/contrib/probabilities/dist.clj +++ b/src/clojure/contrib/probabilities/dist.clj @@ -26,7 +26,7 @@ [m-result (fn m-result-dist [v] {v 1}) m-bind (fn m-bind-dist [mv f] - (letfn [add-prob [dist [x p]] + (letfn-kh [add-prob [dist [x p]] (assoc dist x (+ (get dist x 0) p))] (reduce add-prob {} (for [[x p] mv [y q] (f x)] @@ -91,7 +91,7 @@ pairs. In the last pair, the probability can be given by the keyword :else, which stands for 1 minus the total of the other probabilities." [& choices] - (letfn [add-choice [dist [p v]] + (letfn-kh [add-choice [dist [p v]] (cond (nil? p) dist (= p :else) (let [total-p (reduce + (vals dist))] @@ -132,7 +132,7 @@ (with-monad dist-m (defn- select-n [n xs] - (letfn [select-1 [[s xs]] + (letfn-kh [select-1 [[s xs]] (uniform (for [i (range (count xs))] (let [[nth rest] (nth-and-rest i xs)] (list (cons nth s) rest))))] |