[R6RS] libraries

Michael Sperber sperber
Sun Dec 11 03:36:49 EST 2005


dyb at cs.indiana.edu writes:

> Oops.  That's not even valid, since the parens are mismatched and it's
> missing the export for s.  What I meant was this:
>
>   (library S "scheme://r6rs"
>     (export P! s)
>     (define s '())
>     (define-syntax P!
>       (syntax-rules ()
>         [(_ y) (set! s (cons y s))])))
>   (library T "scheme://r6rs"
>     (import S)
>     (export P0!)
>     (define (P0!) (P! 0)))
>
> I'll assume that the fixed version is okay.

Yes.

> Presumably the following is okay as well, right?
>
>   (library S "scheme://r6rs"
>     (export P1! P2! s)
>     (define s '())
>     (define-syntax P1!
>       (syntax-rules ()
>         [(_ x y) (set! x (cons y x))]))
>     (define-syntax P2!
>       (syntax-rules ()
>         [(_ y) (P1! s y)])))
>   (library T "scheme://r6rs"
>     (import S)
>     (export P0!)
>     (define (P0!) (P2! 0)))

Yes.

> What about:
>
>   (library S "scheme://r6rs"
>     (export P! s)
>     (define s '())
>     (define-syntax P!
>       (syntax-rules ()
>         [(_ x y) (set! x (cons y x))])))
>   (library T "scheme://r6rs"
>     (import S)
>     (export P0!)
>     (define (P0!) (P! s 0)))
>
> Is this okay too?

I'd say no.

> The set! is contained within S.

But the reference to `s' isn't.

-- 
Cheers =8-} Mike
Friede, V?lkerverst?ndigung und ?berhaupt blabla


More information about the R6RS mailing list