[R6RS] libraries
dyb at cs.indiana.edu
dyb
Sun Dec 11 05:38:06 EST 2005
> > 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.
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.
Kent
More information about the R6RS
mailing list