[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message]

Comma problem Re: ANSWERS to "What's wrong with XQuery" question

Michael Rys mrys at microsoft.com
Wed Jul 28 19:35:58 PDT 2010


 Comma problem Re:  ANSWERS to	"What's wrong with
	XQuery"	question
I remember that we had considerable discussions about both during the design of the language. Unfortunately, there was no easy way to do either if I remember correctly...

Michael

-----Original Message-----
From: http://x-query.com/mailman/listinfo/talk [mailto:http://x-query.com/mailman/listinfo/talk] On Behalf Of Daniela Florescu
Sent: Wednesday, July 28, 2010 11:30 AM
To: Mike Sokolov
Cc: http://x-query.com/mailman/listinfo/talk Talk
Subject: Re: Comma problem Re:  ANSWERS to "What's wrong with XQuery" question

Mike

What I understand from this discussion is that there are two independent problems.

1. Maybe the precedence of "," was wrongly chosen in XQuery 1.0, and the current design is not the most intuitive.

Even if this is true, that's too late to change that, unfortunately.

2. Maybe instead of DirectElementConstructor as an expression we should allow an XML fragments (aka a sequence of XML DirectElementConstructors, without commas in between), to make it look and feel more like real XML.

Granted, I have the same understanding problem with 9 out of 10 new people to whom I am teaching XQuery.

W3C should consider it.

Best regards
Dana





On Jul 28, 2010, at 11:04 AM, Mike Sokolov wrote:

> The comparison with arithmetic operators is a bit of a stretch, since 
> we all learnt that precedence in elementary school math class.  But I 
> do agree, it's just a question of operator precedence, not a question 
> of right or wrong - just a question of convention and matching user 
> expectation.  That's why I introduced my complaint with "programmers 
> used to C++/Java/ etc."  I guess I feel there is a principle that in 
> the absence of a good reason to do things otherwise, one should stick 
> to convention since it helps with quick understanding for new users.  
> It was somewhat surprising to me, coming from that background, that 
> the precedence of "," was so low, and from the other responses, it 
> seems some others shared (or at least have been made aware of) the 
> same confusion, although it is, as you say, easily remedied.
>
> -Mike
>
> On 07/28/2010 01:31 PM, Daniela Florescu wrote:
>> Andrew,
>>
>> It's not a matter of statements introduced by ",".
>>
>> Comma is just an infix operator like +. (granted, not as frequently 
>> used in programming languages like +, but still widely used).
>>
>> It's a question of the precedence of the operators in the grammar- 
>> and I don't understand why is this different from other languages.
>>
>> When you learn what the semantics of
>>
>> 1+2*3
>>
>> you have to learn that * has higher precedence then +.
>>
>> Same here, FLWOR expressions have higher precedence.
>>
>> Best regards
>> Dana
>>
>>
>> On Jul 28, 2010, at 2:10 AM, Andrew Welch wrote:
>>
>>> for $l in ('a', 'b', 'c')
>>> return $l, 'd'
>>
>> _______________________________________________
>> http://x-query.com/mailman/listinfo/talk
>> http://x-query.com/mailman/listinfo/talk

_______________________________________________
http://x-query.com/mailman/listinfo/talk
http://x-query.com/mailman/listinfo/talk




PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.