Hades supports inline if (or ternary operator) statements. They work as such:
condition ? statementIfConditionIsTrue : statementIfConditionIsFalse
with math from std:math​func sinc(dec x)put x != 0.0 ? math->sin(x)/x : 1.0end
The null conditional operator checks if the left side of the operator evaluates to null
. If it does, the statement on the right side of the operator is executed and returned.
with exceptions from std:exceptionswith console from std:io​var doStuff = { x =>x :: raise exceptions->ArgumentNullException("{} is null"->format(nameof(x)))}​trydoStuff(null)catch(default e)console->out:e->messageend​//Output: x is null​func add(a,b) requires (a :: false) and (b :: false)put a + bend