You are mistaken :) 

try:

(apply str [:a :b :c])
(apply str [:a :b :c :d :e])

> (doc apply)
-------------------------
clojure.core/apply
([f args] [f x args] [f x y args] [f x y z args] [f a b c d & args])
Applies fn f to the argument list formed by prepending intervening 
arguments to args.
nil

On Tuesday, March 26, 2013 8:44:49 PM UTC+1, Ryan wrote:
>
> Thanks Michael, but If i am not mistaken, your example only works with a 
> vector with two elements. What if we have an unknown number of vector 
> elements?
> My apologies if that wasn't clear on my first post.
>
> On Tuesday, March 26, 2013 9:38:55 PM UTC+2, Michael Klishin wrote:
>>
>>
>> 2013/3/26 Ryan <areka...@gmail.com>
>>
>>> What i am trying to do is to apply the elements of my vector as 
>>> arguments to the function. How can I achieve this?
>>
>>
>> user=> (apply (fn [a b] (println a b)) [:a :b])
>> :a :b
>> nil
>>
>> -- 
>> MK
>>
>> http://github.com/michaelklishin
>> http://twitter.com/michaelklishin
>>  
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to