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

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



On Tue, Jan 28, 2014 at 11:42 PM, Marc Nieper-Wißkirchen <marc.nieper@x> wrote:
[...]
In this example, `keyword' is bound in `macro-library', so can be exported by `macro-library'. So, in this case, is it true that this program is not portable because the binding of `keyword` in the top-level program may be different than the binding of `keyword' in `wrapper-library' in case `macro-library' is loaded twice?

The report doesn't say much about this, so if you took a liberal
interpretation you might be able to conclude this wasn't portable.
Realistically one would assume that libraries are internally consistent,
and that instantiations of the same library during the same phase
and same compilation would in fact be the same.

Again, we fall into the "difficult to talk about without specifying fully"
territory.  You should definitely read what R6RS has to say about
how hygiene works:

  http://www.r6rs.org/final/html/r6rs-lib/r6rs-lib-Z-H-13.html#node_sec_12.1

This is not the only hygiene algorithm in use, and the alternatives
may behave differently in corner cases.  R7RS will specify explicit
renaming macros as a lowest common denominator low-level macro
library, which hides much of the details and may allow a simple and/or
more flexible specification of hygiene.  Syntactic-closures are another
alternative which work differently from the R6RS system, and Andre
van Tonder more recently put a lot of work into another hygiene
algorithm in SRFI 72:

  http://srfi.schemers.org/srfi-72/

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

-- 
Alex

_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports