[MLton] Re: Type of _address?
Matthew Fluet
fluet@cs.cornell.edu
Thu, 21 Jul 2005 07:53:27 -0400 (EDT)
> I am considering changing the _address syntax from:
> _address "x": MLton.Pointer.t;
> to: _address "x": MLton.Pointer.t, int;
>
> My reason for this is that I recall doing an 'extern foo;' caused trouble on
> hppa for profiling. I wonder if it will cause trouble in this case too...
> (ie: a char* pointer differs from an int* pointer)
That seems to make sense. OTOH, the point of importing an address without
the pointed-to type information is that one could then use arbitrary
MLton.Pointer.{get,set}* functions on it. The disconcerting bit is that
the pointed-to type will now have absolutely no influence on the
elaborated type.
> > However, it means I would have to completely break _import #, not just issue
> > a deprecated warning if I require that extern x; always have a type.
>
> Err - rather, I just made _import # use CType.Pointer.
I think that is fine. In fact, since _import # has never been a
documented feature, then I think we could safely just drop it without
going through deprecation.