Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Macro (computer science)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Hygienic macros === {{Main article|Hygienic macro}} In the mid-eighties, a number of papers<ref>{{cite conference |last1=Kohlbecker |first1=Eugene |last2=Friedman |first2=Daniel |last3=Felleisen |first3=Matthias |last4=Duba |first4=Bruce |book-title=LFP '86: Proceedings of the 1986 ACM conference on LISP and functional programming |title=Hygienic Macro Expansion |year=1986 |pages=151β161 |doi=10.1145/319838.319859 |isbn=0897912004}}</ref><ref>[http://portal.acm.org/citation.cfm?id=99583.99607] Clinger, Rees. "Macros that Work"</ref> introduced the notion of [[hygienic macro]] expansion (<CODE>syntax-rules</CODE>), a pattern-based system where the syntactic environments of the macro definition and the macro use are distinct, allowing macro definers and users not to worry about inadvertent variable capture (cf. [[referential transparency]]). Hygienic macros have been standardized for Scheme in the [[R5RS]], [[R6RS]], and [[R7RS]] standards. A number of competing implementations of hygienic macros exist such as <code>syntax-rules</code>, <code>syntax-case</code>, explicit renaming, and syntactic closures. Both <code>syntax-rules</code> and <code>syntax-case</code> have been standardized in the Scheme standards. Recently, [[Racket (programming language)|Racket]] has combined the notions of hygienic macros with a "[[tower of evaluators]]", so that the syntactic expansion time of one macro system is the ordinary runtime of another block of code,<ref>{{cite news | last1 = Flatt | first1 = Matthew | title = Composable and compilable macros: you want it when? |url=http://www.cs.utah.edu/plt/publications/macromod.pdf}}</ref> and showed how to apply interleaved expansion and parsing in a non-parenthesized language.<ref>{{cite news | last1 = Rafkind | first1 = Jon | last2 = Flatt | first2 = Matthew | title = Honu: Syntactic Extension for Algebraic Notation through Enforestation |url=http://www.cs.utah.edu/plt/publications/gpce12-rf.pdf}}</ref> A number of languages other than Scheme either implement hygienic macros or implement partially hygienic systems. Examples include [[Scala (programming language)|Scala]], [[Rust (programming language)|Rust]], [[Elixir (programming language)|Elixir]], [[Julia (programming language)|Julia]], [[Dylan (programming language)|Dylan]], [[Nim (programming language)|Nim]], and [[Nemerle]].
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)