[xquery-talk] why must one have something inside {} ?

Michael Kay mike at saxonica.com
Sun Dec 4 03:37:13 PST 2011

On 03/12/2011 23:27, David Lee wrote:
> I'm not suggesting "{}" is a 'no-op' I'm suggesting it parses equivalent to
> {()}
> Maybe in the next week or two I'll study the BNF in more detail and make a
> formal suggestion as per Liam's suggestion for XQuery 3.0
> So far I haven't seen any reason why it would be either
> 1) Ambiguous
> 2) Cause parser confusion
> 3) Cause reader confusion
> 4) Cause 'unexpected' things to happen
There are other objections the WG might want to consider: Assigning a 
meaning to constructs that are currently disallowed

(a) can make it more difficult to produce good diagnostics for queries 
that are actually wrong (ultimately, you end up with the HTML5 situation 
where everything you write means something, so there are no compile-time 
errors, only run-time errors), and

(b) can "use up" syntactic space that might be needed in the future for 
new features. For example, one might want "{}" to represent an empty map 
- which is not necessarily inconsistent with this proposal, but in 
general, when you give a syntactic construct a meaning you remove the 
option of giving it a different meaning in the future.

Michael Kay

More information about the talk mailing list