Re: var args with recur

2015-01-20 Thread Francis Avila
The difference is how rest args are handled. From the "recur" documentation: In particular, if the recursion point was the top of a variadic fn method, > there is no gathering of rest args - a single seq (or null) should be > passed. > So your two calls are not the same. f1 calls (recur x some-

Re: var args

2010-09-14 Thread Meikel Brandmeyer
Hi, Am 14.09.2010 um 23:01 schrieb Alan: >> (defn make-tables >> [connection schema] >> (sql/with-connection connection >>(doseq [[name & specs] schema] >> (try >> (apply sql/create-table name specs) >> (catch Exception e >>(prn e)) You

Re: var args

2010-09-14 Thread Alan
Great. Looks shiny and idiomatic to me. On Sep 14, 12:06 pm, Michael Ossareh wrote: > Alan and Patrick, thank you so much! I've come across apply in JS and > it really should have clicked for me! > > So I have the following, and it works very well: > > (defn make-tables >   [connection schema] >

Re: var args

2010-09-14 Thread Michael Ossareh
Alan and Patrick, thank you so much! I've come across apply in JS and it really should have clicked for me! So I have the following, and it works very well: (defn make-tables [connection schema] (sql/with-connection connection (doseq [[name & specs] schema] (try

Re: var args

2010-09-14 Thread Alan
First, you could use destructuring to make your map function cleaner. The following is exactly identical to your definition. It declares that it will be passed one argument; because that argument is [...], it will be a seq; it asks that the seq be split into y, the first element, and z, a seq of th

Re: var args

2010-09-14 Thread CuppoJava
Hi mike, Your problem is about to calling a function with a list of arguments, which is independent of varargs. Take a look at the "apply" function. It does what you're looking for. Cheers -Patrick On Sep 14, 2:47 am, Michael Ossareh wrote: > Hi, > > I don't fully understand how to make real use