ThePiercingPrince
ThePiercingPrince

Reputation: 1921

Read macros in Scheme

In Common Lisp, there are "read macros" that can be used to parse syntax to Lisp code.

  1. Is it possible/how to implement it in pure Scheme?
  2. Which and how implementations support this?

Upvotes: 6

Views: 2540

Answers (1)

sjamaan
sjamaan

Reputation: 2292

The only semi-portable way that comes to mind is via SRFI-10's limited form of reader macros. These have to start with a sharp sign and a comma, and then a list expression which starts with a symbol which identifies the read-time constructor.

CHICKEN also provides support for using arbitrary characters as reader macro hooks.

Upvotes: 3

Related Questions