The are two parts to the answer:
The "rest" parameter of a variadic function becomes the final parameter in any
recur
forms that recur to the top of the function. At this point it is no longer special in any way. You'll normally want to ensure that any values passed in that position actually are sequential, but even this is not enforced.1Destructuring is just syntactic sugar provided by the
fn
andlet
macros. The desugared version of anfn
form that uses destructuring in its parameter vector takes a certain number of regular arguments, then destructures them in alet
form wrapping the entire body. Thus if you recur to the top of a function that uses destructuring in its parameter vector, the new values will be destructured for the next iteration.
1 For example, ((fn [& xs] (if (seq? xs) (recur (first xs)) xs)) 1 2 3)
returns 1
.