From: Stephen W. <sw...@in...> - 2001-10-11 15:39:36
|
Inspired by Andreas' tests, I was trying to understand type inference with flexible records. I created a few more flexrecord examples (below), and tried them out on the SML compilers that I have around. The results are in the table below. I would be interested to hear if and an explanation of why the Definition requires any of these examples to succeed. SML/NJ MosML MLton MLKit Poly/ML MLWorks Alice 110.0.7 2.00 011006 4.0.0 4.1.1 2.0 Oper2 flexrecord + + + + + - + flexrecord2 - + - + - flexrecord3 - + - + - flexrecord4 - - - - - (* flexrecord2 *) val _ = let val g = #foo val _ = g {foo = 13} val _ = g {foo = "yes"} in () end (* flexrecord2 *) (* flexrecord3 *) val _ = let val g = #foo val _ = g {foo = 13, goo = 1.0} val _ = g {foo = "yes", goo = 1.0} in () end (* flexrecord3 *) (* flexrecord4 *) val _ = let val g = #foo val _ = g {foo = 13, goo = 1.0} val _ = g {foo = "yes", goo = false} in () end (* flexrecord4 *) |