I guess I'm not understanding the problem then, because I thought we were not supposed to expand into a do, since the problem states:
"Define ntimes (page 167) to expand into a (local) recursive function instead of a do."
Isn't the problem asking you to write this without expanding into a do, or am I missing something here? What would be a correct solution to the problem?
Oops, didn't read the problem. Yes, as other commenters say, you should expand into a call to a recursive function, not an expression that gets expanded recursively.
If you were writing this for real you'd expand into a do, so this problem is somewhat artificially difficult.
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.
"Define ntimes (page 167) to expand into a (local) recursive function instead of a do."
Isn't the problem asking you to write this without expanding into a do, or am I missing something here? What would be a correct solution to the problem?