[MLton] Re: Type of _address?

Matthew Fluet fluet@cs.cornell.edu
Sat, 23 Jul 2005 10:19:23 -0400 (EDT)


> > +        | ADDRESS string COLON ty COMMA ty SEMICOLON
> > +          (Exp.Prim {kind = PrimKind.Address {name = string},
> > +                     ty = Type.makeRegion' (
> > +                             Type.tuple (Vector.new2 (ty1, ty2)),
> > +                             ty1left, ty2right)})
> ...
> > +        | SYMBOL ASTERISK symattributes COLON ty COMMA ty SEMICOLON
> > +          (Exp.Prim {kind = PrimKind.ISymbol {attributes = symattributes},
> > +                     ty = Type.makeRegion' (
> > +                             Type.tuple (Vector.new2 (ty1, ty2)),
> > +                             ty1left, ty2right)})
> 
> Rather than encode the pair of types as a tuple, I think it would be
> clearer to keep the two types separate.  I realize this is a slightly
> bigger change.  But it doesn't seem too hard to fold the type (or
> types) into the kind, and drop the {kind, ty} record, making Exp.Prim
> be Exp.Prim of PrimKind.t.

I also made this change in the FFI overhaul.