I/if keyword
I <condition> ... | I <condition> ... E ... | I <condition1> ... E I <condition2> ... | I <condition1> ... E I <condition2> ... E ... |
Two consecutive keywords
E/else and I/if are treated especially, so there is no need for a separate/additional keyword like elif in Python or elsifin Ruby.
Also
I/if and E/else can be used in expressions similarly to ternary operator ?:from C:
sign = I x < 0 {-1} E I x > 0 {1} E 0 // 11l
sign = x < 0 ? -1 : x > 0 ? 1 : 0; // C
I/if subkeywords
I.unlikely <condition> ...is used as a sign to the compiler that condition in most of the cases will be false.
This affects the generation of machine code as follows:
- The body of the
I/ifstatement is moved to a separate (“cold”) area of the code segment or to the end of the function after all the “hot” code. - If the body of the
I/ifstatement consists of a single function call, then that call is not inlined.
Example:
- The space on the stack for local variables inside the body of the
I/ifstatement is allocated not at the ‘beginning of the function’/‘moment of entry into the function’, but at the beginning of the body of theI/ifstatement itself.
Example:
I.likely <condition> ...is used as a sign to the compiler that condition in most of the cases will be true.
Affects the generation of machine code only if there is an
E/else branch, the code in which is marked "unlikely".