Added else child to the if statement.#400
Added else child to the if statement.#400Teemperor wants to merge 2 commits intoWebAssembly:masterfrom
Conversation
Without an else branch we would need a temp local for writing normal if/else statements. If someone just wants an normal if statement he/she can just use a empty block as an else. Other suggestion if changing `if` is not up to debate: Add an `ifelse` and keep `if` the way it is.
|
This is already the case for ml-proto, so lgtm. |
|
Actually, ml-proto allows else-less if (and treats it as |
AstSemantics.md
Outdated
|
Thanks JF, fixed the spelling! |
|
Is this mandating that both be present? Or is "else" optional? |
|
IMHO: The problem with an optional |
|
I'm not sure I understand the issue. This seems to be a concern about the binary format, not the AST semantics itself. |
|
The current AST encoding is to my knowledge something like So instead of I know the discussion is not about the binary format, but the preliminary format would suffer from that issue (and I assume it will not change that much). |
|
Or we could introduce them now as syntax sugar, I guess, and reserve the right to turn them into actual opcodes if we need to. |
|
lgtm to land as is and we can refine layer as we get serious about the binary encoding. |
|
With #427 merged, there are now separate |
Without an else branch we would need a temp local for writing normal if/else statements. If someone just wants an normal if statement he/she can just use a empty block as an else.
Other suggestion if changing
ifis not up to debate: Add anifelseand keepifthe way it is.