I am having trouble getting the function fixed-point from Clojure-Contrib Graph to run. Admittedly the problem is trivial. I have tried to use the techniques shown in loading clojure-contrib but am still running into trouble.
Note: I am using Leiningin to start the REPL.
Here's the source code for fixed-point:
(defn fixed-point
"Repeatedly apply fun to data until (equal old-data new-data) returns true. If max iterations occur, it will throw an exception. Set max to nil for unlimited iterations."
[data fun max equal]
(let [step (fn step [data idx]
(when (and idx (= 0 idx))
(throw (Exception. "Fixed point overflow")))
(let [new-data (fun data)]
(if (= data new-data)
new-data
(recur new-data (and idx (dec idx))))))]
(step data max)))
I can't seem to get an output from this function besides "Fixed point overflow." Could somebody show an example that works.