Documentation ¶
Overview ¶
tristate is a helper package for tri-state boolean logic, which is used for logical combinator components.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bool ¶
type Bool int
Bool is a tri-state boolean: False, True or Unknown.
Operations use truth tables as in https://en.wikipedia.org/wiki/Three-valued_logic#Kleene_and_Priest_logics.
func FromReading ¶
FromReading interprets runtime.Reading as Bool, mapping 0 to False, any valid non-zero to True and Invalid to Unknown.
(It's the same mapping as in ToReading, but allowing more truthy values).
Click to show internal directories.
Click to hide internal directories.