In your example, [1 2 3 4 5] allocates and initializes a vector with the 5
elements 1 2 3 4 5.
The first (def my-vec ...) also allocates a Var, and makes it 'point' at
the vector [1 2 3 4 5].
When you do (assoc my-vec 2 "hello"), it looks up the current value pointed
at by my-vec, which is the im
New to Clojure (find it fascinating so far, in large part due to watching
approximately a billion Rich Hickey vids on YouTube). I had a similar
question and figured I just resurrect this thread on it.
My naive thought was that when you (re)def a variable, you aren't actually
copying over the ol
Hi Jared,
Some good clojure specific learning resources;
http://java.ociweb.com/mark/clojure/article.html
and the essential http://clojure.org/
- Regards, Adrian
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to
On Mon, Jun 14, 2010 at 4:09 PM, Jared wrote:
> I'm trying to grok this hello world template before I move on to other
> stuff. What is the ns line for? I read the documentation on ns, but it
> didn't make much sense to me. Is ns related to scope? All I know is
> when I delete the ns line the pro
On Jun 14, 10:09 pm, Jared wrote:
> Also, I thought this language is functional but I'm able to do change
> declarations in the repl. For example:
> user=> (def x 1)
> #'user/x
> user=> x
> 1
> user=> (def x 2)
> #'user/x
> user=> x
> 2
> user=> (def x (+ 1 x))
> #'user/x
> user=> x
> 3
>
> Why do
I want to thank everyone for the helpful comments, and no worries
about the typing nickikt. I'll check out SICP. I've been playing
around in the repl, getting used to prefix notation, and I found out
the doc command. It makes learning this stuff much faster.
I guess I should have been more clear
Hello,
I have a some comments (on comments and more :))
First this
(comment . )
There are diffrent kind ofs comments. If you just want to note
something you can do ; but mabey you want to have a example how to use
something in your Code then use (comment ).
With "defn" you creat a new f
I don't think that Structure and Interpretion of Computer Programs is
a good first-book if you want to start lisp-programming (Especially
Clojure). It's very detailed and gives much insights, but Clojure is
way more practical than this book. If you want to start programming
Clojure, I'd recommend "
If your are new to programming I recommend reading at least the first
three chapters of The Structure and Interpretation of Computer
Programs. It's available online.
David
On Friday, June 11, 2010, Jared wrote:
> Hi everyone,
>
> I'm 100% new to LISP, 95% new to Java, and 90% new to programming