[plt-scheme] questions about require and complie
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
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?)
here's simple test code:
(module hello
mzscheme
(define (blah)
(display "Hi from Hello!\nBye from Hello!\n"))
(provide blah))
this is in hello.scm, and has also been compiled by mzc (and MSVC)
into hello.dll
test with the source file:
Welcome to DrScheme, version 207.
Language: Textual (MzScheme, includes R5RS).
> (require "mystuff/hello.scm")
> (blah)
Hi from Hello!
Bye from Hello!
>
test with the native code file:
Welcome to DrScheme, version 207.
Language: Textual (MzScheme, includes R5RS).
> (require "mystuff/hello.dll")
load-handler: expected a `module' declaration for `hello' in
"C:\\Program Files\\PLT\\mystuff\\hello.dll", but found something
else
>
Um... now what? any way to use "require" to force a .dll to load?
(instead of having to use load-extension? + require <module name>?)
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. I'm not sure what the expected behavior is
here, so...
Welcome to DrScheme, version 207.
Language: Textual (MzScheme, includes R5RS).
> (define x (compile +))
> x
#~207
> ((eval x) 3 5)
8
> (define ziggy (lambda args (apply + args)))
> ziggy
#<procedure:ziggy>
> (define y (compile ziggy))
> y
write: cannot marshal constant that is embedded in compiled code:
#<procedure:ziggy>
> ;za ?!
> (eval y)
#<procedure:ziggy>
> ((eval y) 3 5)
8
>
I'm confoooooozed.
Oh, also, I don't think I did last time, so thanks to those that
answered my questions. (and to those that this applies to: thanks for
making plt scheme. tis be very nifty. :)
Joey Katz
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2-nr2 (Windows XP) - GPGOE 0.4.1
iQCVAwUBQOCweZzw44XQRmJ0AQJEFgP/dHYMRgbNQ62V8XvCmdGTdhns1p6L50GF
OG42TTSp/az7tQiBW4oSC1wnPEU3JxQ/37cA6PDoiUYUqh9pu4ZQmyPNG6BLzXeU
9PR4ZrnhyL2Xn2JWQbuGjRZjMJ30+dEj273j4OupKF/Rrdj/jBAij3NPlqeOfOKd
n9idaRqLVpE=
=PeRd
-----END PGP SIGNATURE-----