Boolean values: Difference between revisions

Line 1,073:
=={{header|EMal}}==
<syntaxhighlight lang="emal">
^|EMal has a dedicated Logical type, andexpressed itsby keywordthe logic, keyword.
|whichIt holds the two values false and true.
|thereThere are no implicit conversions, but explicit conversions
|from/to int (0,1) or text("⊥", "⊤") are allowed.
|^
logic booleanTrue = true
Line 1,089:
writeLine("explicit conversion from text")
end
watchwriteLine(logicint!"⊤"true) # is trueone
watchwriteLine(logictext!0false) # is false"⊥"
watch(int!true) # is one
watch(text!false) # is "⊥"
</syntaxhighlight>
{{out}}
Line 1,099 ⟶ 1,097:
explicit conversion from integer
explicit conversion from text
1
Logical: <⊤>
Logical: <>
Integer: <1>
Text: <⊥>
</pre>
 
214

edits