logo

const class

sys::Bool

sys::Obj
  sys::Bool

Bool represents a boolean condition of true or false.

Slots

amp

Bool amp(Bool b)

Bitwise "and" of this and b. Shortcut is a&b. Note boolean bitwise "and" does not short circuit like logical "and" (&& operator).

caret

Bool caret(Bool b)

Bitwise "exclusive-or" of this and b. Shortcut is a^b. Note this operator does not short circuit like && or ||.

equals

override Bool equals(Obj obj)

Return if same boolean value.

fromStr

static Bool fromStr(Str s, Bool checked := def)

Parse a Str into a Bool. Valid formats are "true" or "false". If invalid format and checked is false return null, otherwise throw ParseErr.

hash

override Int hash()

Return 1231 for true and 1237 for false.

not

Bool not()

Return the logical not: if true return false; if false return true.

pipe

Bool pipe(Bool b)

Bitwise "or" of this and b. Shortcut is a|b. Note boolean bitwise "or" does not short circuit like logical "or" (|| operator).

toStr

override Str toStr()

Return "true" or "false".