W3C home > Mailing lists > Public > www-xml-query-comments@w3.org > September 2001

Data Model pseudo-code: else-less ifs

From: Michael Dyck <MichaelDyck@home.com>
Date: Tue, 18 Sep 2001 00:21:02 -0700
Message-ID: <3BA6F5DE.9A881593@home.com>
To: www-xml-query-comments@w3.org
XQuery 1.0 and XPath 2.0 Data Model
W3C Working Draft
7 June 2001

In the pseudo-code, what is the value of
    if (X) then Y
when X is false?  I think it's ill-defined; an if-expression must have an
"else" part.

This raises two more syntax errors:

4.1 Documents
function dm-node ...
    The final "if" does not have an "else". It should probably be:
        else empty-sequence()
    In fact, maybe you should drop the three previous "else if" parts,
    since they too just yield empty-sequence().

4.8 Text
function dm-text-nodes ...
    The last "if" does not have an "else". It should probably be:
        else append(h, head(t), dm-text-nodes(tail(t)))

-Michael Dyck
Received on Tuesday, 18 September 2001 03:23:48 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:21:13 UTC