W3C home > Mailing lists > Public > public-qt-comments@w3.org > April 2004

RE: questionable syntax choices

From: Michael Kay <mhk@mhk.me.uk>
Date: Fri, 30 Apr 2004 15:23:38 +0100
To: "'Volkmann, Mark'" <Mark.Volkmann@AGEDWARDS.com>, "'Jonathan Robie'" <jonathan.robie@datadirect.com>, <scott_boag@us.ibm.com>
Cc: <public-qt-comments@w3.org>
Message-Id: <20040430142342.E571FA1F82@frink.w3.org>

Okay, I remember that being said before, but it's not obvious to me why
that's the case.
Why is it difficult to provide good error diagnostics if function defintions
only have to be terminated by "}" instead of "};"?

A high-level abstract answer is that error detection and recovery, for any
input data, improves with the amount of redundancy in the data. 
More concretely, XQuery is a language with no reserved words, and without
the semicolons, it was impossible to tell whether some invalid construct was
trying to be a declaration in the prolog or was trying to be the main body
of the query, or was just the result of the parser getting confused. People
really want to get multiple syntax errors out in a single run, and for that
you need some anchor points that the parser can use for recovery.
For function definitions in particular it would be possible to get by
without the ";" because the braces are present. But it's much cleaner in my
view to have a consistent policy on delimiters: if you have them anywhere,
you should have them everywhere.
But as Jonathan Robie has said, we have to stop debating trivia and agree to
differ. There are lots of people impatient for us to get this language
finished, and they don't care a damn whether they have to write semicolons
or not, so long as they can have it by Tuesday.
Michael Kay 
Received on Friday, 30 April 2004 10:23:43 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:56:56 UTC