Skip to main content
    • Aa
    • Aa
  • Get access
    Check if you have access via personal or institutional login
  • Cited by 4
  • Cited by
    This article has been cited by the following publications. This list is generated based on data provided by CrossRef.

    Flatt, Matthew 2016. Binding as sets of scopes. ACM SIGPLAN Notices, Vol. 51, Issue. 1, p. 705.

    Flatt, Matthew 2016. Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages - POPL 2016. p. 705.

    Disney, Tim Faubion, Nathan Herman, David and Flanagan, Cormac 2014. Sweeten your JavaScript. ACM SIGPLAN Notices, Vol. 50, Issue. 2, p. 35.

    Strickland, T. Stephen Ren, Brianna M. and Foster, Jeffrey S. 2014. Contracts for domain-specific languages in Ruby. ACM SIGPLAN Notices, Vol. 50, Issue. 2, p. 23.


Macros that Work Together: Compile-time bindings, partial expansion, and definition contexts

  • DOI:
  • Published online: 09 May 2012

Racket is a large language that is built mostly within itself. Unlike the usual approach taken by non-Lisp languages, the self-hosting of Racket is not a matter of bootstrapping one implementation through a previous implementation, but instead a matter of building a tower of languages and libraries via macros. The upper layers of the tower include a class system, a component system, pedagogic variants of Scheme, a statically typed dialect of Scheme, and more. The demands of this language-construction effort require a macro system that is substantially more expressive than previous macro systems. In particular, while conventional Scheme macro systems handle stand-alone syntactic forms adequately, they provide weak support for macros that share information or macros that use existing syntactic forms in new contexts. This paper describes and models features of the Racket macro system, including support for general compile-time bindings, sub-form expansion and analysis, and environment management. The presentation assumes a basic familiarity with Lisp-style macros, and it takes for granted the need for macros that respect lexical scope. The model, however, strips away the pattern and template system that is normally associated with Scheme macros, isolating a core that is simpler, can support pattern and template forms themselves as macros, and generalizes naturally to Racket's other extensions.

Linked references
Hide All

This list contains references from the content that can be linked to their source. For a full set of references and notes please see the PDF or HTML where available.

William D. Clinger (1991) Hygienic macros through explicit renaming. LISP Pointers 4 (4), 2528.

R. Kent Dybvig , Daniel P. Friedman & Christopher T. Haynes (1988) Expansion-passing style: A general macro mechanism. LISP Symb. Comput. 1 (1), 5375.

R. Kent Dybvig , R. Hieb & C. Bruggeman (1993) Syntactic abstraction in Scheme. LISP Symb. Comput. 5 (4), 295326.

M. Flatt (2002) Compilable and composable macros, you want it when? In Proceedings of the Seventh ACM SIGPLAN International Conference on Functional Programming (ICFP 2002), Pittsburgh, PA, USA, October 4–6, pp. 7283.

E. Eugene Kohlbecker & M. Wand (1987) Macro-by-example: Deriving syntactic transformations from their specifications. In Proceedings of the 14th ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages, Munich, Germany, January 2123, pp. 7784.

Recommend this journal

Email your librarian or administrator to recommend adding this journal to your organisation's collection.

Journal of Functional Programming
  • ISSN:
  • EISSN:
  • URL: /core/journals/journal-of-functional-programming
Please enter your name
Please enter a valid email address
Who would you like to send this to? *