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

Re: [Scheme-reports] "module" vs. "library"

Andre van Tonder scripsit:

> Why is INCLUDE conflated with the module language?  It is really an
> orthogonal concept.  INCLUDE as defined in Chez (e.g.) is just a
> form (definable as a procedural macro) that can be used in any code,
> including R6RS libraries.

For one thing, the WG1 language does not have procedural macros, so you
can't write your own version of `include`.

Alex has some pretty good arguments (which unfortunately he didn't
include in his response) that generalized `include` is not all that
useful.  At the REPL, it is equivalent to `load`.  In scripts, it leaves
the question of what directory the included file is to come from open,
making such scripts not very portable.  In arbitrary lexical contexts,
it would require the file to contain a single Scheme expression only.

In the module language, however, providing `include` allows (without
requiring) a separation of concerns, such that Scheme code files need
contain no module cruft, and module files need contain no Scheme code.
This seems to me extremely convenient as well as desirable.  Indeed, we
have provided `include-ci`, which permits the including of R5RS Scheme
code that is case-insensitive into case sensitive R7RS systems, without
in any way changing the code itself.

John Cowan                                <cowan@x>
Yakka foob mog.  Grug pubbawup zink wattoom gazork.  Chumble spuzz.
    --Calvin, giving Newton's First Law "in his own words"

Scheme-reports mailing list