Languages Features Calendar CSV Lists Blog About Sponsor Add Language
GitHub icon



Macros are a feature.

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.

Languages without Macros include Java, JavaScript, Kotlin

Languages with Macros include C, C++, Rust, Clojure, Elixir, Erlang, Scheme, Racket, Nim, Factor, Slope, Gerbil Scheme, honu

Example from C:
Example from C++:
Example from Rust:
Example from Clojure:
Example from Elixir:
Example from Erlang:
-define(Const, Replacement). -define(Func(Var1,...,VarN), Replacement).
Example from Scheme:
Example from Racket:
Example from Nim:
lazy-evaluation-feature.html 路 macros-feature.html 路 manual-memory-management-feature.html

View source

PLDB - Build the next great programming language 路 v2022 Day 33 Docs Build Acknowledgements Traffic Today Traffic Trends Mirrors GitHub