False.st
author Claus Gittinger <cg@exept.de>
Tue, 09 Jul 2019 20:55:17 +0200
changeset 24417 03b083548da2
parent 23890 0ba4e4feeae8
permissions -rw-r--r--
#REFACTORING by exept class: Smalltalk class changed: #recursiveInstallAutoloadedClassesFrom:rememberIn:maxLevels:noAutoload:packageTop:showSplashInLevels: Transcript showCR:(... bindWith:...) -> Transcript showCR:... with:...
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
22581
c912f81c6c5e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 22051
diff changeset
     1
"{ Encoding: utf8 }"
c912f81c6c5e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 22051
diff changeset
     2
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
     3
"
5
67342904af11 *** empty log message ***
claus
parents: 3
diff changeset
     4
 COPYRIGHT (c) 1988 by Claus Gittinger
379
5b5a130ccd09 revision added
claus
parents: 92
diff changeset
     5
	      All Rights Reserved
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
     6
a27a279701f8 Initial revision
claus
parents:
diff changeset
     7
 This software is furnished under a license and may be used
a27a279701f8 Initial revision
claus
parents:
diff changeset
     8
 only in accordance with the terms of that license and with the
a27a279701f8 Initial revision
claus
parents:
diff changeset
     9
 inclusion of the above copyright notice.   This software may not
a27a279701f8 Initial revision
claus
parents:
diff changeset
    10
 be provided or otherwise made available to, or used by, any
a27a279701f8 Initial revision
claus
parents:
diff changeset
    11
 other person.  No title to or ownership of the software is
a27a279701f8 Initial revision
claus
parents:
diff changeset
    12
 hereby transferred.
a27a279701f8 Initial revision
claus
parents:
diff changeset
    13
"
6906
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
    14
"{ Package: 'stx:libbasic' }"
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
    15
19112
mawalch
parents: 11917
diff changeset
    16
"{ NameSpace: Smalltalk }"
mawalch
parents: 11917
diff changeset
    17
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    18
Boolean subclass:#False
1238
a1b8da9895ad commentary
Claus Gittinger <cg@exept.de>
parents: 692
diff changeset
    19
	instanceVariableNames:''
a1b8da9895ad commentary
Claus Gittinger <cg@exept.de>
parents: 692
diff changeset
    20
	classVariableNames:''
a1b8da9895ad commentary
Claus Gittinger <cg@exept.de>
parents: 692
diff changeset
    21
	poolDictionaries:''
a1b8da9895ad commentary
Claus Gittinger <cg@exept.de>
parents: 692
diff changeset
    22
	category:'Kernel-Objects'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    23
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    24
88
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    25
!False class methodsFor:'documentation'!
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    26
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    27
copyright
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    28
"
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    29
 COPYRIGHT (c) 1988 by Claus Gittinger
379
5b5a130ccd09 revision added
claus
parents: 92
diff changeset
    30
	      All Rights Reserved
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    31
88
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    32
 This software is furnished under a license and may be used
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    33
 only in accordance with the terms of that license and with the
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    35
 be provided or otherwise made available to, or used by, any
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    36
 other person.  No title to or ownership of the software is
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    37
 hereby transferred.
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    38
"
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    39
!
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    40
88
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    41
documentation
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    42
"
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    43
    False has only one instance, false, representing logical falsehood.
1238
a1b8da9895ad commentary
Claus Gittinger <cg@exept.de>
parents: 692
diff changeset
    44
88
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    45
    Some methods are implemented here and in True, instead of the common
20195
fac36b1a37bf #OTHER by mawalch
mawalch
parents: 19112
diff changeset
    46
    superclass Boolean. This has the advantage that no truth-value checks
fac36b1a37bf #OTHER by mawalch
mawalch
parents: 19112
diff changeset
    47
    are needed, but instead the truth check is done in the method lookup.
88
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    48
    However, remember that some messages to booleans are inline coded in
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    49
    the compilers (both interpreted and machine code). Therefore redefinition
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    50
    of some methods here will not have any effect on compiled code.
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    51
    (redefining ifTrue: to something else will probably crash the smalltalk
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    52
     world anyway ...)
1294
e26bbb61f6b2 documentation
Claus Gittinger <cg@exept.de>
parents: 1238
diff changeset
    53
1303
8fdc2c653d13 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1294
diff changeset
    54
    [see also:]
8fdc2c653d13 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1294
diff changeset
    55
        True
8fdc2c653d13 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1294
diff changeset
    56
1294
e26bbb61f6b2 documentation
Claus Gittinger <cg@exept.de>
parents: 1238
diff changeset
    57
    [author:]
e26bbb61f6b2 documentation
Claus Gittinger <cg@exept.de>
parents: 1238
diff changeset
    58
        Claus Gittinger
574
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
    59
"
692
24ea6761b4a9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
    60
! !
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    61
11759
7772f14f36ae +asInteger
Claus Gittinger <cg@exept.de>
parents: 10817
diff changeset
    62
19112
mawalch
parents: 11917
diff changeset
    63
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    64
!False methodsFor:'conditional evaluation'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    65
a27a279701f8 Initial revision
claus
parents:
diff changeset
    66
and:aBlock
a27a279701f8 Initial revision
claus
parents:
diff changeset
    67
    "evaluate aBlock if the receiver is true.
11917
de1675e8ba46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11825
diff changeset
    68
     (since the receiver is known to be false here, always return false here).
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
    69
     Notice:
11917
de1675e8ba46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11825
diff changeset
    70
        This method is open coded (inlined) by the compiler(s)
de1675e8ba46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11825
diff changeset
    71
        - redefining it may not work as expected."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    72
a27a279701f8 Initial revision
claus
parents:
diff changeset
    73
    ^ self
a27a279701f8 Initial revision
claus
parents:
diff changeset
    74
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    75
11818
fc605f85aaf7 changed #and:and:
Claus Gittinger <cg@exept.de>
parents: 11759
diff changeset
    76
and:block1 and:block2
11917
de1675e8ba46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11825
diff changeset
    77
    "evaluate block1 if the receiver is true; if that also returns true, evaluate block2.
de1675e8ba46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11825
diff changeset
    78
     (since the receiver is known to be false here, always return false here).
de1675e8ba46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11825
diff changeset
    79
     Notice:
de1675e8ba46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11825
diff changeset
    80
        This method is open coded (inlined) by the compiler(s)
de1675e8ba46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11825
diff changeset
    81
        - redefining it may not work as expected."
11825
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
    82
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
    83
    ^ self
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
    84
!
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
    85
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
    86
and:block1 and:block2 and:block3
22674
d0d8880e6081 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22581
diff changeset
    87
    "evaluate block1 if the receiver is true; 
d0d8880e6081 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22581
diff changeset
    88
     if that also returns true, evaluate block2;
d0d8880e6081 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22581
diff changeset
    89
     if that also returns true, evaluate block3.
d0d8880e6081 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22581
diff changeset
    90
     (since the receiver is known to be false here, always return false here).
d0d8880e6081 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22581
diff changeset
    91
     Notice:
d0d8880e6081 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22581
diff changeset
    92
        This method may be open coded (inlined) by the compiler(s)
d0d8880e6081 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22581
diff changeset
    93
        - redefining it may not work as expected."
11825
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
    94
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
    95
    ^ self
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
    96
!
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
    97
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
    98
and:block1 and:block2 and:block3 and:block4
22674
d0d8880e6081 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22581
diff changeset
    99
    "evaluate block1 if the receiver is true; 
d0d8880e6081 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22581
diff changeset
   100
     if that also returns true, evaluate block2;
d0d8880e6081 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22581
diff changeset
   101
     if that also returns true, evaluate block3.
d0d8880e6081 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22581
diff changeset
   102
     if that also returns true, evaluate block4.
d0d8880e6081 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22581
diff changeset
   103
     (since the receiver is known to be false here, always return false here).
d0d8880e6081 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22581
diff changeset
   104
     Notice:
d0d8880e6081 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22581
diff changeset
   105
        This method may be open coded (inlined) by the compiler(s)
d0d8880e6081 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22581
diff changeset
   106
        - redefining it may not work as expected."
11825
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
   107
11818
fc605f85aaf7 changed #and:and:
Claus Gittinger <cg@exept.de>
parents: 11759
diff changeset
   108
    ^ self
fc605f85aaf7 changed #and:and:
Claus Gittinger <cg@exept.de>
parents: 11759
diff changeset
   109
!
fc605f85aaf7 changed #and:and:
Claus Gittinger <cg@exept.de>
parents: 11759
diff changeset
   110
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   111
ifFalse:aBlock
9225
5bf44f0ac937 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9000
diff changeset
   112
    "If the receiver is false, return the value of evaluating aBlock; nil otherwise.
23890
0ba4e4feeae8 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22674
diff changeset
   113
     Since the receiver is definitely false here, unconditionally return the block's value.
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   114
     Notice:
9225
5bf44f0ac937 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9000
diff changeset
   115
        This method is open coded (inlined) by the compiler(s)
5bf44f0ac937 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9000
diff changeset
   116
        - redefining it may not work as expected."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   117
a27a279701f8 Initial revision
claus
parents:
diff changeset
   118
    ^ aBlock value
23890
0ba4e4feeae8 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22674
diff changeset
   119
0ba4e4feeae8 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22674
diff changeset
   120
    "Modified (comment): / 13-03-2019 / 10:23:10 / Claus Gittinger"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   121
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   122
574
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   123
ifFalse:falseBlock ifTrue:trueBlock
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   124
    "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
   125
     Notice:
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   126
	This method is open coded (inlined) by the compiler(s)
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   127
	- redefining it may not work as expected."
574
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   128
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   129
    ^ falseBlock value
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   130
!
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   131
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   132
ifTrue:aBlock
9225
5bf44f0ac937 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9000
diff changeset
   133
    "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
   134
     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
   135
     Notice:
9225
5bf44f0ac937 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9000
diff changeset
   136
        This method is open coded (inlined) by the compiler(s)
5bf44f0ac937 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9000
diff changeset
   137
        - redefining it may not work as expected."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   138
a27a279701f8 Initial revision
claus
parents:
diff changeset
   139
    ^ nil
a27a279701f8 Initial revision
claus
parents:
diff changeset
   140
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   141
a27a279701f8 Initial revision
claus
parents:
diff changeset
   142
ifTrue:trueBlock ifFalse:falseBlock
a27a279701f8 Initial revision
claus
parents:
diff changeset
   143
    "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
   144
     Notice:
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   145
	This method is open coded (inlined) by the compiler(s)
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   146
	- redefining it may not work as expected."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   147
a27a279701f8 Initial revision
claus
parents:
diff changeset
   148
    ^ falseBlock value
a27a279701f8 Initial revision
claus
parents:
diff changeset
   149
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   150
574
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   151
or:aBlock
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   152
    "evaluate aBlock if the receiver is false.
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   153
     (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
   154
     Notice:
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   155
	This method is open coded (inlined) by the compiler(s)
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   156
	- redefining it may not work as expected."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   157
574
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   158
    ^ aBlock value
11825
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
   159
!
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
   160
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
   161
or:block1 or:block2
22674
d0d8880e6081 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22581
diff changeset
   162
    "evaluate block1 if the receiver is false.
d0d8880e6081 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22581
diff changeset
   163
     if that evaluates to false, return the result from block2.
d0d8880e6081 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22581
diff changeset
   164
     (since the receiver is false return the value of evaluating aBlock).
d0d8880e6081 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22581
diff changeset
   165
     Notice:
d0d8880e6081 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22581
diff changeset
   166
        This method may be open coded (inlined) by the compiler(s)
d0d8880e6081 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22581
diff changeset
   167
        - redefining it may not work as expected."
d0d8880e6081 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22581
diff changeset
   168
11825
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
   169
    block1 value ifTrue:[^ true].
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
   170
    ^ block2 value
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
   171
!
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
   172
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
   173
or:block1 or:block2 or:block3
22674
d0d8880e6081 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22581
diff changeset
   174
    "evaluate block1 if the receiver is false.
d0d8880e6081 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22581
diff changeset
   175
     if that evaluates to false, return the result from block2.
d0d8880e6081 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22581
diff changeset
   176
     if that evaluates to false, return the result from block3.
d0d8880e6081 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22581
diff changeset
   177
     (since the receiver is false return the value of evaluating aBlock).
d0d8880e6081 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22581
diff changeset
   178
     Notice:
d0d8880e6081 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22581
diff changeset
   179
        This method may be open coded (inlined) by the compiler(s)
d0d8880e6081 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22581
diff changeset
   180
        - redefining it may not work as expected."
d0d8880e6081 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22581
diff changeset
   181
11825
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
   182
    block1 value ifTrue:[^ true].
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
   183
    block2 value ifTrue:[^ true].
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
   184
    ^ block3 value
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
   185
!
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
   186
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
   187
or:block1 or:block2 or:block3 or:block4
22674
d0d8880e6081 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22581
diff changeset
   188
    "evaluate block1 if the receiver is false.
d0d8880e6081 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22581
diff changeset
   189
     if that evaluates to false, return the result from block2.
d0d8880e6081 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22581
diff changeset
   190
     if that evaluates to false, return the result from block3.
d0d8880e6081 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22581
diff changeset
   191
     if that evaluates to false, return the result from block4.
d0d8880e6081 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22581
diff changeset
   192
     (since the receiver is false return the value of evaluating aBlock).
d0d8880e6081 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22581
diff changeset
   193
     Notice:
d0d8880e6081 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22581
diff changeset
   194
        This method may be open coded (inlined) by the compiler(s)
d0d8880e6081 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22581
diff changeset
   195
        - redefining it may not work as expected."
d0d8880e6081 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22581
diff changeset
   196
11825
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
   197
    block1 value ifTrue:[^ true].
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
   198
    block2 value ifTrue:[^ true].
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
   199
    block3 value ifTrue:[^ true].
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
   200
    ^ block4 value
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   201
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
   202
10817
f73fcb4b935b +asNumber
Claus Gittinger <cg@exept.de>
parents: 9662
diff changeset
   203
!False methodsFor:'converting'!
f73fcb4b935b +asNumber
Claus Gittinger <cg@exept.de>
parents: 9662
diff changeset
   204
11759
7772f14f36ae +asInteger
Claus Gittinger <cg@exept.de>
parents: 10817
diff changeset
   205
asInteger
7772f14f36ae +asInteger
Claus Gittinger <cg@exept.de>
parents: 10817
diff changeset
   206
    "false->0; true->1"
7772f14f36ae +asInteger
Claus Gittinger <cg@exept.de>
parents: 10817
diff changeset
   207
7772f14f36ae +asInteger
Claus Gittinger <cg@exept.de>
parents: 10817
diff changeset
   208
    ^ 0
7772f14f36ae +asInteger
Claus Gittinger <cg@exept.de>
parents: 10817
diff changeset
   209
!
7772f14f36ae +asInteger
Claus Gittinger <cg@exept.de>
parents: 10817
diff changeset
   210
10817
f73fcb4b935b +asNumber
Claus Gittinger <cg@exept.de>
parents: 9662
diff changeset
   211
asNumber
f73fcb4b935b +asNumber
Claus Gittinger <cg@exept.de>
parents: 9662
diff changeset
   212
    "false->0; true->1"
f73fcb4b935b +asNumber
Claus Gittinger <cg@exept.de>
parents: 9662
diff changeset
   213
f73fcb4b935b +asNumber
Claus Gittinger <cg@exept.de>
parents: 9662
diff changeset
   214
    ^ 0
f73fcb4b935b +asNumber
Claus Gittinger <cg@exept.de>
parents: 9662
diff changeset
   215
! !
f73fcb4b935b +asNumber
Claus Gittinger <cg@exept.de>
parents: 9662
diff changeset
   216
22051
bd0a85c34562 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20195
diff changeset
   217
!False methodsFor:'debugging'!
bd0a85c34562 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20195
diff changeset
   218
bd0a85c34562 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20195
diff changeset
   219
haltIfFalse
bd0a85c34562 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20195
diff changeset
   220
    "halt if the receiver is true"
bd0a85c34562 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20195
diff changeset
   221
bd0a85c34562 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20195
diff changeset
   222
    <resource: #skipInDebuggersWalkBack>
bd0a85c34562 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20195
diff changeset
   223
bd0a85c34562 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20195
diff changeset
   224
    self halt
bd0a85c34562 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20195
diff changeset
   225
bd0a85c34562 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20195
diff changeset
   226
    "
bd0a85c34562 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20195
diff changeset
   227
     3 haltIfNil
bd0a85c34562 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20195
diff changeset
   228
     nil haltIfNil
bd0a85c34562 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20195
diff changeset
   229
bd0a85c34562 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20195
diff changeset
   230
     true haltIfTrue
bd0a85c34562 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20195
diff changeset
   231
     true haltIfFalse
bd0a85c34562 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20195
diff changeset
   232
bd0a85c34562 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20195
diff changeset
   233
     false haltIfTrue
bd0a85c34562 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20195
diff changeset
   234
     false haltIfFalse
bd0a85c34562 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20195
diff changeset
   235
    "
bd0a85c34562 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20195
diff changeset
   236
bd0a85c34562 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20195
diff changeset
   237
    "Created: / 17-07-2017 / 17:44:26 / cg"
bd0a85c34562 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20195
diff changeset
   238
!
bd0a85c34562 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20195
diff changeset
   239
bd0a85c34562 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20195
diff changeset
   240
haltIfTrue
bd0a85c34562 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20195
diff changeset
   241
    "halt if the receiver is true"
bd0a85c34562 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20195
diff changeset
   242
bd0a85c34562 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20195
diff changeset
   243
    <resource: #skipInDebuggersWalkBack>
bd0a85c34562 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20195
diff changeset
   244
bd0a85c34562 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20195
diff changeset
   245
    ^ self
bd0a85c34562 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20195
diff changeset
   246
bd0a85c34562 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20195
diff changeset
   247
    "
bd0a85c34562 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20195
diff changeset
   248
     3 haltIfNil
bd0a85c34562 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20195
diff changeset
   249
     nil haltIfNil
bd0a85c34562 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20195
diff changeset
   250
    "
bd0a85c34562 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20195
diff changeset
   251
bd0a85c34562 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20195
diff changeset
   252
    "Created: / 17-07-2017 / 17:43:01 / cg"
bd0a85c34562 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20195
diff changeset
   253
! !
bd0a85c34562 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20195
diff changeset
   254
23890
0ba4e4feeae8 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22674
diff changeset
   255
574
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   256
!False methodsFor:'logical operations'!
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   257
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   258
& aBoolean
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   259
    "return true, if both the receiver and the argument are true
6906
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   260
     (since the receiver is false, return false)
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   261
     Notice: 
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   262
         as this is a binary message, the argument is always evaluated. 
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   263
         It might be better to use and:[...], which does not evaluate
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   264
         the argument if the receiver is already false."
574
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   265
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   266
    ^ false
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   267
!
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   268
22581
c912f81c6c5e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 22051
diff changeset
   269
==> aBoolean
c912f81c6c5e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 22051
diff changeset
   270
   "same as implies:
c912f81c6c5e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 22051
diff changeset
   271
    return true if receiver => argument"
c912f81c6c5e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 22051
diff changeset
   272
c912f81c6c5e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 22051
diff changeset
   273
    ^ true
c912f81c6c5e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 22051
diff changeset
   274
!
c912f81c6c5e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 22051
diff changeset
   275
574
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   276
eqv:aBoolean
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   277
    "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
   278
     (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
   279
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   280
    ^ aBoolean not
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   281
!
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   282
9000
74a49b889c33 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6906
diff changeset
   283
implies:aBoolean
74a49b889c33 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6906
diff changeset
   284
   "return true if receiver => argument"
74a49b889c33 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6906
diff changeset
   285
74a49b889c33 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6906
diff changeset
   286
    ^ true
74a49b889c33 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6906
diff changeset
   287
!
74a49b889c33 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6906
diff changeset
   288
574
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   289
not
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   290
    "return true, if the receiver is false, false otherwise
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   291
     (since the receiver is false, return true).
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   292
     Notice:
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   293
	This method is open coded (inlined) by the compiler(s)
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   294
	- redefining it may not work as expected."
574
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   295
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   296
    ^ true
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   297
!
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   298
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   299
xor:aBoolean
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   300
    "return true, if the receiver and the argument are different truth values
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   301
     (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
   302
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   303
    ^ aBoolean
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   304
!
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   305
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   306
| aBoolean
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   307
    "return true, if either the receiver or the argument is true
6906
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   308
     (since the receiver is false, return the argument).
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   309
     Notice: 
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   310
         as this is a binary message, the argument is always evaluated. 
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   311
         It might be better to use or:[...], which does not evaluate
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   312
         the argument if the receiver is already true."
574
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   313
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   314
    ^ aBoolean
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   315
! !
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   316
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   317
!False methodsFor:'printing & storing'!
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   318
a27a279701f8 Initial revision
claus
parents:
diff changeset
   319
printString
54
06dbdeeed4f9 *** empty log message ***
claus
parents: 38
diff changeset
   320
    "return character sequence representing the receiver"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   321
a27a279701f8 Initial revision
claus
parents:
diff changeset
   322
    ^ 'false'
a27a279701f8 Initial revision
claus
parents:
diff changeset
   323
! !
2
claus
parents: 1
diff changeset
   324
692
24ea6761b4a9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
   325
!False class methodsFor:'documentation'!
24ea6761b4a9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
   326
24ea6761b4a9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
   327
version
19112
mawalch
parents: 11917
diff changeset
   328
    ^ '$Header$'
6906
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   329
! !
19112
mawalch
parents: 11917
diff changeset
   330