[MLton-devel] FFI in user's guide

Matthew Fluet fluet@cs.cornell.edu
Mon, 19 May 2003 21:24:26 -0400 (EDT)


> > (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.)
>
> meaning  ty ::= u * ... * u -> t?

Yes.  I figured that any value we could pass to C as an argument, we could
also pass to C as a return value.  Likewise, any value C could return to
SML, C could pass to SML as an argument.

> Thinking about exporting constants, I guess we could allow that too,
>
> 	_export "x": int; 13
>
> where with this there is no need to use callFromC handler.

I disagree.  What if I have:

_export "x": int; (length (CommandLine.arguments ()))

Then you can't export a "constant" C side function/variable.  I guess you
could elaborate that to an ffi to a function that sets a C side static
variable.




-------------------------------------------------------
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