[R6RS] libraries

Manuel Serrano Manuel.Serrano
Tue Dec 13 09:51:22 EST 2005

Kent writes,
> Good point---I think I understand your criteria.  Would this be okay,
> then?
>   (library S "scheme://r6rs"
>     (export A P! s)
>     (define s '())
>     (define-syntax A
>       (syntax-rules ()
>         [(_ p x) (p s x)]))
>     (define-syntax P!
>       (syntax-rules ()
>         [(_ x y) (set! x (cons y s))])))
>   (library T "scheme://r6rs"
>     (import S)
>     (export P0!)
>     (define (P0!) (A P! 0)))
> I assume so, since both the set! and reference to 's' are within S.
I think that I don't understand what the meaning of "a reference to a variable
is within a library" is.

To me, what is inacceptable is that the result of the syntax expansion
of a library L contains an expression such as (SET! VAR VAL) if VAR
is not declared in L (i.e., L contains a declaration such as (DEFINE VAR ...)).


More information about the R6RS mailing list