Jump to content

Boolean values: Difference between revisions

No edit summary
Line 1,073:
=={{header|EMal}}==
<syntaxhighlight lang="emal">
^|EMal has a dedicated Logical type, and its keyword logic,
|which 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
Line 1,084 ⟶ 1,089:
writeLine("explicit conversion from text")
end
watch(logic!"⊤") # is true
watch(logic!0) # is false
watch(int!true) # is one
watch(text!false) # is "⊥"
</syntaxhighlight>
{{out}}
Line 1,090 ⟶ 1,099:
explicit conversion from integer
explicit conversion from text
Logical: <⊤>
Logical: <⊥>
Integer: <1>
Text: <⊥>
</pre>
 
226

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.