Implement if and cif statements
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Freeode |
Fix Released
|
Wishlist
|
Eike |
Bug Description
The "if" statement has complicated semantics and implementation. It also has some restrictions that are impractical for writing macros, especially return statements are illegal inside if statements. The reason for this is that the "if" statement it has to work at runtime and at compile time.
Therefore I propose to split the "if" statement into two statements:
- if : A simplified version of the current "if" statement that is executed at compile time. It has all the restrictions of the current "if" statement.
- cif : A conditional statement that is only executed at compile time. It's condition must evaluate to a known constant. It has no further restrictions, the implementation would be trivial.
Changed in freeode: | |
importance: | Undecided → Wishlist |
status: | New → Confirmed |
milestone: | none → 0.4.0 |
Changed in freeode: | |
assignee: | nobody → Eike (eike-welk) |
status: | Confirmed → Fix Committed |
Changed in freeode: | |
status: | Fix Committed → Fix Released |
The D language also has a similar construct: "static if(...) ..."