Dynamic library issues...
Anoq of the Sun
anoq@HardcoreProcessing.com
Wed, 24 Jan 2001 15:42:30 +0100
This is a multi-part message in MIME format.
--------------2B8EF7E73ACA9F8D30269B4A
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hello again!
Just come to think of it - there are 2
more potential problem in creating dynamic
libraries:
1) Linking the implementation of a
function with a known signature to
an ML function at runtime.
2) Passing arbitrary data-structures as
function arguments.
MoscowML just allows to call functions
with 1, 2, 3, 4, or 5 arguments, but
it seems to allow any kind of data -
but I'm not sure if there are any limits
to what it can really handle.
I have attached the Dynlib.sig from
MoscowML - so that you don't have to
search for it if you want to see it :)
Cheers
--
http://www.HardcoreProcessing.com
--------------2B8EF7E73ACA9F8D30269B4A
Content-Type: application/x-unknown-content-type-sig_auto_file;
name="Dynlib.sig"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="Dynlib.sig"
c2lnbmF0dXJlIER5bmxpYiA9CnNpZwogICAgdHlwZSBkbEhhbmRsZQogICAgdHlwZSBzeW1IYW5k
bGUKICAgICAgICAKICAgIGV4Y2VwdGlvbiBDbG9zZWQKICAgIAogICAgZGF0YXR5cGUgZmxhZyA9
IFJUTERfTEFaWSB8IFJUTERfTk9XCiAgICB2YWwgZGxvcGVuICA6IHsgbGliIDogc3RyaW5nLCBm
bGFnIDogZmxhZywgZ2xvYmFsIDogYm9vbCB9IC0+IGRsSGFuZGxlCiAgICB2YWwgZGxzeW0gICA6
IGRsSGFuZGxlIC0+IHN0cmluZyAtPiBzeW1IYW5kbGUKICAgIHZhbCBkbGNsb3NlIDogZGxIYW5k
bGUgLT4gdW5pdAoKICAgIHZhbCB2YXIgIDogc3ltSGFuZGxlIC0+ICdiICAgICAgICAgICAgICAg
ICAgICAgICAgICAgIAogICAgdmFsIGFwcDEgOiBzeW1IYW5kbGUgLT4gJ2ExIC0+ICdiICAgICAg
ICAgICAgICAgICAgICAgCiAgICB2YWwgYXBwMiA6IHN5bUhhbmRsZSAtPiAnY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