[gambit-list] Syntax-case

Christian Jaeger christian at pflanze.mine.nu
Tue Feb 12 12:43:11 EST 2008


>> .. and you have to fully qualify symbols ...
> 
> It's worse than this.  Consider the following example:
> 

Assuming this macro is part of a package utils# :

> (define-macro (do-times i-and-n . body)
>   (let ((i (car i-and-n))
>         (nn (cdr i-and-n))
>         (n (gensym)))
>     `(let ((,n ,nn))
>        (do ((,i 0 (+ ,i 1)))
>          ((= ,i ,n))

           ((utils#= ,i ,n))

>          , at body))))

> ;; This barfs, because we've *locally* bound "=" (pretend we've
> suitably defined vector=)

What I said ;).

Well ok the above assumes chjmodule semantics, e.g. if the package utils 
imports the gambit / r5rs standard identifyers, utils#= is the same as 
the standard gambit = (e.g. there's a (define utils#= (let () 
(##namespace ("")) =))) in your code at some place).

Christian.



More information about the Gambit-list mailing list