W3C home > Mailing lists > Public > public-qt-comments@w3.org > January 2004

Re: [XQuery] Inconsistent syntax for variable declarations

From: Jonathan Robie <jonathan.robie@datadirect.com>
Date: Mon, 26 Jan 2004 11:16:03 -0500
Message-Id: <6.0.0.22.2.20040126111414.0288d378@ncmail.datadirect-technologies.com>
To: "Kay, Michael" <Michael.Kay@softwareag.com>, <public-qt-comments@w3.org>

I agree.

By the way, the history of this is that we tried the syntax proposed below 
before we had semicolons as separators between declarations in the prolog, 
and faced ambiguities. We then added semicolons to give ourselves this kind 
of flexibility - and then never got around to fixing variable declarations 
to take advantage of this. We still need to actually make this parse, but I 
see no difficulties now, and this would definitely improve the language.

Jonathan

At 05:52 PM 1/23/2004, Kay, Michael wrote:

>I am raising this comment because I have seen several XQuery users make
>mistakes as a result of the syntactic inconsistency between global
>variable declarations and local variables, and there seems to be no good
>reason why they are so different.
>
>For global variables we write:
>
>    declare variable $x [as xs:integer] {3};
>
>while for local variables we write:
>
>    let $x [as xs:integer] := 3
>
>I suggest changing the global variable syntax to:
>
>    declare variable $x [as xs:integer] := 3;
>
>An external variable would be:
>
>    declare variable $x [as xs:integer] external;
>
>Michael Kay
Received on Monday, 26 January 2004 11:22:22 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:14:04 GMT