Our task is to create something that looks like a “for” command from GoLang
We have some code that looks like this:
(defmacro for-loop [[symbol initial check-exp post-exp] & code] `(loop [~symbol ~initial] (if ~check-exp (do [email protected] (recur ~post-exp)))))
The question is how to do the “break” and “continue” commands since we can’t throw recurs in the middle of the code.
It is being called like this:
(for-loop [i 0 (< i 10) (inc i)] (print i))