Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
18
Task/Boolean-values/EMal/boolean-values.emal
Normal file
18
Task/Boolean-values/EMal/boolean-values.emal
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
^|EMal has a dedicated Logical type expressed by the logic keyword.
|
||||
|It's not nullable and holds the two values false and true.
|
||||
|There are no implicit conversions, but explicit conversions
|
||||
|from/to int (0,1) or text ("⊥", "⊤") are allowed.
|
||||
|^
|
||||
logic booleanTrue = true
|
||||
logic booleanFalse = false
|
||||
if 2 > 1 and true and not false
|
||||
writeLine("true: " + true + ", false: " + false)
|
||||
end
|
||||
if false == logic!0
|
||||
writeLine("explicit conversion from integer")
|
||||
end
|
||||
if true == logic!"⊤"
|
||||
writeLine("explicit conversion from text")
|
||||
end
|
||||
writeLine(int!true) # is one
|
||||
writeLine(text!false) # is "⊥"
|
||||
Loading…
Add table
Add a link
Reference in a new issue