[plt-scheme] questions about require and complie

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Tue Jun 29 00:25:55 EDT 2004

At Mon, 28 Jun 2004 19:57:45 -0400, "Psy-Kosh" wrote:
> first, is there any way to force require to import a dll version when
> it otherwise would go for the .scm or such? (ie, what if the dll
> version of something isn't in, say, .\i386\win or whatever?)

Can you move the DLL to "compiled/native/i386/win32"? Then, when you
try to require "hello.scm", "hello.dll" will be loaded instead (much
like "hello.zo" is loaded from "compiled" when present).

> this is in hello.scm, and has also been compiled by mzc (and MSVC)
> into hello.dll

FWIW, if you use the --auto-dir flag to mzc, it should place the DLL
into an appropriate subdirectory.

> also, question about strange compile behavior. as I understand it,
> compile is meant to be used just on sexps, right? seems to also work
> on procedures... sort of. 

The `compile' procedure works on arbitrary values. When it encounters
something that isn't a pair, symbols, etc., the compiler implicitly
quotes the value --- even if it's something like a procedure.


> > (define y (compile ziggy))
> > y
> write: cannot marshal constant that is embedded in compiled code:

if a value has no printed form, it can't exist in compiled code that is
written to a file (or stdout).


Posted on the users mailing list.