JM°-Classic / Atomic types / Bool - True or false
Bool - True or false
For truth values the type "Bool" exists in JM°.
Create
Ein Bool-Objekt kann wie folgt erzeugt werden:
true
TRUE
or with:
false
FALSE
Condition
Often two objects are available, which are used depending on "true" or "false". For this, e.g. Java or PHP offer the ternary operator "x ? y : z".
In JM°, the ".use" function is used for this case:
true.use( "a", "b" ).print
Das erste Argument ("a") wird bei "true", das Zweite ("b") bei "false" zurück gegeben.
- Powered by
OghsWiki
-