[MLton-devel] FFI in user's guide

Matthew Fluet fluet@cs.cornell.edu
Mon, 19 May 2003 18:09:09 -0400 (EDT)


The user's guide says that the grammar for types allowed in ffi are:

ty ::= u | t * ... * t -> u
u ::= bool | char | int | real | string | unit | word | word8
t ::= u | u array | u ref | u vector
     | CharArray.array | CharVector.vector
     | IntArray.array | IntVector.vector
     | Int32Array.array | Int32Vector.vector
     | RealArray.array | RealVector.vector
     | Real64Array.array | Real64Vector.vector
     | Word8Array.array | Word8Vector.vector
     | Word32Array.array | Word32Vector.vector

I don't think that string belongs in u.  (I was thinking that Callbacks
should support a type grammar that is the "inverse" of FFI, but was having
trouble with thinking about passing a string from C to SML.)

In the presence of Callbacks, we might want to be able to register roots
with the GC; certainly, if C calls to SML while holding onto a (t - u)
type, that pointer might well change while SML is executing.




-------------------------------------------------------
This SF.net email is sponsored by: ObjectStore.
If flattening out C++ or Java code to make your application fit in a
relational database is painful, don't do it! Check out ObjectStore.
Now part of Progress Software. http://www.objectstore.net/sourceforge
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel