Hello,

thank you very much for your answer, it is exactly what I was looking for !

Le vendredi 8 juin 2012 13:35:36 UTC+2, Gabo a écrit :
>
> Hello,
>
> I'm a beginner with Clojure and trying some basic stuff.
> I'm actually working on a simple function which would replace the nth 
> element of a vector.
>
> I'm using this function
>
> (def ids-in-use (ref [1 2 3]))
> (defn update-vector [v tid]
> (assoc v tid 10))
> (update-ids-in-use [2])
>
> The problem is that tid is not recognized as an Integer. I suppose I'm 
> doing it the right way, functional programming is new for me.
> My idea here is to parametrize the position where the assoc has to be done.
>
> I'm also looking for basic code examples to learn that kind of basic stuff.
>
> Thank you for your help.
>

-- 
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

Reply via email to