Abstract
For several decades, Lisp macros have been the state of the art in metaprogramming. Macros are expanded at the time when a program is read, and thus provide a mechanism for defining new language constructs by rewriting expressions at read time and before compile and evaluation time. In this chapter, the concept of macros is explained via the example of macros in Common Lisp, which is conducive for this purpose due to its uniform syntax. Then Julia macros and their building blocks are presented in detail. Finally, useful built-in Julia macros are discussed.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
American National Standards Institute (ANSI),Washington, DC, USA: Programming Language Common Lisp, ANSI INCITS 226-1994 (R2004) (1994)
Graham, P.: On Lisp. Prentice Hall (1993)
McCarthy, J.: LISP 1.5 Programmer’s Manual. The MIT Press (1962)
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
Copyright information
© 2022 Springer Nature Switzerland AG
About this chapter
Cite this chapter
Heitzinger, C. (2022). Macros. In: Algorithms with JULIA. Springer, Cham. https://doi.org/10.1007/978-3-031-16560-3_7
Download citation
DOI: https://doi.org/10.1007/978-3-031-16560-3_7
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-16559-7
Online ISBN: 978-3-031-16560-3
eBook Packages: Mathematics and StatisticsMathematics and Statistics (R0)