Ah! I was passing `apply` a list who's first element was a symbol, rather 
than the function itself.

Got it. Thanks Ambrose and Ben!


On Wednesday, March 18, 2015 at 5:10:45 PM UTC-4, Ambrose Bonnaire-Sergeant 
wrote:
>
> [vector] is a vector with the vector predicate.
>
> '(vector) is a vector with the symbol 'vector.
>
> `(~vector) is similar to what [vector] gives you.
>
> On Wed, Mar 18, 2015 at 5:01 PM, John Gabriele <jmg...@gmail.com 
> <javascript:>> wrote:
>
>> I see that you can pass extra args to `apply` --- between the func and 
>> the coll args --- and `apply` will prepend the extras to the coll before 
>> proceeding. For example, these all work:
>>
>>     (apply + [1 2 3 4])
>>     (apply + 1 2 [3 4])
>>     (apply + 1 2 '(3 4))
>>
>> While thinking about how the following works:
>>
>> ~~~
>> (apply map vector [[:a :b :c]
>>                    [:i :j :k]
>>                    [:x :y :z]])
>> ~~~
>>
>> I found this:
>>
>> ~~~
>> some-app.core=> (apply map [vector [:a :b :c] [:i :j :k] [:x :y :z]])
>> ([:a :i :x] [:b :j :y] [:c :k :z])
>>
>> some-app.core=> (apply map '(vector [:a :b :c] [:i :j :k] [:x :y :z]))
>> ArityException Wrong number of args (3) passed to: Symbol  
>> clojure.lang.AFn.throwArity (AFn.java:429)
>> ~~~
>>
>> Why does it fail when I pass a list there instead of a vector?
>>
>>  -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com 
>> <javascript:>
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+u...@googlegroups.com <javascript:>
>> 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+u...@googlegroups.com <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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/d/optout.

Reply via email to