Hi Sigrid,
Was clojure-contrib compiled with a relevant "-Dclojure.jar="
option? For example,
ant -Dclojure.jar=/path/to/clojure.jar
For what it's worth, I startup a Clojure REPL with:
java -cp c:\dl\clojure\clojure.jar;c:\dl\clojure-contrib\clojure-
contrib.jar;. clojure.lang.Repl
And I was able to run:
user=> (use 'clojure.contrib.repl-utils)
nil
user=> (source map)
(defn map
"Returns a lazy sequence consisting of the result of applying f to
the
set of first items of each coll, followed by applying f to the set
of second items in each coll, until any one of the colls is
exhausted. Any remaining items in other colls are ignored. Function
f should accept number-of-colls arguments."
([f coll]
(lazy-seq
(when-let [s (seq coll)]
(cons (f (first s)) (map f (rest s))))))
([f c1 c2]
(lazy-seq
(let [s1 (seq c1) s2 (seq c2)]
(when (and s1 s2)
(cons (f (first s1) (first s2))
(map f (rest s1) (rest s2)))))))
([f c1 c2 c3]
(lazy-seq
(let [s1 (seq c1) s2 (seq c2) s3 (seq c3)]
(when (and s1 s2 s3)
(cons (f (first s1) (first s2) (first s3))
(map f (rest s1) (rest s2) (rest s3)))))))
([f c1 c2 c3 & colls]
(let [step (fn step [cs]
(lazy-seq
(let [ss (map seq cs)]
(when (every? identity ss)
(cons (map first ss) (step (map rest ss)))))))]
(map #(apply f %) (step (conj colls c3 c2 c1))))))
nil
Kev
On Apr 25, 4:41 pm, Sigrid <[email protected]> wrote:
> Hi,
>
> I'm just starting with clojure, and I cannot get to use the
> clojure.contrib.repl-utils/source function:
>
> user=> (use 'clojure.contrib.repl-utils)
> nil
> user=> (source map)
> Source not found
> nil
>
> I have the clojure-sources.jar in my classpath:
>
> alias repl='java -cp /Users/hunli/Library/clojure/clojure.jar:/Users/
> hunli/Library/clojure/clojure-contrib.jar:/Users/hunli/Library/clojure/
> clojure-sources.jar clojure.lang.Repl'
>
> Does anyone have an idea what I'm doing wrong?
>
> thanks a lot for any help
> Sigrid
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---