<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>2331</bug_id>
          
          <creation_ts>2005-10-07 16:48:36 +0000</creation_ts>
          <short_desc>FLWORExpr and QuantifiedExpr symmetry.</short_desc>
          <delta_ts>2007-02-25 23:47:46 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>XQuery 1.0</component>
          <version>Last Call drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="David Holmes">dholmes</reporter>
          <assigned_to name="Don Chamberlin">chamberl</assigned_to>
          
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>6659</commentid>
    <comment_count>0</comment_count>
    <who name="David Holmes">dholmes</who>
    <bug_when>2005-10-07 16:48:37 +0000</bug_when>
    <thetext>In studying FLWOR and Quantified expressions together, I noted some 
differences that struck me as rather odd and indicated that the Quantified 
expression might be incomplete.
1. FLOWRExpr supports assignment of a full sequence to a variable whereas 
QuantifiedExpr does not. More precisely, FLWORExpr supports both &quot;in&quot; and &quot;:=&quot; 
clauses whereas QuantifiedExpr only supports &quot;in&quot;.
2. FLOWRExpr supports positional variables for its &quot;in&quot; clause whereas 
QuantifiedExpr does not.

In addition, I had also wondered whether the use of both &quot;for&quot; and &quot;in&quot; 
together, and &quot;let and &quot;::=&quot; together was somewhat redundant. The grammar 
requires me to prefix a &quot;for&quot; or a &quot;let&quot; token when the &quot;=&quot; or &quot;::=&quot; token 
already defines my intention (There may be some practical parser consideration 
I&apos;m missing here).

It seems to me that there might be a more uniform syntax that solves all of 
these problems and also emphasizes the functional nature of the language.

ReturnExpr ::= &quot;given&quot; BindingSpecification WhereClause? 
OrderByClause? &quot;return&quot; ExprSingle

QuantifiedExpr ::= &quot;given&quot; BindingSpecification (&quot;some&quot;|&quot;every&quot;) ExprSingle

BindingSpecification ::= (InClause | AssignClause)+

InClause ::= &quot;$&quot; VarName TypeDeclaration? &quot;in&quot; ExprSingle PositionalVar?
AssignClause ::= &quot;$&quot; VarName TypeDeclaration? &quot;:=&quot; ExprSingle

I&apos;ve suggested moving the PositionalVar to the end to simplify parsing.

Examples:

given $x in (1,2,3), $y := (2,3,4) return $x + $y

if (given $x in (1,2,3), $y := (2,3,4) some $x + $y = 4) then ...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6660</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2005-10-07 17:05:51 +0000</bug_when>
    <thetext>The XQuery spec has been through about ten drafts including two last calls. It&apos;s
always possible to come up with improvements to any language, but it must surely
be fairly obvious that if we ever want to finish, we&apos;ve got to focus efforts on
fixing the few remaining corner cases rather than throwing everything up in the
air. I find it hard to imagine why you think this is a useful comment to raise
at this time: you&apos;re not actually suggesting the language is broken in any way.

Michael Kay
(personal response)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>8248</commentid>
    <comment_count>2</comment_count>
    <who name="Don Chamberlin">chamberl</who>
    <bug_when>2006-02-14 00:17:53 +0000</bug_when>
    <thetext>David,
Thanks for your comment. Your suggestion was discussed by the Query working 
group on Feb. 1, 2006. The working group believes that it is not appropriate to 
make major changes to the XQuery grammar at this point in the design process 
unless significant problems are discovered, which does not seem to be the case 
with this suggestion. Therefore, the working group does not plan to change the 
XQuery language specification in response to this comment. If you disagree with 
this resolution, please respond with evidence why your comment represents a 
major defect in functionality rather than simply a cosmetic issue. In the 
absence of such evidence, we will close this issue at the end of February 2006 
(or you may close it yourself if you agree.)
Regards,
Don Chamberlin (for the Query Working Group)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>14155</commentid>
    <comment_count>3</comment_count>
    <who name="Jim Melton">jim.melton</who>
    <bug_when>2007-02-25 23:47:46 +0000</bug_when>
    <thetext>Closing bug because commenter has not objected to the resolution posted and more than two weeks have passed.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>