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-seq) which is 
the same as (apply f1 x some-seq). f2 calls f1 without apply, so f1's args 
are at that moment x and a seq of one item containing the seq used to call.

To get the results you expect, change f2 to

(defn f2 [x & ys]  (if x    (apply f2 (not x) ys)    ys))


On Tuesday, January 20, 2015 at 4:17:58 AM UTC-6, Hello Funk wrote:
>
> 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 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