评论者:steveminer@gmail.com
如果这个评论偏离了主题,请见谅。但原始例子对我来说有点困惑。也许它可以这样:
`
(defmacro nestfn [n & body]
(if (> n 0)
`(fn [] (nestfn ~(dec n) ~@body))
`(do ~@body)))
`
这样{{(trampoline (nestfn 10 "foo"))}}会返回"foo"。然而,在macOS上,当n=1000时,我确实遇到了CompilerException java.lang.StackOverflowError。