You are looking at historical revision 26526 of this page. It may differ significantly from its current revision.



Explicit renaming macros, syntactic-closures and syntax-rules.

Just use this as a drop-in replacement for syntactic-closures. If you're only using syntax-rules macros, it also works as a drop-in replacement for the syntax-case egg.

You can compile syntax eggs by supplying the -Dcompile-syntax option to csc. This will compile the extension normally, and also compile all top-level macros and arrange for them to be installed at load-time. For extensions with a lot of macros this will substantially speed up load-time. Extensions that also do a lot of CPS-style macro processing will also be noticeably faster at expanding.

Compiled syntax currently only works with riaxpander, so it's not recommended for general purpose eggs which would otherwise have their choice of which macro system to use, but it can be very useful for your private code. A combined API is planned for the future so that you'll be able to compile with riaxpander and then load with either riaxpander or the syntactic-closures egg.

Compiling Example

 $ cat swap.scm
 (define-syntax swap!
   (syntax-rules ()
     ((swap! a b) (let ((tmp a)) (set! a b) (set! b tmp)))))
 $ csc -s -O2 -R riaxpander -Dcompile-syntax swap.scm
 $ csi -R riaxpander -R swap
 ; loading /usr/local/lib/chicken/3/ ...
 ; loading ...
 ; loading riaxpander-dsssl-lambda.scm ...
 ; loading ./ ...
 #;1> (define x 1)
 #;2> (define y 2)
 #;3> (swap! x y)
 #;4> (list x y)
 (2 1)


Taylor R. Campbell

Version History

adding support for compiled syntax extensions
upstream bugfixes
adding DSSSL support
fixing vector (output) templates in syntax-rules
allow case-sensitivity, added core chicken macros and vector pattern support
initial release