RE: [XQuery] IfExpr should allow an optional else clause

This has been an issue in the past, and the WG decided against it, partly 
because it causes a choice conflict in the grammar (though this is a 
common thing with languages, and we can define some rules and live with 
it), and partly because the if statement has to return something, and so 
we would have to define the else to return an empty sequence.

-scott

[Speaking for myself... this in no way reflects WG overall opinion or 
consensus.]

public-qt-comments-request@w3.org wrote on 01/28/2004 05:37:14 AM:

> 
> At 06:55 AM 1/27/2004, Kay, Michael wrote:
> >(For my own part, I would have much prefered a syntax in which
> >expressions were self-closing, e.g.
> >
> >if (Expr) then Expr [else Expr] fi
> >
> >But I lost that battle. I don't think it would be a good idea to make
> >"else" optional unless we introduce a mandatory closer to remove the
> >ambiguity.)
> 
> For just this one expression, I agree - but if we went that way, we 
should 
> do the same for other expression types, including FLWOR expressions. 
> Working this through...it seemed to make the language more cumbersome.
> 
> Jonathan 
> 

Received on Wednesday, 28 January 2004 09:21:55 UTC