Details
-
Type:
Defect
-
Status:
Closed
-
Resolution: Declined
-
Affects Version/s: None
-
Fix Version/s: Backlog
-
Component/s: None
-
Labels:None
Description
When you recur inside a function, the arguments are not assigned as expected:
(defn weird [& b]
(println b)
(when (< (first b) 2)
(recur (inc (first b)))))
(weird 1)
The first time it runs, b is a seq, but the second time it's just an integer.
After some discussion I found out this is because there's no way to apply recur, so technically making recur act as a normal function call means you can't pass a seq of args in. While this is arguably a decent workaround, it leads to very confusing, undocumented behaviour; at the very least it should be tracked in an issue until a better solution can be found.
Converted from http://www.assembla.com/spaces/clojure/tickets/283