Boolean
From Erights
(Difference between revisions)
Kevin Reid (Talk | contribs) (category) |
Kevin Reid (Talk | contribs) (use instance msgdoc template) |
||
Line 3: | Line 3: | ||
== Protocol == | == Protocol == | ||
- | + | {{instance msgdoc|pick|2|<var>t</var>, <var>f</var>|any}} | |
- | + | ||
- | + | ||
false.pick(<var>t</var>, <var>f</var>) returns <var>f</var>; true.pick(<var>t</var>, <var>f</var>) returns <var>t</var>. | false.pick(<var>t</var>, <var>f</var>) returns <var>f</var>; true.pick(<var>t</var>, <var>f</var>) returns <var>t</var>. | ||
- | + | {{instance msgdoc|not|0||[[Boolean]]}} | |
- | + | ||
- | + | ||
Boolean negation. | Boolean negation. | ||
- | + | {{instance msgdoc|or|1|<var>other</var> :[[Boolean]]|[[Boolean]]}} | |
- | + | ||
- | + | ||
Boolean or. The argument is coerced to a boolean. | Boolean or. The argument is coerced to a boolean. | ||
- | + | {{instance msgdoc|and|1|<var>other</var> :[[Boolean]]|[[Boolean]]}} | |
- | + | ||
- | + | ||
Boolean and. The argument is coerced to a boolean. | Boolean and. The argument is coerced to a boolean. | ||
- | + | {{instance msgdoc|xor|1|<var>other</var> :[[Boolean]]|[[Boolean]]}} | |
- | + | ||
- | + | ||
Boolean exclusive or. The argument is coerced to a boolean. | Boolean exclusive or. The argument is coerced to a boolean. | ||
=== op__cmp/1 === | === op__cmp/1 === | ||
- | |||
Comparison with other Booleans. See [[Message op__cmp]]. | Comparison with other Booleans. See [[Message op__cmp]]. | ||
[[Category:ELib specification]] | [[Category:ELib specification]] |
Revision as of 02:50, 2 July 2008
The Boolean
type has exactly two members, false
and true
. All three names are in the universal scope.
Contents |
Protocol
pick/2
- Signature: pick(t, f) :any
false.pick(t, f) returns f; true.pick(t, f) returns t.
not/0
- Signature: not() :Boolean
Boolean negation.
or/1
- Signature: or(other :Boolean) :Boolean
Boolean or. The argument is coerced to a boolean.
and/1
- Signature: and(other :Boolean) :Boolean
Boolean and. The argument is coerced to a boolean.
xor/1
- Signature: xor(other :Boolean) :Boolean
Boolean exclusive or. The argument is coerced to a boolean.
op__cmp/1
Comparison with other Booleans. See Message op__cmp.