Macro of Lisp-family language is very different feature from ones of other languages, such as C preprocessor macros. It allows you to extend the original language syntax. You can use macros to change Gauche syntax so that you can run a Scheme program written to other Scheme implementations, and you can even design your own mini-language to solve your problem easily.
Gauche supports hygienic macros, which allows to write safe macros by avoiding name collisions. If you know traditional Lisp macros but new to hygienic macros, they might seem confusing at first. We have an introductory section (Why hygienic?) for those who are not familiar with hygienic macros; if you know what they are, you can skip the section.
• Why hygienic?: | ||
• Hygienic macros: | ||
• Traditional macros: | ||
• Hybrid macros: | ||
• Syntax parameters: | ||
• Identifiers: | ||
• Debugging macros: | ||
• Macro utilities: |