On Tue, 2009-10-13 at 12:22 -0400, John Cowan wrote:
> Alaric Snell-Pym scripsit:
>
> > <unattributed> wrote:
> > >(module open-gl
> > > (export ...)
> > > (cond-expand
> > > (has-open-gl (include "open-gl-glue.scm"))
> > > (else (include "open-gl-emulator.scm"))))
> >
> > Ah, but where in this appears your import of the OpenGL library, if
> > it's available? :-)
>
> The actual library is written in C, and I assume we don't import C
> source into Scheme. The "open-gl-glue.scm" would be Scheme code
> that uses the FFI to talk to OpenGL itself.
I think that you are talking past each other because you are imagining
that "include"ing something is the same as "import"ing it.
This is not the case.
The usual semantics of "include" are to treat the text of another file
as though it appeared in the place of the include statement. The
specified semantics of "import" are to make available the set of
bindings exported from another module. "import" seems closer in
intent to linking separately compiled modules, whereas "include"
seems closer in intent to code transformation prior to compilation.
Depending on your implementation, a module to be "import"ed may just be
a binary image or an ELF file, not necessarily even created from scheme
sources. A file to be "include"ed though, at least for all the
"include" functionality I know about, had darn well better be
scheme source, understandable to the parser and compiler.
Bear
_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss