Any particular reason for the macro to use recursion instead of “do”?
I don’t understand why the function “,func-name” has both a “,param-name” and “,start” parameter. I think (maybe misuderstanding intent) that you should drop “,param-name” from the last line and drop “,start” from function “,func-name”.
Hm. “,end” never changes, so it would probably be simpler to declare it outside “,func-name” rather than pass it around. Same for “,step”. And maybe “,k”, but I’m not clear why “,k” is needed as well as “,param-name” and “start”.
Also you need to change + to either + or - depending on “(< step1 0)”.
You can bind a variable outside the function and still refer to it inside the function. Here is an example that does so with “,end”: