(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))
  (begin
    ; 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))
  (begin
    (define-syntax wrapper
      (syntax-rules ()
        ((_ k) (macro k))))))


(import (scheme base) (scheme write)
  (macro-library)
  (wrapper-library))
(display (wrapper keyword))
(newline)

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`.

Marc


>
> --
> Alex
>
>
_______________________________________________
Scheme-reports mailing list
[email protected]
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports

Reply via email to