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-
This stumped a few of us on #clojure, with a debate as to whether this is a
compiler error or has a legitimate explanation.
My initial examination:
https://www.refheap.com/96295
A more minimal example:
https://www.refheap.com/96296
What's going on?
Andrew
--
You received this message becau
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
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]
>
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
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
Hi,
I don't fully understand how to make real use of varargs and
destructuring. c.c.sql/create-table is defined as follows:
(create-table name & specs)
Called as follows:
(c.c.sql/create-table
:tblname
[:cola :text "NOT NULL" "PRIMARY KEY"]
[:colb :number "NOT NULL"]
[:colc :blob "NOT NULL"
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