[Issue 1053] Make 'static else if' or 'static if (...) {...} else if' work
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Mar 17 10:03:36 PDT 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1053
deewiant at gmail.com changed:
What |Removed |Added
----------------------------------------------------------------------------
Version|1.008 |1.009
------- Comment #3 from deewiant at gmail.com 2007-03-17 12:03 -------
That _is_ the way I often think of if-else. :-P I prefer the way it currently
works, as I do sometimes write:
static if
else if
And it means what I want it to mean.
Sometimes, though, I find that it's clearer to write something as:
if
else {
if
else
}
Instead of:
if
else if
else
Depending on what exactly is in the first else.
"static else if" would complicate the grammar a bit (written in about a minute,
not sure if the following would be correct):
if: "if [expression] [statement] (else [statement])"
static if: "[static if [expression] [statement] (else [statement])] | [static
if [expression] [statement] (static else [if-statement])]"
As opposed to the current:
if or static if: "(static) if [expression] [statement] (else [statement])"
--
More information about the Digitalmars-d-bugs
mailing list