[MLton] Callback to function pointer?

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

> > "&" would probably be better, but I chose "#" because it was already known 
> > by the lexer.  Since "&" is a valid SML identifier (and "#" is not), it 
> > complicates the lexer/parser (admittedly, not by that much).
> > 
> > Another alternative is a different keyword:
> > 
> >   _address "name": MLton.Pointer.t;
> How about this, and dropping the ": MLton.Pointer.t;", since that's
> the only reasonable type for an address?
>    _address "name"

MLton.Pointer.t is the only reasonable "expandOpaque" primitive type, but
it can still be useful to import an address at an opaque SML type.  For
example, doc/examples/ffi/iimport.sml defines the DynLink structure with
an opaque signature match so that DynLink.fptr is abstract (but is
necessarily equal to MLton.Pointer.t).