I found a solution to my problem. I realised that it was better to use a function instead of a macro to generate the code. I created a list and appended the different parts of the code I wanted to generate in bottom up manner. eval-ing the list can run the code.

If that works for you, good. But you might later find that there are better ways to do what you want (the *what* is still unclear to me).

Here is the `eval` FAQ, from "http://lists.racket-lang.org/users/archive/2014-July/063597.html":

Q: How do I use eval?
A: Don't use eval.

Q: But don't so many academic books feature eval prominently, so doesn't
that mean I should use try to eval?
A: Those books use eval for pedagogic reasons, or because the author is
enamored of some theoretical appeal of eval, or because the author wants
to watch the world burn.  Don't use eval.

Q: But, but, but, I am just starting to learn, and eval seems to do what
I need.
A: Eval is almost certainly not what you want.  Learn how to use the
other basics effectively.  Don't use eval.

Q: I now am very comfortable with the language, I am aware that I should
avoid eval in almost all cases, and I can tell you why eval is actually
the right thing in this highly unusual case.
A: Cool, that's why eval is there.

See also "http://lists.racket-lang.org/users/archive/2014-July/063612.html";.

Neil V.

--
You received this message because you are subscribed to the Google Groups "Racket 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to