I have some s-expression (let ((whatever (foo (bar 4) (bar 5)))) ...) (as a result of (read "(whatever (foo (bar 4) (bar 5)))"). Now I would like to transform it with a custom macro that expands for example foo into the macro expression.
What is the mechanism to apply macros to given S-Expressions? Note that I do not want this substitution to happen at compiletime of the .scm file but but after reading in the s expression.
Furthermore, I don't want to use eval, since these S-Expressions are not Scheme code.
I would not want to expand a let statement in that given s-expression, only foo.
Basically I thought that Scheme would contain a sufficiently flexible Tree-Transformation Framework that would enable me to use specific macros for manipulating any kind of S-expressions at any time. In the meantime however, I learned that Scheme's macros are not first class objects and cannot be used this way, as also implied by Sylwester.