Re: apply arguments

2016-12-14 Thread Rafo Ufoun
Ok now I understand ! So this implementation of apply act like this, and all implementations need, as the last arg of all the list, a sequence. Thank you Le mercredi 14 décembre 2016 13:59:40 UTC-5, James Reeves a écrit : > > On 14 December 2016 at 17:38, Rafo Ufoun > wrote: > >> Hi, thank y

Re: apply arguments

2016-12-14 Thread James Reeves
On 14 December 2016 at 17:38, Rafo Ufoun wrote: > Hi, thank you for your response ! > > I know the '& args' notation, but I thought that this notation expected a > collection *after *the &, so in the apply signature, we expect a fn, 4 > args and then, a sequence. > > In this call : (apply + 1 1 1

Re: apply arguments

2016-12-14 Thread Rafo Ufoun
Hi, thank you for your response ! I know the '& args' notation, but I thought that this notation expected a collection *after *the &, so in the apply signature, we expect a fn, 4 args and then, a sequence. In this call : (apply + 1 1 1 1 1 1 1 1 1 1 1 [2 3]), the & should be here : (apply + 1

Re: apply arguments

2016-12-14 Thread James Reeves
Clojure functions can take a collection of arguments by using the "&" symbol. So for instance: (defn print-all [& args] (doseq [arg args] (println arg))) If we run this function with: (print-all "Hello" "World") Then it will print: Hello World But dealing with se

apply arguments

2016-12-14 Thread Rafo Ufoun
Hi everyone, I'm new to clojure and I try to understand the apply function. >From the clojure sources, I can see that there are several signatures for this method: with or without additional arguments before the sequence. According to these signatures, we can have 4 arguments MAX before gettin