[MLton] Re: Type of _address?

Matthew Fluet fluet@cs.cornell.edu
Thu, 21 Jul 2005 07:56:34 -0400 (EDT)


On Thu, 21 Jul 2005, Wesley W. Terpstra wrote:
> On Thu, Jul 21, 2005 at 01:20:15PM +0200, Wesley W. Terpstra wrote:
> > On Thu, Jul 21, 2005 at 12:29:05PM +0200, Wesley W. Terpstra wrote:
> > > 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've made the change. AFAICS, it's strictly better.
> 
> Damn it.
> 
> I forgot that _address is also used with _import *.
> How the hell should this work?

Is there really a problem with just having
  extern symbol;
if the address-of operation is always cast?

For example, the C-codegen for  _import *  inserts a cast to a function 
pointer type.

> Any arrow-type in _address yields: extern void foo(void);
> Or what? Yuck.

Yeah, that seems unpleasant.