Languages such as C and assembly language have simple macro systems, implemented as preprocessors to the compiler or assembler. C preprocessor macros work by simple textual search-and-replace. More elaborate macros are available to C programmers by using an additional text-processing language such as M4.
Lisp languages such as Common Lisp and Scheme have more elaborate macro systems. In Lisp, macros behave like functions which can transform the program text, with the full language available to express such transformations. Lisp macros are used to define new syntactic constructs.
Search Encyclopedia
|
Featured Article
|