W3C home > Mailing lists > Public > public-qt-comments@w3.org > January 2011

[Bug 11792] lack of syntactic symmetry between the control flow expressions

From: <bugzilla@jessica.w3.org>
Date: Tue, 18 Jan 2011 17:57:00 +0000
To: public-qt-comments@w3.org
Message-Id: <E1PfFng-0003X2-4M@jessica.w3.org>
http://www.w3.org/Bugs/Public/show_bug.cgi?id=11792

--- Comment #2 from Daniela Florescu <dflorescu@mac.com> 2011-01-18 17:56:59 UTC ---
Mike,

that would be the right solution in my mind: make the trycatch look like switch
and typeswitch.

try ( Expr )  ( catch Qname return Expr  )+

I agree with you that we made this mistake in the past (unordered and validate
are examples, indeed). But really we shouldn't do it again.

Plus the use of {..} and the lack of 'return'  will push people into believing
that what follows,
or what is enclosed, is a statement, while it is not. They are plain
expressions like the other ones.

Best regards
Dana




(In reply to comment #1)
> Tricky - changing either switch or try/catch to be more like the other will at
> the same time make it less like the equivalent construct in the C/Java family
> of languages.
> 
> The parentheses-versus-curlies problem in XQuery is very real. I've never
> understood why validate{} isn't a validate() function, and the distinction
> between unordered{} and unordered() is so subtle I doubt many WG members could
> explain it without first checking the spec (especially as no-one ever uses
> either...). Unfortunately, I think it's too late to fix this, and it's hard to
> see how to add new constructs without perpetuating the arbitrariness of it all.
> Certainly, changing try() to use parenthesis rather than curlies would make it
> more like some things and less like others, without giving any overall
> improvement in consistency.

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Tuesday, 18 January 2011 17:57:01 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:45:45 UTC