[MLton] filedes = int (was: Stack size?)

Matthew Fluet fluet@cs.cornell.edu
Tue, 12 Jul 2005 15:12:44 -0400 (EDT)


> Well, there I was happily poking my epoll driven code, when I noticed that
> in a couple places I do need to know that the file descriptors are integers
> before they go through the FFI.
> 
> OTOH, armed with your symbol tricks:
> 
> fun identity x = x
> val () = _export "sneaky_hack": int -> int; identity
> val coerce x = _import "sneaky_hack": Posix.IO.file_desc -> int;

Cute, although horribly inefficient.  But good enough for a proof of 
concept.