Macros is an actively used design pattern.

?Years Old
  • Macros ranks in the top 50% of entities I track
  • the Macros wikipedia page
  • I have 21 facts about Macros. what would you like to know? email me and let me know how I can help.

Languages without Macros include java, javascript, kotlin

Languages with Macros include c, clojure, cpp, erlang, factor, honu, nim, racket, rust, scheme

Example from c:

https://gcc.gnu.org/onlinedocs/cpp/Macro-Arguments.html

Example from clojure:

https://clojure.org/reference/macros

Example from cpp:

https://msdn.microsoft.com/en-us/library/503x3e3s.aspx

Example from erlang:

-define(Const, Replacement).
-define(Func(Var1,...,VarN), Replacement).

Example from nim:

https://hookrace.net/blog/introduction-to-metaprogramming-in-nim/#macros

Example from racket:

https://docs.racket-lang.org/guide/macros.html

Example from rust:

https://doc.rust-lang.org/book/ch19-06-macros.html

Example from scheme:

https://en.wikibooks.org/wiki/Scheme_Programming/Macros

Last updated September 6th, 2019