7
所以我想先执行一堆代码,然后然后询问用户是否他想再做一次。我想到的最便捷的方式做这将是一个do-while循环类似于C++,因为我似乎无法找到Clojure中的任何DO-同时功能,我写了下面:Clojure中的Do-while循环?
(defmacro do-while
"Executes body before testing for truth expression"
[test & body]
`(do (do [email protected]) (while ~test [email protected])))
会有没有更好的(比如更习惯性的Clojure-ish)写这个宏的方式,或者更好的方式做我想做的事,而不需要通过do-while路径?