[MLton-devel] RE: release of MLton with _export
Stephen Weeks
MLton@mlton.org
Thu, 26 Jun 2003 20:47:53 -0700
> I deleted the stuff to do with f3 (which is missing in export.sml) and the
> program runs fine:
Yeah, there was a line missing. Here is the correct file.
--------------------------------------------------------------------------------
val e = _export "f": int * real -> char;
val _ = e (fn (i, r) =>
(print (concat ["i = ", Int.toString i,
" r = ", Real.toString r, "\n"])
; #"g"))
val g = _ffi "g": unit -> unit;
val _ = g ()
val _ = g ()
val e = _export "f2": Word8.word -> word array;
val _ = e (fn w => Array.tabulate (10, fn _ => Word8.toLargeWord w))
val g2 = _ffi "g2": unit -> word array;
val a = g2 ()
val _ = print (concat ["0wx", Word.toString (Array.sub (a, 0)), "\n"])
val e = _export "f3": unit -> unit;
val _ = e (fn () => print "hello\n");
val g3 = _ffi "g3": unit -> unit;
val _ = g3 ()
val _ = print "success\n"
-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel