Hi Milen,
The function `conj` "conjoins" an item into a Clojure collection. In your
case, you need to define both `coll` and `item` for the example to work.
Consider these examples -
(conj [1 2 3] 4)
(conj '(1 2 3) 4)
(conj #{1 2 3} 4)
(def coll [1 2 3 4 5])
(def item 6)
(conj coll item)
etc.
I hope that helps.
-BG
On Sat, Nov 17, 2012 at 10:15 AM, Milen Ivanov <[email protected]>wrote:
> Dear All,
>
> I am trying to make sense of Closure by reading the book Programming
> Closure, 2nd Eddition.
>
> I persistently get booed at one of the very first lines of code in the
> book:
>
> (conj coll item)
>
> The listing (rather short) is below.
>
> May I please ask you for some hint because beginner's luck seems to have
> gone missing in this case.
>
> Thanks in advance!
> Milen
>
>
> milen@linux-oaty:~> cd ~/Dropbox/Clojure/clojure-1.4.0/
> milen@linux-oaty:~/Dropbox/Clojure/clojure-1.4.0> java -cp
> clojure-1.4.0.jar clojure.main
> Clojure 1.4.0
> user=> (conj coll item)
> CompilerException java.lang.RuntimeException: Unable to resolve symbol:
> coll in this context, compiling:(NO_SOURCE_PATH:1)
> user=> (pst)
> CompilerException java.lang.RuntimeException: Unable to resolve symbol:
> coll in this context, compiling:(NO_SOURCE_PATH:1)
> clojure.lang.Compiler.analyze (Compiler.java:6281)
> clojure.lang.Compiler.analyze (Compiler.java:6223)
> clojure.lang.Compiler$InvokeExpr.parse (Compiler.java:3548)
> clojure.lang.Compiler.analyzeSeq (Compiler.java:6457)
> clojure.lang.Compiler.analyze (Compiler.java:6262)
> clojure.lang.Compiler.analyze (Compiler.java:6223)
> clojure.lang.Compiler$BodyExpr$Parser.parse (Compiler.java:5618)
> clojure.lang.Compiler$FnMethod.parse (Compiler.java:5054)
> clojure.lang.Compiler$FnExpr.parse (Compiler.java:3674)
> clojure.lang.Compiler.analyzeSeq (Compiler.java:6453)
> clojure.lang.Compiler.analyze (Compiler.java:6262)
> clojure.lang.Compiler.eval (Compiler.java:6508)
> Caused by:
> RuntimeException Unable to resolve symbol: coll in this context
> clojure.lang.Util.runtimeException (Util.java:170)
> clojure.lang.Compiler.resolveIn (Compiler.java:6766)
> clojure.lang.Compiler.resolve (Compiler.java:6710)
> clojure.lang.Compiler.analyzeSymbol (Compiler.java:6671)
> clojure.lang.Compiler.analyze (Compiler.java:6244)
> clojure.lang.Compiler.analyze (Compiler.java:6223)
> nil
> user=>
>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to [email protected]
> Note that posts from new members are moderated - please be patient with
> your first post.
> 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
--
Baishampayan Ghose
b.ghose at gmail.com
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
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