From Newsgroup: comp.lang.lisp
On 2026-06-12, Mario Rosell <
mario@mariorosell.es> wrote:
[ Repost from Reddit. r/lisp: https://t.ly/Fldzk ]
Hello everyone.
I am making a Scheme R5RS implementation and it is going pretty well.
I am trying implement macros, and don't really know how to implement them. Scheme has a pretty complex macro system, so for now I am trying to
implement defmacro and then implement define-syntax, syntax-case, etc.
Any tips?
There exists more than one algorithm for hygienic macros.
The "grand daddy" is Kohlbecker's algorithm (1986)
The offshoots:
- Syntactic closures (1988)
- Alan Bawden paper from the proceedings of the 1988 ACM conference on Lisp
and functional programming.
- Chris Hanson 1991 paper, "A Syntactic Closure Macro Facility".
- Modified Kohlbecker's algorithm:
- William Clinger's 1990 paper, "Macros That Work"
- claims to address issues with syntactic closures
- reduces Kohlbecker from quadratic to linear time
--
TXR Programming Language:
http://nongnu.org/txr
Cygnal: Cygwin Native Application Library:
http://kylheku.com/cygnal
Mastodon: @
Kazinator@mstdn.ca
--- Synchronet 3.22a-Linux NewsLink 1.2