W3C home > Mailing lists > Public > public-qt-comments@w3.org > November 2015

[Bug 29263] if expression: optional else branch?

From: <bugzilla@jessica.w3.org>
Date: Thu, 05 Nov 2015 14:37:28 +0000
To: public-qt-comments@w3.org
Message-ID: <bug-29263-523-1JiiytEhO0@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=29263

--- Comment #2 from Christian Gruen <christian.gruen@gmail.com> ---
Michael, thanks as usual for the summary. I already feared that much time was
already spent on this discussion a long time ago... I brought this up, as I
experienced that many users would be glad to have the relaxation.

> Don't you immediately hit the classic "dangling else" ambiguity?
>
> if (a=b) then if (c=d) then x else y

When mentioning ambiguities, I only thought of syntactical parsing issues.
Interestingly, the semantical ambiguity you have mentioned seems like a
non-issue to me, maybe because it exists in many other languages as well, and
because you can simply use parentheses...

  if (a=b) then (if (c=d) then x) else y

...to enforce a certain execution (what you would do as well when e.g. using
and/or). This makes sense anyway, I believe, because

  if (a=b) then if (c=d) then x else y else ()

is not easy to read either. One might argue that wrong indentations lead to an
erroneous interpretation of a query...

  if (a=b)
  then
    if (c=d)
    then x
  else
    y

...but this might as well occur with other expressions:

  a and
    b or c

But as you indicated, all of these arguments had probably been brought up
earlier, so I will be completely fine to see this bug closed soon again.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
Received on Thursday, 5 November 2015 14:37:31 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 5 November 2015 14:37:31 UTC