[Bug 6927] XQuery 1.1 is not an LL(k) language because of the optional "outer" keyword

http://www.w3.org/Bugs/Public/show_bug.cgi?id=6927





--- Comment #5 from Jonathan Robie <jonathan.robie@redhat.com>  2009-08-25 13:14:18 ---
(In reply to comment #1)
> Good catch, I think you are right.
> 
> Perhaps we could use "outerfor" as a single word.
> 
> Though I really wonder how many people understand this "outer" terminology
> anyway? Not all our users have done a computer science SQL course, and even
> those who have might not immediately see the relevance. It seems very obscurely
> related to the actual semantics. Might something like
> 
> for $x emptiable? in EXPR
> 
> be better?


The word "outer" does not really play a role in these semantics as they are
defined in the specification. The semantics of the expression are

"If the binding sequence contains no items, the output tuple stream depends on
the presence or absence of the outer keyword. If outer is specified, the output
tuple stream consists of one tuple in which the variable is bound to an empty
sequence. If outer is not specified, the output tuple stream consists of zero
tuples."

It would be nice to have a syntax that reflects these semantics more directly,
specifying what to do if the binding sequence is empty. I'm not sure
"emptiable" does that. 

I can't think of a beautiful syntax that does. Perhaps:

for $x in EXPR or empty

Or use a ? after the expression to indicate that empty is allowed:

for $x in EXPR?

We might allow () or any other value to be specified as a parameter, to be used
of the binding expression is empty:

for $x in EXPR or ()

Or (more verbose but more explicit):

for $x in EXPR on empty () 

Regardless, I agree with Mike Kay that "outer" is not helpful in this syntax.


-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Tuesday, 25 August 2009 13:14:31 UTC