[gambit-list] syntax-case and procedures with keyword parameters
Álvaro Castro-Castilla
alvaro.castro.castilla at gmail.com
Sun Mar 4 11:22:18 EST 2012
Marc,
I see.
The only reason I miss syntax-rules is for some SRFIs and libs like
Kanren, completely implemented as syntax-rules. Otherwise I'm happier
with define-macro :)
Thanks for your reply
2012/3/4 Marc Feeley <feeley at iro.umontreal.ca>:
>
> On 2012-03-03, at 1:49 PM, Álvaro Castro-Castilla wrote:
>
>> I wonder why Gambit doesn't include a syntax-rules implementation that
>> is compatible with DSSSL and cond-expand, it belongs to R5RS.
>
> Gambit uses the psyntax macro expander extracted from Chez Scheme Version 7.3 . Using psyntax has the advantage that it not only provides syntax-rules, but also syntax-case which is more powerful (allows breaking hygiene).
>
> Unfortunately, psyntax is a large complex piece of software. When it is compiled, it takes almost as much space as the whole interpreter (including runtime and primitive procedures). Psyntax basically implements a specific Scheme dialect on top of Gambit. The Gambit syntactic extensions to Scheme, such as DSSSL optional and named parameters, declarations, low-level macros, keyword objects, etc would have to be *reimplemented* in psyntax, which is quite an undertaking. The psyntax code is much too hairy for me to understand how the extensions would fit in properly. Moreover, I am not willing to put time into this, knowing that using the psyntax system permanently in Gambit will bloat the system unreasonably (doubling the size of the interpreter).
>
> By the way, that's why syntax-rules and syntax-case are not available by default in Gambit. You must use the -:s runtime option for Gambit to conform to R5RS (or load ~~lib/syntax-case.scm explicitly at the REPL).
>
> Marc
>
More information about the Gambit-list
mailing list