Macros is an actively used design pattern. A macro (short for "macroinstruction", from Greek μακρός 'long') in computer science is a rule or pattern that specifies how a certain input sequence (often a sequence of characters) should be mapped to a replacement output sequence (also often a sequence of characters) according to a defined procedure.

?Years Old

Languages without Macros include java, javascript, kotlin

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

Example from c:

Example from clojure:

Example from cpp:

Example from erlang:

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

Example from nim:

Example from racket:

Example from rust:

Example from scheme:

Last updated August 9th, 2020

Edit Macros on GitHub