My Lisp-fu is lower than the expected for this exercice. But it seems that you have to create a recursive function not a recursive macro, which is what you are doing.
Maybe the macro has to define a new recursive function that recurses until need, and then call it?
I'm not sure, but I think you need to use labels, rather than flet, in this case, since local functions defined using flet cannot be recursive. At least that's how I interpret what it says on page 319.
Comments
My Lisp-fu is lower than the expected for this exercice. But it seems that you have to create a recursive function not a recursive macro, which is what you are doing.
Maybe the macro has to define a new recursive function that recurses until need, and then call it?
Yes, I believe local functions are usually defined with flet.
I'm not sure, but I think you need to use labels, rather than flet, in this case, since local functions defined using flet cannot be recursive. At least that's how I interpret what it says on page 319.
At any rate, this solution works using labels:
(Sorry, but again I don't know how to preserve the formatting of my code in this newsgroup.)http://news.ycombinator.com/formatdoc