This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Do not overload "return" with updating semantics. "return do" just sounds weird. use "modify" (also makes it consistent with transform) for updating and require "return" to be non-updating.
I agree that "return do" is not pretty. But I don't think it would be wise to have two forms of FLWOR, one that requires an updating expression and one that requires a non-updating expression. This will get us into trouble later if we allow updating expressions and non-updating expressions to be mixed, as in the XQueryP proposal. I think it is wiser to keep the FLWOR expression fully orthogonal (independent of what kind of expression is in the return clause). Note that this issue (relationship between FLWOR and updating expressions) was discussed at great length at the St. Petersburg meeting of the working group in January 2006. The current design was agreed upon by the working group after considering several proposals. One of the things that slows down our progress is repeatedly revisiting decisions that were made explicitly many months ago. --Don C.
Michael, The Query working group discussed the syntax of the Update Facility in its meetings on June 29 and July 31, 2007. The working group did not agree to split the FLWOR expression into updating and non-updating versions as requested by this Bugzilla item. However, the working group agrees with your observation that the use of "do" in the update syntax is unappealing. As you know, the XQuery grammar uses double keywords in certain positions as an aid to lexing the language in the absence of reserved words. That is the reason for constructs like "do insert". On July 31, the working group decided to replace "do insert" by "insert nodes" (with similar changes in the delete, replace, and rename expressions). Although this is not exactly the change you requested, we believe that this change addresses the underlying issue you have raised. Details of the grammar change will appear in the next draft of the Update specification. This change does not affect the semantics of the Update facility. The change is pending confirmation that it can be successfully integrated into our reference parser. Regards, Don Chamberlin (for the Query Working Group)
Using return when nothing gets returned is still strange, but the new syntax is already progress.