Macros

  • Chapter
  • First Online:
Algorithms with JULIA
  • 1450 Accesses

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
EUR 32.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or Ebook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
EUR 29.95
Price includes VAT (France)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
EUR 42.79
Price includes VAT (France)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
EUR 52.74
Price includes VAT (France)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free ship** worldwide - see info
Hardcover Book
EUR 73.84
Price includes VAT (France)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free ship** worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. American National Standards Institute (ANSI),Washington, DC, USA: Programming Language Common Lisp, ANSI INCITS 226-1994 (R2004) (1994)

    Google Scholar 

  2. Graham, P.: On Lisp. Prentice Hall (1993)

    Google Scholar 

  3. McCarthy, J.: LISP 1.5 Programmer’s Manual. The MIT Press (1962)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Clemens Heitzinger .

Rights and permissions

Reprints and permissions

Copyright information

© 2022 Springer Nature Switzerland AG

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

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

Publish with us

Policies and ethics

Navigation