edu.vub.at.objects
Interface Boolean


 Boolean

The ATBoolean represents the public interface of a boolean object.

Author:
smostinc, tvcutsem

Method Summary
 Boolean and:(Closure other)
          Returns false if the receiver is false or the result of the evaluation of the other boolean expression passed as argument if the receiver is true.
 Boolean and:and:(Closure b1, Closure b2)
          Auxiliary function: def boolean.and: b1 and: b2 { (boolean.and: b1).and: b2 }
 Object ifFalse:(Closure alternative)
          Returns an ATObject representing the result of evaluating the code to execute if the boolean condition is false.
 Object ifTrue:(Closure consequent)
          Returns an ATObject representing the result of evaluating the code to execute if the boolean condition is true.
 Object ifTrue:ifFalse:(Closure consequent, Closure alternative)
          Returns an ATObject representing the result of evaluating either the code to execute if the boolean condition is false or the one to execute if the boolean condition is true.
 Boolean not()
          Returns true if the receiver is false or false if the receiver is true.
 Boolean or:(Closure other)
          Returns true if the receiver is true or the result of the evaluation of the other boolean expression passed as argument if the receiver is false.
 Boolean or:or:(Closure b1, Closure b2)
          Auxiliary function: def boolean.or: b1 or: b2 { (boolean.or: b1).or: b2 }
 
Methods inherited from interface edu.vub.at.objects.Object
super
 

Method Detail

ifTrue:

Object ifTrue:(Closure consequent)
Returns an ATObject representing the result of evaluating the code to execute if the boolean condition is true. Returns nil if the boolean expression is false.

Usage: booleanCondition.ifTrue: { code }

Parameters:
consequent - a closure containing the code to execute if the boolean is true.
Returns:
the result of evaluating the closure or nil.
Throws:
edu.vub.at.exceptions.InterpreterException - if raised in the evaluation of the closure.

ifFalse:

Object ifFalse:(Closure alternative)
Returns an Object representing the result of evaluating the code to execute if the boolean condition is false. Returns nil if the boolean expression is true.

Usage: booleanCondition.ifFalse: { code }

Parameters:
alternative - a closure containing the code to execute if the boolean is false.
Returns:
the result of evaluating the closure or nil.
Throws:
edu.vub.at.exceptions.InterpreterException - if raised in the evaluation of the closure.

ifTrue:ifFalse:

Object ifTrue:ifFalse:(Closure consequent,
                       Closure alternative)
Returns an Object representing the result of evaluating either the code to execute if the boolean condition is false or the one to execute if the boolean condition is true.

Usage: booleanCondition.ifTrue: { consequent } ifFalse: { alternative }

Parameters:
consequent - a closure containing the code to execute if the boolean is true.
alternative - a closure containing the code to execute if the boolean is false.
Returns:
the result of the consequent or alternative closure.
Throws:
edu.vub.at.exceptions.InterpreterException - if raised in the evaluation of the consequent or alternative closure.

and:

Boolean and:(Closure other)
Returns false if the receiver is false or the result of the evaluation of the other boolean expression passed as argument if the receiver is true.

Usage: boolean.and: { other }

Parameters:
other - a closure whose evaluation returns a boolean.
Returns:
false or the result of evaluating the other boolean.
Throws:
edu.vub.at.exceptions.InterpreterException - if raised in the evaluation of the other boolean.

and:and:

Boolean and:and:(Closure b1,
                 Closure b2)
Auxiliary function: def boolean.and: b1 and: b2 { (boolean.and: b1).and: b2 }


or:

Boolean or:(Closure other)
Returns true if the receiver is true or the result of the evaluation of the other boolean expression passed as argument if the receiver is false.

Usage: boolean.or: { other }

Parameters:
other - a closure whose evaluation returns a boolean.
Returns:
true or the result of evaluating the other boolean.
Throws:
edu.vub.at.exceptions.InterpreterException - if raised in the evaluation of the other boolean.

or:or:

Boolean or:or:(Closure b1,
               Closure b2)
Auxiliary function: def boolean.or: b1 or: b2 { (boolean.or: b1).or: b2 }


not

Boolean not()
Returns true if the receiver is false or false if the receiver is true.

Returns:
a boolean resulting of the negation of the receiver.