Add "elif" statement
Bug #872685 reported by
Matt Giuca
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mars |
Fix Committed
|
Low
|
Matt Giuca |
Bug Description
Mars does not have any "else if" notion, which makes chained conditional blocks very hard to read. Obviously, C-syntax languages do not have an "else if" either; it is just implicit in the syntax:
if (...)
{
...
}
else if (...)
{
...
}
else
{
...
}
But in Python-syntax languages, such as Mars, this is not so natural, as it requires extra indentation for each "else if" clause:
if ...:
...
else:
if ...:
...
else:
...
Therefore, add an "elif" keyword with the same meaning as Python:
if ...:
...
elif ...:
...
else:
...
Related branches
To post a comment you must log in.
Fixed in trunk r1285.