Hostname: page-component-8448b6f56d-gtxcr Total loading time: 0 Render date: 2024-04-17T18:36:14.966Z Has data issue: false hasContentIssue false

EDUCATIONAL PEARL: Automata via macros

Published online by Cambridge University Press:  25 October 2016

SHRIRAM KRISHNAMURTHI
Affiliation:
Brown University, Providence, RI, USA (e-mail: sk@cs.brown.edu)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

Lisp programmers have long used macros to extend their language. Indeed, their success has inspired macro notations for a variety of other languages, such as C and Java. There is, however, a paucity of effective pedagogic examples of macro use. This paper presents a short, non-trivial example that implements a construct not already found in mainstream languages. Furthermore, it motivates the need for tail-calls, as opposed to mere tail-recursion, and illustrates how support for tail-call optimization is crucial to support a natural style of macro-based language extension.

Type
Educational Pearl
Copyright
2005 Cambridge University Press
Submit a response

Discussions

No Discussions have been published for this article.