KevinScript
KevinScript copied to clipboard
Ternary expression
One of KS' goals is to make it possible to do anything with a single very large expression. So it would be nice to have a ternary expression so you don't have to use if
statements.
Unclear what the syntax should be. Candidates:
-
a if b else c
-
b ? a : c
-
if(b){a}else{c}
If the final candidate is adopted, we need to decide how to handle inline if expressions that don't have an else block, and if expressions whose bodies contain more than one statement.