The ML standard is not specific about what the "program context" should
be when disambiguating flexible records and overloading. Poly/ML uses
as wide a context as possible but that can mean that a program that
compiles with Poly/ML won't necessarily compile with other
implementations. I've added a switch
PolyML.Compiler.narrowOverloadFlexRecord that defaults to false. If set
to true the compiler uses a much narrower context; essentially the val
binding.
I've looked at a few other implementations to see what they do. The
most restrictive is Hamlet which corresponds to what Poly/ML now does
with narrowOverloadFlexRecord set to true. It rejects
let fun f x y = x + y in f 1.0 end;
which SML/NJ (110.74) accepts. Neither accept
let fun f {x, ...} = x in f {x=1} end;
Mlton seems to use the whole program context as Poly/ML does.
David
_______________________________________________
polyml mailing list
[email protected]
http://lists.inf.ed.ac.uk/mailman/listinfo/polyml