Suzanne Soy <racket@suzanne.soy>
This package is experimental. Later versions may break backward-compatibility.
syntax
( chain-module-begin lang. body)
As an example here is the definition for a no-op language, which simply takes a (possibly improper) list of languages to chain, and calls the next one:
syntax/parse))(syntax-parsestx`(,#'chain₊)'())). ,(transform-body#'body)));identity transformation:body))
This language could then be used as follows:
Given two other meta-language built in the same way and provided by meta-two and meta-three, it would be possible to chain the three languages as follows:
The chain-module-begin macro produces the following syntax:
(continue. internal-args))
where (continue. internal-args) fully expands (#%module-begin . body), where #%module-begin is the one provided by lang, and produces the following syntax:
(begin . expanded-body)
An extra scope is added to the whole (begin . expanded-body) form, so that a #%require form within the expanded-body may shadow bindings provided by lang, just as require forms normally have the possibility to shadow bindings provided by the #lang language.