[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Scheme-reports] Libraries that are referenced more than once

(In chibi-scheme, the binding apparently is the same because I get the answer 42.

Sure, we are a priori talking about changing the specification to be
more clear on a hypothetical case that no one ever has nor likely
ever would implement.

Chibi specifically fits into the common pattern that no library is ever
loaded more than once.

That I had already understand. What confused and is confusing me was what happens when I change my example into:

(define-library (macro-library)
  (export macro)
  (import (scheme base))
    ; Bind `keyword'
    (define-syntax keyword
      (syntax-rules ()))

    (define-syntax macro

      (syntax-rules (keyword)
        ((_ keyword) 42)))))

(define-library (wrapper-library)
  (export wrapper)
  (import (scheme base) (macro-library))
    (define-syntax wrapper
      (syntax-rules ()
        ((_ k) (macro k))))))

(import (scheme base) (scheme write)
(display (wrapper keyword))

Here, I do not export `keyword` in `macro-library`. I would have thought that in this case outside of `macro-library', the macro cannot be used without errors because the argument to `macro` can never have the same binding as `keyword` in `macro-library`. Nevertheless, the example still prints 42 in chibi-schemen even when compiled with `SEXP_USE_STRICT_TOPLEVEL_BINDINGS=1`.



Scheme-reports mailing list