Unfortunately there is no implementation independent way to do this since every implementations has it's own special forms. But usually the number of special forms is small wich makes it feasible to write different versions for different implementations.

Last edited by Konfusius on Sun Nov 11, 2012 1:18 pm, edited 1 time in total.

Unfortunately, the code provided by Goheeca does not work for me. I never used the macrolet operator before, maybe someone can point to a beginner friendlyintroduction to macrolet? I have used macros before, but I don't understand the macrolet sectionof the hyperspec at the moment.

Konfusius wrote:Unfortunately there is no implementation independent way to do this since every implementations has it's own special forms. But usually the number of special forms is small wich makes it feasible to write different versions for different implementations.

No. The special forms/operators are defined in the standard. Implementations are permitted to implement other macros as special operators, but must also supply macro definitions, so a code-walker doesn't have to know about them.

Thanks for the answer, Goheeca, still I fail to see how it addresses the question.macrolet does expansion then evaluation, doesn't it?I want to transform the source code without evaluating it, in order to modify programmatically source files.

Check the version with macroexpand-dammit out, but it also expands into the implementation-dependent code because of compiler macros (for example append with two args into sb-impl::append2 under SBCL). Certainly you can be inspired by the source code of macroexpand-dammit for your version without compiler-macro expanding - I won't help you with this.Moreover, I'd ask is it an ad hoc issue or you just need it?In the first case I'd still let the wrapping macrolet in a source code.