This site is a static rendering of the Trac instance that was used by R7RS-WG1 for its work on R7RS-small (PDF), which was ratified in 2013. For more information, see Home. For a version of this page that may be more recent, see SyntaxDefinitions in WG2's repo for R7RS-large.

Syntax­Definitions

cowan
2015-05-31 05:36:40
1history
source

These tests show the type of syntax definitions the Schemes in the suite understand.

Define-macro

define-macro is a low-level bare macro definition, analogous to Common Lisp defmacro. I tested (define-macro x (lambda (y) y)) followed by (x (+ 3 4)), expecting it to return 7 on Schemes that support define-macro and an error otherwise. define-macro is not part of any Scheme standard.

Supported: Gambit, Bigloo, Guile, Kawa, SISC, Ypsilon, NexJ, JScheme, SigScheme, Scheme 9, STklos, RScheme, Rep, Elk, Picrin

Not supported: Racket, Gauche, MIT, Chicken, Scheme48/scsh, SCM, Chez, Vicare, Larceny, Mosh, IronScheme, KSi, Shoe, TinyScheme, BDC, XLisp, Schemik, UMB, Llava, SXM, FemtoLisp, Inlab, Oaklisp, Sagittarius, Foment, Owl Lisp, Chibi

S7 and Dfsch accept define-style syntax (define-macro (x y) y) only. The Sizzle documentation claims to do the same, but it didn't work for me.

Syntax-rules

Syntax-rules is a syntax transformer used with define-syntax and its relatives. It was described but not standardized in R4RS; with minor extensions, it is part of the R5RS, R6RS, and R7RS-small standards. I tested (define-syntax x (syntax-rules () ((x y) y))), which is essentially equivalent to the define-macro macro used above, but with hygiene.

Supported: Racket, Gauche, MIT, Gambit (with the -:s switch), Chicken, Bigloo, Scheme48/scsh, Guile, Kawa, SISC, SCM (with the -r5 -m switches), Chez, Vicare, Larceny, Ypsilon, Mosh, IronScheme, STklos, Scheme 9, SXM, Sagittarius, Foment, Picrin, Owl Lisp, Chibi

Not supported: NexJ, JScheme, KSi, SigScheme, Shoe, TinyScheme, RScheme, S7, BDC, XLisp, Rep, Schemik, UMB, Elk, Llava, Sizzle, FemtoLisp, Dfsch, Inlab, Oaklisp

Syntax-case

Syntactic closures

Explicit renaming

Implicit renaming