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

RE: [XPath 2.0] Sequences can never be nested ... but what about function arguments?

From: Roger L. Costello <costello@mitre.org>
Date: Mon, 14 Jun 2004 14:14:18 -0400
To: <public-qt-comments@w3.org>, "'Roger L. Costello'" <costello@mitre.org>
Message-ID: <005501c4523b$68ffd000$19395381@MITRE.ORG>

Thanks Jim.  I kinda guessed that was the answer - that a function argument
list is not a sequence.

The thing that bothers me is that a function argument list sure looks like a
sequence.  A function argument list is "a list of comma-separated values".
Isn't that how Xpath defines a sequence?  

Are there any other examples in Xpath of a comma-separated list of values
that is not a sequence?

Thanks again Jim.  /Roger


-----Original Message-----
From: Jim Melton [mailto:jim.melton@acm.org] 
Sent: Monday, June 14, 2004 1:57 PM
To: Roger L. Costello
Cc: public-qt-comments@w3.org; 'Roger L. Costello'
Subject: Re: [XPath 2.0] Sequences can never be nested ... but what about
function arguments?


Roger,

While I regret that XQuery's sequences cannot be nested (and have raised a 
comment on this subject), I don't believe that the situation that you 
observed constitutes an exception to this rule.

At 11:31 AM 6/14/2004 Monday, Roger L. Costello wrote:

>Hi Folks,
>
>In section 3.3 of the XPath spec it says:
>
>"Sequences are never nested-for example, combining the values 1, (2, 3),
and
>( ) into a single sequence results in the sequence (1, 2, 3)."
>
>Aren't the arguments to a function a sequence?  If sequences cannot be
>nested, then the example in 3.1.5 would not be valid:

The answer, in short, is that the arguments to a function are not, in fact, 
a sequence.  It is true that the syntax of function invocation involves a 
comma-separated list of argument values enclosed in parentheses, but that 
is explicitly not syntactically defined to be a sequence.


>"my:two-argument-function((1, 2), 3) denotes a function call with two
>arguments, the first of which is a sequence of two values."

The statement that you quote is precise and accurate (and correct).  The 
function call has two arguments.  It does not have a "sequence of two 
values", one of which is itself another "sequence of two values".  It has 
two arguments.  The first argument is the value that is a sequence of 
values "(1, 2)" and the second argument is the value "3".


>Do we not have a sequence with a nested sequence in this example?

Nope, we do not.


>It would seem that sometimes sequences can be nested (e.g., in function
>calls) and other times sequences cannot be nested.

Not true, since argument lists are (a)not defined syntactically to be a 
sequence and (b)not represented in the data model at all, particularly not 
as a sequence.


>Can someone clarify this please?  /Roger

Hope this helps,
    Jim

========================================================================
Jim Melton --- Editor of ISO/IEC 9075-* (SQL)     Phone: +1.801.942.0144
Oracle Corporation        Oracle Email: jim dot melton at oracle dot com
1930 Viscounti Drive      Standards email: jim dot melton at acm dot org
Sandy, UT 84093-1063              Personal email: jim at melton dot name
USA                                                Fax : +1.801.942.3345
========================================================================
=  Facts are facts.  However, any opinions expressed are the opinions  =
=  only of myself and may or may not reflect the opinions of anybody   =
=  else with whom I may or may not have discussed the issues at hand.  =
======================================================================== 
Received on Monday, 14 June 2004 14:14:28 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:45:20 UTC