On Sun, Jan 26, 2014 at 6:58 PM, Marc Nieper-Wißkirchen < [email protected]> wrote:
> As Michael had brought up, even if you do this you need >> to make things "work" for parameters, and I'd say also for >> record types, though this doesn't necessarily imply the >> values are eq? (much less the bindings being the same). >> > > What do you mean by one *has* to make things work for parameters? If a > library exporting a parameter is referenced twice and the standard allows > the library to be loaded twice in this case, we may end up with two unequal > parameter objects and the standard does not seem to forbid this, does it? > So, in such an implementation things will simply not work for parameters, > while such an implementation would be conforming to the standard. > If parameterize didn't work across library boundaries, it would make parameters _much_ less useful. They are in fact mostly used for this purpose. On the other hand, just because they were not eqv? would not prevent and implementation from making the same parameter from different library instantiations return and shadow the same values. Likewise, I think it would simply be broken for define-record-type to create incompatible types, even if the rtd were different. This is easier for the compiler to work around since the rtd may be syntax and thus not comparable wiht eqv? anyway. I have come up with another thing that looks like an edge case to me. What > about the following? > > (define-library (macro-library) > (export macro keyword) > (import (scheme base)) > (begin > (define-syntax macro > (syntax-rules (keyword) > ((_ keyword) 42))))) > [I'm assuming you meant to define `keyword' in this library.] (define-library (wrapper-library) > (export wrapper) > (import (scheme base) (macro-library)) > (begin > (define-syntax wrapper > (syntax-rules () > ((_) macro))))) > > (import (scheme base) (scheme write) (macro-library) (wrapper-library)) > (display ((wrapper) keyword)) > (newline) > > If I am not mistaken, this program won't portably display 42, will it? The > identifier `keyword' in the main program is bound to a syntactic keyword > coming from the loading of `macro-library' due to it being referenced by > the main program, while the macro resulting from `(wrapper)' does expect a > syntactic keyword coming from the loading of `macro-library' from > `wrapper-library'. > Perhaps I'm missing something, but it looks like this should portably display 42. macro-library was imported by the main program, so `keyword' refers to that binding. This is passed through the wrapper to `macro', which sees the `keyword' binding it expects. -- Alex
_______________________________________________ Scheme-reports mailing list [email protected] http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports
