False.st
author claus
Mon, 04 Oct 1993 11:32:33 +0100
changeset 2 6526dde5f3ac
parent 1 a27a279701f8
child 3 24d81bf47225
permissions -rw-r--r--
2.7.2

"
 COPYRIGHT (c) 1988-92 by Claus Gittinger
	      All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"

Boolean subclass:#False
       instanceVariableNames:''
       classVariableNames:''
       poolDictionaries:''
       category:'Kernel-Objects'
!

False comment:'

COPYRIGHT (c) 1988-92 by Claus Gittinger
	      All Rights Reserved

Class False has only one instance, false, representing logical falsehood.

%W% %E%
'!

!False methodsFor:'logical operations'!

& aBoolean
    "return true, if both the receiver and the argument are true
     (since the receiver is false, return false)"

    ^ false
!

| aBoolean
    "return true, if either the receiver or the argument is true
     (since the receiver is false, return the argument)"

    ^ aBoolean
!

not
    "return true, if the receiver is false, false otherwise
     (since the receiver is false, return true)"

    ^ true
!

eqv:aBoolean
    "return true, if the receiver and the argument are the same truth value
     (since the receiver is false, return true if the argument is also false)"

    ^ aBoolean not
!

xor:aBoolean
    "return true, if the receiver and the argument are different truth values
     (since the receiver is false, return true, if the armument is not false)"

    ^ aBoolean
! !

!False methodsFor:'conditional evaluation'!

and:aBlock
    "evaluate aBlock if the receiver is true.
     (since the receiver is false return false).
     - open coded by compiler"

    ^ self
!

or:aBlock
    "evaluate aBlock if the receiver is false.
     (since the receiver is false return the value of evaluating aBlock).
     - open coded by compiler"

    ^ aBlock value
!

ifFalse:aBlock
    "return the value of evaluating aBlock if the receiver is false.
     (since the receiver is known to be false always evaluate)
     - open coded by compiler"

    ^ aBlock value
!

ifTrue:aBlock
    "return the false alternative, nil (since the receiver is false)
     - open coded by compiler"

    ^ nil
!

ifTrue:trueBlock ifFalse:falseBlock
    "return the value of evaluating falseBlock (since the receiver is false)
     - open coded by compiler"

    ^ falseBlock value
!

ifFalse:falseBlock ifTrue:trueBlock
    "return the value of evaluating falseBlock (since the receiver is false)
     - open coded by compiler"

    ^ falseBlock value
! !

!False methodsFor: 'printing'!

printString
    "return a Character sequence representing the receiver"

    ^ 'false'
! !

!False methodsFor: 'binary storage'!

storeBinaryOn: stream manager: manager
    stream nextPut: manager codeForFalse
! !