W3C home > Mailing lists > Public > public-qt-comments@w3.org > November 2006

[Bug 3818] Static typing of $input-context1/works[1]/employee[1]/empnum[1]

From: <bugzilla@wiggum.w3.org>
Date: Fri, 03 Nov 2006 10:18:13 +0000
To: public-qt-comments@w3.org
Message-Id: <E1Gfw7p-0005FE-2D@wiggum.w3.org>


------- Comment #9 from tim@cbcl.co.uk  2006-11-03 10:18 -------
"On the other hand, if they call a function that expects element(employee) and
they say "treat as node()", then a static error seems perfectly reasonable. The
rule is designed for the former case, which is much more likely to occur in

Any implementation not implementing static typ checking could not raise such an
error, because "treat as" does not change the dynamic type of a value.

The use of static typing can alert users to the possibility of unforseen
dynamic errors.  While I appreciate your viewpoint, my personal opinion is that
I'd rather know of a potential problem at query compile time than at some point
in the future when someone sends in the "wrong sort" of data to the query and
triggers a dynamic error.

We are pointing out the static type checking problems we find in XQTS in the
hope that the formal semantics type checking rules can be made as precise and
usable as possible.  We are currently failing about 200 of the 14000 or so
minimal conformance tests.  I'd argue this shows that the static typing
approach is fairly workable.  The formal semantics specification gave us the
confidence that XQuery/XPath had been well thought through.
Received on Friday, 3 November 2006 10:18:26 UTC

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