Re: [XQuery] Inconsistent syntax for variable declarations

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 UTC