Close but no cigar. Using a function works fine, but then it happens after expansion and thus runtime.The whole point of the macro is to only do it once (compilation time) and only with static data presented in the macro.

In Common Lisp I would have done this (using your function for kicks):

Now, this was easy because you have CL powered macro, but I'm trying do the same with the not so easy syntax-rules and R5RS to be able to reproduce it in both gambit and chicken.. I'm actually doing the development in Racked because of the very good (but sometimes buggy) macro-stepper.

This example is actually a bare minimum problem to a more complex project I'm doing to be more familiar with syntax-rules.