Bool



next up previous contents index
Next: Int Up: No Title Previous: Null

Bool

Type "bool" is an immutable type with two objects, denoted by the literals "true" and "false".

Methods for type "bool"

  not ( ) returns (bool)
      % effects   returns ~self

  and (x: bool) returns (bool)
      % effects   returns the boolean and of self and x

  or (x: bool) returns (bool)
      % effects   returns the boolean or of self and x

  xor (x: bool) returns (bool)
      % effects   returns the boolean xor of self and x

  equal (x: bool) returns (bool)
      % effects   returns true if self and x are either both true or
      %           both false; else returns false

  similar (x: bool) returns (bool)
      % effects   returns true if self and x are either both true or both
      %           false; else returns false

  copy ( ) returns (bool)
      % effects   returns self

  unparse ( ) returns (string)
      % effects   if self = true returns the four-character string ``true'';
      %           else returns the five-character string ``false''



theta-questions@lcs.mit.edu