Boolean values: Difference between revisions
Content added Content deleted
Line 1,073: | Line 1,073: | ||
=={{header|EMal}}== |
=={{header|EMal}}== |
||
<syntaxhighlight lang="emal"> |
<syntaxhighlight lang="emal"> |
||
^|EMal has a dedicated Logical type |
^|EMal has a dedicated Logical type expressed by the logic keyword. |
||
| |
|It holds the two values false and true. |
||
| |
|There are no implicit conversions, but explicit conversions |
||
|from/to int (0,1) or text("⊥", "⊤") are allowed |
|from/to int (0,1) or text("⊥", "⊤") are allowed. |
||
|^ |
|^ |
||
logic booleanTrue = true |
logic booleanTrue = true |
||
Line 1,089: | Line 1,089: | ||
writeLine("explicit conversion from text") |
writeLine("explicit conversion from text") |
||
end |
end |
||
writeLine(int!true) # is one |
|||
writeLine(text!false) # is "⊥" |
|||
watch(int!true) # is one |
|||
watch(text!false) # is "⊥" |
|||
</syntaxhighlight> |
</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
Line 1,099: | Line 1,097: | ||
explicit conversion from integer |
explicit conversion from integer |
||
explicit conversion from text |
explicit conversion from text |
||
1 |
|||
Logical: <⊤> |
|||
⊥ |
|||
Integer: <1> |
|||
Text: <⊥> |
|||
</pre> |
</pre> |
||