This commit is contained in:
Matthew Davidson 2023-01-04 15:48:05 +01:00
parent 51daa0cdfa
commit 475b2bea94

View file

@ -14,13 +14,13 @@
(defmacro recursive-infix [form]
(cond (not (seq? form))
__
form
(= 1 (count form))
`(recursive-infix ~(first form))
:else
(let [operator (second form)
first-arg (first form)
others __]
others (drop 2 form)]
`(~operator
(recursive-infix ~first-arg)
(recursive-infix ~others)))))