Rob,
On Tuesday 13 May 2008 13:45, Tjark Weber wrote:
On Saturday 10 May 2008 15:04, Rob Arthan wrote:
val (op ::) (h, t) = [1, 2, 3, 4];
My reading of the syntax in the definition of Standard ML is that the latter form should not be allowed. Am I right?
I don't have a copy of the language definition on my desk (how about making that available on the Internet, by the way?), but the syntax charts in Paulson's "ML for the Working Programmer" (on page 417f.) allow the derivation
Pattern -> Atomic Pattern -> ( Pattern )
to prevent misunderstandings, I should add that this is of course not sufficient to derive "(op ::)" in the above context. So, according to a literal reading of those syntax charts, you're right.
But then again, these charts might just not be very precise about optional parentheses.
Tjark