Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.lisp > #61013

Re: implementing scheme - implementing macros

From Kaz Kylheku <046-301-5902@kylheku.com>
Newsgroups comp.lang.lisp
Subject Re: implementing scheme - implementing macros
Date 2026-06-23 20:59 +0000
Organization A noiseless patient Spider
Message-ID <20260623124622.64@kylheku.com> (permalink)
References <110hst1$2gjgb$1@dont-email.me>

Show all headers | View raw


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

Back to comp.lang.lisp | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

implementing scheme - implementing macros Mario Rosell <mario@mariorosell.es> - 2026-06-12 21:15 +0000
  Re: implementing scheme - implementing macros steve g <Sgonedes1977@gmail.com> - 2026-06-16 21:50 -0400
    Re: implementing scheme - implementing macros Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-06-17 03:14 +0000
    Re: implementing scheme - implementing macros Paul Rubin <no.email@nospam.invalid> - 2026-06-16 21:45 -0700
      Re: implementing scheme - implementing macros steve g <Sgonedes1977@gmail.com> - 2026-06-19 23:15 -0400
  Re: implementing scheme - implementing macros antispam@fricas.org (Waldek Hebisch) - 2026-06-17 14:26 +0000
  Re: implementing scheme - implementing macros Kaz Kylheku <046-301-5902@kylheku.com> - 2026-06-23 20:59 +0000
    Re: implementing scheme - implementing macros Stefan Monnier <monnier@iro.umontreal.ca> - 2026-06-25 10:59 -0400

csiph-web