DreamBerd
DreamBerd copied to clipboard
ternary expressions? what operator : very good!
?
:
thinking that since booleans can be true
, false
or maybe
, ternaries can evaluate either the first expression, second expression, or both! or neither. hmm
Considering ?
is taken already for debugging, why not use the tilde?
condition ~? is_true ~; isnt_true ~: is_maybe
Used ;
because that's "not" in DreamBerd, but tbh I'm not sure about the ~:
, what about just ~~
?
Could also do something like this and leave out any of the branches:
condition ~? is_true ~; isnt_true!
condition ~? is_true ~: is_maybe!
condition ~; isnt_true ~: is_maybe!
May I suggest a better, more performant variant,
condition ???
:: if_true
::: if_false
:::: if_maybe
That's great. I think DreamBerd definitely needs a quaternary operator
If the -
sign becomes completely unused (#4), that could be used.