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] (defmacro recursive-infix [form]
(cond (not (seq? form)) (cond (not (seq? form))
__ form
(= 1 (count form)) (= 1 (count form))
`(recursive-infix ~(first form)) `(recursive-infix ~(first form))
:else :else
(let [operator (second form) (let [operator (second form)
first-arg (first form) first-arg (first form)
others __] others (drop 2 form)]
`(~operator `(~operator
(recursive-infix ~first-arg) (recursive-infix ~first-arg)
(recursive-infix ~others))))) (recursive-infix ~others)))))