I've just been updating the type checking error messages for fun
declarations and as part of the process I've been looking at the
parsing. The syntax of a fun binding is similar to a pattern in many
ways and the overlap between them is such that the easiest way to parse
them is to treat them just like patterns. The effect of this, though,
is that Poly/ML has allowed forms that are not strictly allowed by ML97.
This is mainly in the use of parentheses, accepting them in some cases
where they are not allowed and not requiring them where they should be
used, but also allowing type constraints in some places where they are
not allowed.
I've now fixed this so that these extensions are no longer allowed but
this may mean that programs that previously compiled no longer will.
Examples of incorrect syntax previously accepted are:
fun (f x) y = x+y;
infix ++;
fun SOME x ++ SOME y = x = y;
val (SOME) x = SOME 1;
I'm mentioning this because this could affect long standing code. I
found an example of the second case, where an infixed function was
applied to a construction that wasn't parenthesised, in the C-interface
code of Poly/ML.
David.
_______________________________________________
polyml mailing list
[email protected]
http://lists.inf.ed.ac.uk/mailman/listinfo/polyml