W3C home > Mailing lists > Public > www-ql@w3.org > January to March 2004

Re: IfExpr has a mandatory else clause

From: TAN Kuan Hui <kuanhui@xemantics.com>
Date: Tue, 27 Jan 2004 08:26:32 +0800
Message-ID: <000a01c3e46c$3905ace0$4445bada@pinecone>
To: "Kay, Michael" <Michael.Kay@softwareag.com>, "Bas de Bakker" <bas@x-hive.com>, <www-ql@w3.org>

Appreciate the clarification.

However making the else clause optional does not make the
IfExpr expression less of an expression does it ?
Implicitly returning an empty sequence in the absence of an
else clause is not intuitive ?

----- Original Message ----- 
From: "Kay, Michael" <Michael.Kay@softwareag.com>
To: "TAN Kuan Hui" <kuanhui@xemantics.com>; "Bas de Bakker"
<bas@x-hive.com>; <www-ql@w3.org>
Sent: Monday, January 26, 2004 7:38 PM
Subject: RE: IfExpr has a mandatory else clause

> So is grammar ambiguity the reason that IfExpr has a
> mandatory else clause ? Are there other design considerations

Making the else clause mandatory emphasizes that this is an expression
and not a procedural statement: it always returns a result. In most
languages where I've seen a conditional expression, both branches are

An exception of course is <xsl:if> in XSLT, but perhaps that's because
the semantics have only recently been recast into expression form, and
the spec still talks of this as an "instruction" rather than an

Michael Kay
Received on Monday, 26 January 2004 19:32:49 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:17:16 UTC