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

Re: modules & extensions

At Mon, 1 Apr 2002 08:07:48 -0500, Brian Gregor wrote:
> Using the bitmatrix.c example with 200alpha15, I tried the following:
>    compiled the extension (on Windows 2k) with mzc
>    wrote a little module:
> (module bitmatrix
>         mzscheme
> (load-extension "bitmatrix.dll")
> (provide make-bit-matrix))

`load' and `load-extension' do nothing until run time.

The only way to import bindings into a module is with `require', and in
this case, the "bitmatrix.c" example doesn't put its definitions into a
module that can be required.

> Do I define a module in the C code and then require it
> in the Scheme module?

Yes. "idmodule.c" shows an example. Converting "bitmatrix.c" requires
only a few lines of code.

> For the record, the bitmatrix.c example also causes an
> application error when loaded.  Did something change in the
> interface?

No, it seems to work for me. Can you tell me more about the error?