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

why must one have something inside {} ?

David Lee dlee at calldei.com
Sat Dec 3 15:27:00 PST 2011


  why must one have something inside {} ?
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

So far all the cases I can think of it would either be beneficial, closer to
what a programmer would expect and easier on the eye and hand.
Things like  
	element {} {} 
would still be static errors just like
	element  {()} {()} 



----------------------------------------
David A. Lee
http://x-query.com/mailman/listinfo/talk
http://www.xmlsh.org

-----Original Message-----
From: http://x-query.com/mailman/listinfo/talk [mailto:http://x-query.com/mailman/listinfo/talk] On Behalf
Of Michael Sokolov
Sent: Saturday, December 03, 2011 5:53 PM
To: David Lee
Cc: http://x-query.com/mailman/listinfo/talk
Subject: Re:  why must one have something inside {} ?


How about

  element {} {}

  text {}

  attribute {} {}

should those be no-ops too?

I don't think so, because

element {} {"not empty"}

would be problematic

On 12/3/2011 2:41 PM, David Lee wrote:
> Yes exactly !
> Function bodies should be able to be empty too ... its so simple !
>
> declare function notimplementedyet() {};
>
>
>
> ----------------------------------------
> David A. Lee
> http://x-query.com/mailman/listinfo/talk
> http://www.xmlsh.org
>
>
> -----Original Message-----
> From: http://x-query.com/mailman/listinfo/talk [mailto:http://x-query.com/mailman/listinfo/talk] On Behalf
> Of Michael Dyck
> Sent: Saturday, December 03, 2011 2:28 PM
> To: http://x-query.com/mailman/listinfo/talk
> Subject: Re:  why must one have something inside {} ?
>
>
> David Lee wrote:
>> I am asking why in *XQuery*  the expression {} is not equivalent to {()}
> It might simply be that no-one suggested it.
>
>> Is there a case in *XQuery* where this would be problematic ?
> I don't think so.
>
> Probably the least-impact way for the spec to accomplish this would be
> to alter the syntax of EnclosedExpr, from
>       EnclosedExpr ::= "{" Expr "}"
> to
>       EnclosedExpr ::= "{" Expr? "}"
> and then say that, if the Expr is omitted, the EnclosedExpr yields the
> empty sequence. Note that, in addition to element and attribute content,
> this would also take effect when an EnclosedExpr is used as a function
> body, which may or may not be something you'd like as well.
>
> -Michael
>
> _______________________________________________
> 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

_______________________________________________
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-2011 All Rights Reserved.