False.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Wed, 19 Aug 2009 17:14:36 +0100
branchjv
changeset 17728 bbc5fa73dfab
parent 17711 39faaaf888b4
child 17732 a1892eeca6c0
permissions -rw-r--r--
Merged with trunk r10466
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
     1
"
5
67342904af11 *** empty log message ***
claus
parents: 3
diff changeset
     2
 COPYRIGHT (c) 1988 by Claus Gittinger
379
5b5a130ccd09 revision added
claus
parents: 92
diff changeset
     3
	      All Rights Reserved
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
     4
a27a279701f8 Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
a27a279701f8 Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
a27a279701f8 Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
a27a279701f8 Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
a27a279701f8 Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
a27a279701f8 Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
a27a279701f8 Initial revision
claus
parents:
diff changeset
    11
"
6906
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
    12
"{ Package: 'stx:libbasic' }"
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
    13
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    14
Boolean subclass:#False
1238
a1b8da9895ad commentary
Claus Gittinger <cg@exept.de>
parents: 692
diff changeset
    15
	instanceVariableNames:''
a1b8da9895ad commentary
Claus Gittinger <cg@exept.de>
parents: 692
diff changeset
    16
	classVariableNames:''
a1b8da9895ad commentary
Claus Gittinger <cg@exept.de>
parents: 692
diff changeset
    17
	poolDictionaries:''
a1b8da9895ad commentary
Claus Gittinger <cg@exept.de>
parents: 692
diff changeset
    18
	category:'Kernel-Objects'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    19
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    20
88
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    21
!False class methodsFor:'documentation'!
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    22
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    23
copyright
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    24
"
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    25
 COPYRIGHT (c) 1988 by Claus Gittinger
379
5b5a130ccd09 revision added
claus
parents: 92
diff changeset
    26
	      All Rights Reserved
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    27
88
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    28
 This software is furnished under a license and may be used
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    29
 only in accordance with the terms of that license and with the
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    31
 be provided or otherwise made available to, or used by, any
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    32
 other person.  No title to or ownership of the software is
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    33
 hereby transferred.
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    34
"
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    35
!
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    36
88
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    37
documentation
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    38
"
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    39
    False has only one instance, false, representing logical falsehood.
1238
a1b8da9895ad commentary
Claus Gittinger <cg@exept.de>
parents: 692
diff changeset
    40
88
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    41
    Some methods are implemented here and in True, instead of the common
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    42
    superclass Boolean. This has the advantage, that no truth-value checks 
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    43
    are needed, but instead the thruth check is done in the method lookup.
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    44
    However, remember that some messages to booleans are inline coded in
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    45
    the compilers (both interpreted and machine code). Therefore redefinition
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    46
    of some methods here will not have any effect on compiled code.
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    47
    (redefining ifTrue: to something else will probably crash the smalltalk
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    48
     world anyway ...)
1294
e26bbb61f6b2 documentation
Claus Gittinger <cg@exept.de>
parents: 1238
diff changeset
    49
1303
8fdc2c653d13 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1294
diff changeset
    50
    [see also:]
8fdc2c653d13 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1294
diff changeset
    51
        True
8fdc2c653d13 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1294
diff changeset
    52
1294
e26bbb61f6b2 documentation
Claus Gittinger <cg@exept.de>
parents: 1238
diff changeset
    53
    [author:]
e26bbb61f6b2 documentation
Claus Gittinger <cg@exept.de>
parents: 1238
diff changeset
    54
        Claus Gittinger
574
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
    55
"
692
24ea6761b4a9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
    56
! !
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    57
11759
7772f14f36ae +asInteger
Claus Gittinger <cg@exept.de>
parents: 10817
diff changeset
    58
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    59
!False methodsFor:'conditional evaluation'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    60
a27a279701f8 Initial revision
claus
parents:
diff changeset
    61
and:aBlock
a27a279701f8 Initial revision
claus
parents:
diff changeset
    62
    "evaluate aBlock if the receiver is true.
a27a279701f8 Initial revision
claus
parents:
diff changeset
    63
     (since the receiver is false return false).
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
    64
     Notice:
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
    65
	This method is open coded (inlined) by the compiler(s)
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
    66
	- redefining it may not work as expected."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    67
a27a279701f8 Initial revision
claus
parents:
diff changeset
    68
    ^ self
a27a279701f8 Initial revision
claus
parents:
diff changeset
    69
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    70
17728
bbc5fa73dfab Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17711
diff changeset
    71
and:block1 and:block2
bbc5fa73dfab Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17711
diff changeset
    72
    "return false"
bbc5fa73dfab Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17711
diff changeset
    73
bbc5fa73dfab Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17711
diff changeset
    74
    ^ self
bbc5fa73dfab Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17711
diff changeset
    75
!
bbc5fa73dfab Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17711
diff changeset
    76
bbc5fa73dfab Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17711
diff changeset
    77
and:block1 and:block2 and:block3
bbc5fa73dfab Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17711
diff changeset
    78
    "return false"
bbc5fa73dfab Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17711
diff changeset
    79
bbc5fa73dfab Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17711
diff changeset
    80
    ^ self
bbc5fa73dfab Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17711
diff changeset
    81
!
bbc5fa73dfab Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17711
diff changeset
    82
bbc5fa73dfab Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17711
diff changeset
    83
and:block1 and:block2 and:block3 and:block4
bbc5fa73dfab Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17711
diff changeset
    84
    "return false"
bbc5fa73dfab Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17711
diff changeset
    85
bbc5fa73dfab Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17711
diff changeset
    86
    ^ self
bbc5fa73dfab Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17711
diff changeset
    87
!
bbc5fa73dfab Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17711
diff changeset
    88
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    89
ifFalse:aBlock
9225
5bf44f0ac937 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9000
diff changeset
    90
    "If the receiver is false, return the value of evaluating aBlock; nil otherwise.
5bf44f0ac937 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9000
diff changeset
    91
     Since the receiver is definitely false here, unconditionally return the blocks value.
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
    92
     Notice:
9225
5bf44f0ac937 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9000
diff changeset
    93
        This method is open coded (inlined) by the compiler(s)
5bf44f0ac937 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9000
diff changeset
    94
        - redefining it may not work as expected."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    95
a27a279701f8 Initial revision
claus
parents:
diff changeset
    96
    ^ aBlock value
a27a279701f8 Initial revision
claus
parents:
diff changeset
    97
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    98
574
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
    99
ifFalse:falseBlock ifTrue:trueBlock
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   100
    "return the value of evaluating falseBlock (since the receiver is false)
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   101
     Notice:
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   102
	This method is open coded (inlined) by the compiler(s)
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   103
	- redefining it may not work as expected."
574
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   104
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   105
    ^ falseBlock value
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   106
!
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   107
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   108
ifTrue:aBlock
9225
5bf44f0ac937 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9000
diff changeset
   109
    "If the receiver is true, return the value of evaluating aBlock; nil otherwise.
5bf44f0ac937 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9000
diff changeset
   110
     Since the receiver is definitely false here, unconditionally return nil value.
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   111
     Notice:
9225
5bf44f0ac937 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9000
diff changeset
   112
        This method is open coded (inlined) by the compiler(s)
5bf44f0ac937 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9000
diff changeset
   113
        - redefining it may not work as expected."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   114
a27a279701f8 Initial revision
claus
parents:
diff changeset
   115
    ^ nil
a27a279701f8 Initial revision
claus
parents:
diff changeset
   116
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   117
a27a279701f8 Initial revision
claus
parents:
diff changeset
   118
ifTrue:trueBlock ifFalse:falseBlock
a27a279701f8 Initial revision
claus
parents:
diff changeset
   119
    "return the value of evaluating falseBlock (since the receiver is false)
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   120
     Notice:
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   121
	This method is open coded (inlined) by the compiler(s)
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   122
	- redefining it may not work as expected."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   123
a27a279701f8 Initial revision
claus
parents:
diff changeset
   124
    ^ falseBlock value
a27a279701f8 Initial revision
claus
parents:
diff changeset
   125
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   126
574
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   127
or:aBlock
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   128
    "evaluate aBlock if the receiver is false.
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   129
     (since the receiver is false return the value of evaluating aBlock).
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   130
     Notice:
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   131
	This method is open coded (inlined) by the compiler(s)
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   132
	- redefining it may not work as expected."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   133
574
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   134
    ^ aBlock value
17728
bbc5fa73dfab Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17711
diff changeset
   135
!
bbc5fa73dfab Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17711
diff changeset
   136
bbc5fa73dfab Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17711
diff changeset
   137
or:block1 or:block2
bbc5fa73dfab Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17711
diff changeset
   138
    block1 value ifTrue:[^ true].
bbc5fa73dfab Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17711
diff changeset
   139
    ^ block2 value
bbc5fa73dfab Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17711
diff changeset
   140
!
bbc5fa73dfab Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17711
diff changeset
   141
bbc5fa73dfab Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17711
diff changeset
   142
or:block1 or:block2 or:block3
bbc5fa73dfab Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17711
diff changeset
   143
    block1 value ifTrue:[^ true].
bbc5fa73dfab Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17711
diff changeset
   144
    block2 value ifTrue:[^ true].
bbc5fa73dfab Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17711
diff changeset
   145
    ^ block3 value
bbc5fa73dfab Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17711
diff changeset
   146
!
bbc5fa73dfab Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17711
diff changeset
   147
bbc5fa73dfab Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17711
diff changeset
   148
or:block1 or:block2 or:block3 or:block4
bbc5fa73dfab Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17711
diff changeset
   149
    block1 value ifTrue:[^ true].
bbc5fa73dfab Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17711
diff changeset
   150
    block2 value ifTrue:[^ true].
bbc5fa73dfab Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17711
diff changeset
   151
    block3 value ifTrue:[^ true].
bbc5fa73dfab Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17711
diff changeset
   152
    ^ block4 value
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   153
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
   154
10817
f73fcb4b935b +asNumber
Claus Gittinger <cg@exept.de>
parents: 9662
diff changeset
   155
!False methodsFor:'converting'!
f73fcb4b935b +asNumber
Claus Gittinger <cg@exept.de>
parents: 9662
diff changeset
   156
11759
7772f14f36ae +asInteger
Claus Gittinger <cg@exept.de>
parents: 10817
diff changeset
   157
asInteger
7772f14f36ae +asInteger
Claus Gittinger <cg@exept.de>
parents: 10817
diff changeset
   158
    "false->0; true->1"
7772f14f36ae +asInteger
Claus Gittinger <cg@exept.de>
parents: 10817
diff changeset
   159
7772f14f36ae +asInteger
Claus Gittinger <cg@exept.de>
parents: 10817
diff changeset
   160
    ^ 0
7772f14f36ae +asInteger
Claus Gittinger <cg@exept.de>
parents: 10817
diff changeset
   161
!
7772f14f36ae +asInteger
Claus Gittinger <cg@exept.de>
parents: 10817
diff changeset
   162
10817
f73fcb4b935b +asNumber
Claus Gittinger <cg@exept.de>
parents: 9662
diff changeset
   163
asNumber
f73fcb4b935b +asNumber
Claus Gittinger <cg@exept.de>
parents: 9662
diff changeset
   164
    "false->0; true->1"
f73fcb4b935b +asNumber
Claus Gittinger <cg@exept.de>
parents: 9662
diff changeset
   165
f73fcb4b935b +asNumber
Claus Gittinger <cg@exept.de>
parents: 9662
diff changeset
   166
    ^ 0
f73fcb4b935b +asNumber
Claus Gittinger <cg@exept.de>
parents: 9662
diff changeset
   167
! !
f73fcb4b935b +asNumber
Claus Gittinger <cg@exept.de>
parents: 9662
diff changeset
   168
574
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   169
!False methodsFor:'logical operations'!
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   170
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   171
& aBoolean
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   172
    "return true, if both the receiver and the argument are true
6906
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   173
     (since the receiver is false, return false)
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   174
     Notice: 
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   175
         as this is a binary message, the argument is always evaluated. 
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   176
         It might be better to use and:[...], which does not evaluate
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   177
         the argument if the receiver is already false."
574
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   178
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   179
    ^ false
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   180
!
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   181
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   182
eqv:aBoolean
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   183
    "return true, if the receiver and the argument are the same truth value
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   184
     (since the receiver is false, return true if the argument is also false)"
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   185
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   186
    ^ aBoolean not
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   187
!
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   188
9000
74a49b889c33 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6906
diff changeset
   189
implies:aBoolean
74a49b889c33 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6906
diff changeset
   190
   "return true if receiver => argument"
74a49b889c33 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6906
diff changeset
   191
74a49b889c33 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6906
diff changeset
   192
    ^ true
74a49b889c33 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6906
diff changeset
   193
!
74a49b889c33 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6906
diff changeset
   194
574
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   195
not
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   196
    "return true, if the receiver is false, false otherwise
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   197
     (since the receiver is false, return true).
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   198
     Notice:
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   199
	This method is open coded (inlined) by the compiler(s)
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   200
	- redefining it may not work as expected."
574
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   201
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   202
    ^ true
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   203
!
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   204
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   205
xor:aBoolean
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   206
    "return true, if the receiver and the argument are different truth values
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   207
     (since the receiver is false, return true, if the armument is not false)"
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   208
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   209
    ^ aBoolean
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   210
!
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   211
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   212
| aBoolean
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   213
    "return true, if either the receiver or the argument is true
6906
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   214
     (since the receiver is false, return the argument).
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   215
     Notice: 
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   216
         as this is a binary message, the argument is always evaluated. 
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   217
         It might be better to use or:[...], which does not evaluate
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   218
         the argument if the receiver is already true."
574
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   219
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   220
    ^ aBoolean
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   221
! !
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   222
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   223
!False methodsFor:'printing & storing'!
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   224
a27a279701f8 Initial revision
claus
parents:
diff changeset
   225
printString
54
06dbdeeed4f9 *** empty log message ***
claus
parents: 38
diff changeset
   226
    "return character sequence representing the receiver"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   227
a27a279701f8 Initial revision
claus
parents:
diff changeset
   228
    ^ 'false'
a27a279701f8 Initial revision
claus
parents:
diff changeset
   229
! !
2
claus
parents: 1
diff changeset
   230
692
24ea6761b4a9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
   231
!False class methodsFor:'documentation'!
24ea6761b4a9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
   232
24ea6761b4a9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
   233
version
17728
bbc5fa73dfab Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17711
diff changeset
   234
    ^ '$Id: False.st 10467 2009-08-19 16:14:36Z vranyj1 $'
6906
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   235
! !