I’m encountered with this situation:
(fn produce [] '(val0 val1))
;...
(loop [
arg0 false
arg1 false
arg2 false]
;...
)
Is there some sort of unpack function/macro such that you could call
(recur (unpack (produce)) :arg2)
within the loop context? I’m aware that I could just do something like
(recur (nth (produce) 0) (nth (produce) 1) :arg2)
but surely the former solution would be more elegant?
IIRC Common Lisp code can return more than one value, can Clojure too?
Maybe destructuring in the
loopbindings themselves will help?lets you
(recur (produce) arg2)in the loop body, with the 2-element sequence returned byproducedestructured and bound toarg0andarg1.