[MLton] Re: Type of _address?

Wesley W. Terpstra wesley@terpstra.ca
Thu, 21 Jul 2005 20:59:40 +0200


On Thu, Jul 21, 2005 at 08:38:25AM -0700, Stephen Weeks wrote:
> 
> > +        | 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 am not really comfortable making such a change.
That will touch a lot of code, won't it?

Isn't there stuff between the parser and elaborator which uses it?

-- 
Wesley W. Terpstra <wesley@terpstra.ca>