syntax-expand
(syntax-expand syntax-tree)
where syntax-tree
is a parsed expression for the following
BNF:
<exp> ::= <varref> varref (var)
| <number> lit (datum)
| (if <exp> <exp> <exp>) if (test-exp then-exp else-exp)
| (proc ({<var>}*) <exp>) proc (formals body)
| (<exp> {<exp>}*) app (rator rands)
| (:= <var> <exp>) varassign (var exp)
| (begin {<exp>}+) begin (exps)
| (let <decls> <exp>) let (decls body)
| (letrec <decls> <exp>) letrec (decls body)
<decls> ::= ({<decl>}*)
<decl> ::= (<var> <exp>) decl (var exp)
This is a Lisp form of the syntax of the language studied in the text book.
syntax-expand
must return a new syntax tree, with every
let
and letrec
records replaced by a semantically
equivalent app
record.
Last modified Dec 27th, 1998
Michael Elhadad