Implement if and cif statements

Bug #572256 reported by Eike
6
This bug affects 1 person
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.

Eike (eike-welk)
Changed in freeode:
importance: Undecided → Wishlist
status: New → Confirmed
milestone: none → 0.4.0
Revision history for this message
Eike (eike-welk) wrote :

The D language also has a similar construct: "static if(...) ..."

Eike (eike-welk)
Changed in freeode:
assignee: nobody → Eike (eike-welk)
status: Confirmed → Fix Committed
Eike (eike-welk)
Changed in freeode:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.