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

[Bug 4024] ST-WhereExpr001 should not be expected to fail?

From: <bugzilla@wiggum.w3.org>
Date: Tue, 28 Nov 2006 18:09:27 +0000
CC:
To: public-qt-comments@w3.org
Message-Id: <E1Gp7OZ-0001Jf-6S@wiggum.w3.org>

http://www.w3.org/Bugs/Public/show_bug.cgi?id=4024





------- Comment #5 from per@bothner.com  2006-11-28 18:09 -------
The static typing rules are not supposed to define a separate language.  They
are supposed to defined a set of computable (and hence conservative) rules for
staticing determing whether an XQuery program is type-correct.  Because of the
limits of computability, and because we want to be conservative, sometimes
static typing will reject a program that works fine.  However, that is not the
goal: The goal is that if we had perfect computability, then static typing
would reject a program if and only if there is some set of inputs that would
cause the program to fail at runtime.

The distinction between the dynamic and static semantics for fn:boolean seems
to violate that goal.  Even for this trivial program it is unclear if it is
valid:
  fn:boolean(<a/>, 1)

Now I can see the efficiency argument for not having to test every item in a
sequence.  One solution is to make unspecified the result of fn:boolean on a
hybrid sequence starting with a node - allow an implementation to yield either
true or an error,

At the very least the test-case needs to be fixed too allow it to not fail.
Received on Tuesday, 28 November 2006 18:09:36 UTC

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