[MLton] Re: Type of _address?

Matthew Fluet fluet@cs.cornell.edu
Thu, 21 Jul 2005 20:51:05 -0400 (EDT)


On Thu, 21 Jul 2005, Wesley W. Terpstra wrote:
> 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?

No, there isn't anything between the parser and elaborator.  The changes 
should be localized to the files that you've already touched: 
ast-core.{sig,fun}, elaborate-core.fun, and ml.grm.