Jonas Wissting <firstname.lastname@example.org> wrote:
| email@example.com (Rob Warnock) writes:
| > Plus, every implementation of Scheme that I know of makes it almost
| > *trivial* to link in your own libraries of C code, often at runtime,
| How do I do this in mzscheme? I have browsed the manual but have not
| found anything.
Ahhh... probably the wrong manual. You won't find it in the "PLT MzScheme:
Language Reference Manual" <URL:http://www.cs.rice.edu/CS/PLT/packages/
doc/mzscheme/index.htm>, but you *will* find it right at the top of the
"Inside PLT MzScheme" manual <URL:http://www.cs.rice.edu/CS/PLT/packages/
Writing MzScheme Extensions
To write a C/C++-based extension for MzScheme, follow these steps:
There's a recipe for compiling a shared library, including required entry
points. Once you've compiled it, you can link it in to MzScheme at runtime
with (load-extension "foo.so") [or "foo.dll", I guess, on Windows].
I use MzScheme "extensions" all the time. Very handy...
p.s. You'll probably need to read at least some of the other sections,
too, in order to see how to access & create MzScheme objects, call Scheme
code from C code, etc.
Rob Warnock, 31-2-510 firstname.lastname@example.org
Network Engineering http://reality.sgi.com/rpw3/
Silicon Graphics, Inc. Phone: 650-933-1673
1600 Amphitheatre Pkwy. PP-ASEL-IA
Mountain View, CA 94043