False.st
author Stefan Vogel <sv@exept.de>
Mon, 22 Jun 2015 11:24:02 +0200
changeset 18494 41f8a86105f0
parent 11917 de1675e8ba46
child 18011 deb0c3355881
child 19112 87d8aec7ec48
permissions -rw-r--r--
class: UnixOperatingSystem changed: #syncFileSystem: disable - defined only in glibc 2.14, but we need to support glibc 2.12
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.
11917
de1675e8ba46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11825
diff changeset
    63
     (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
    64
     Notice:
11917
de1675e8ba46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11825
diff changeset
    65
        This method is open coded (inlined) by the compiler(s)
de1675e8ba46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11825
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
11818
fc605f85aaf7 changed #and:and:
Claus Gittinger <cg@exept.de>
parents: 11759
diff changeset
    71
and:block1 and:block2
11917
de1675e8ba46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11825
diff changeset
    72
    "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
    73
     (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
    74
     Notice:
de1675e8ba46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11825
diff changeset
    75
        This method is open coded (inlined) by the compiler(s)
de1675e8ba46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11825
diff changeset
    76
        - redefining it may not work as expected."
11825
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
    77
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
    78
    ^ self
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
    79
!
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
    80
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
    81
and:block1 and:block2 and:block3
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
    82
    "return false"
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
    83
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
    84
    ^ self
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
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
    87
and:block1 and:block2 and:block3 and:block4
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
    88
    "return false"
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
    89
11818
fc605f85aaf7 changed #and:and:
Claus Gittinger <cg@exept.de>
parents: 11759
diff changeset
    90
    ^ self
fc605f85aaf7 changed #and:and:
Claus Gittinger <cg@exept.de>
parents: 11759
diff changeset
    91
!
fc605f85aaf7 changed #and:and:
Claus Gittinger <cg@exept.de>
parents: 11759
diff changeset
    92
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    93
ifFalse:aBlock
9225
5bf44f0ac937 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9000
diff changeset
    94
    "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
    95
     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
    96
     Notice:
9225
5bf44f0ac937 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9000
diff changeset
    97
        This method is open coded (inlined) by the compiler(s)
5bf44f0ac937 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9000
diff changeset
    98
        - redefining it may not work as expected."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    99
a27a279701f8 Initial revision
claus
parents:
diff changeset
   100
    ^ aBlock value
a27a279701f8 Initial revision
claus
parents:
diff changeset
   101
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   102
574
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   103
ifFalse:falseBlock ifTrue:trueBlock
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   104
    "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
   105
     Notice:
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   106
	This method is open coded (inlined) by the compiler(s)
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   107
	- redefining it may not work as expected."
574
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   108
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   109
    ^ falseBlock value
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   110
!
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   111
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   112
ifTrue:aBlock
9225
5bf44f0ac937 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9000
diff changeset
   113
    "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
   114
     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
   115
     Notice:
9225
5bf44f0ac937 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9000
diff changeset
   116
        This method is open coded (inlined) by the compiler(s)
5bf44f0ac937 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9000
diff changeset
   117
        - redefining it may not work as expected."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   118
a27a279701f8 Initial revision
claus
parents:
diff changeset
   119
    ^ nil
a27a279701f8 Initial revision
claus
parents:
diff changeset
   120
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   121
a27a279701f8 Initial revision
claus
parents:
diff changeset
   122
ifTrue:trueBlock ifFalse:falseBlock
a27a279701f8 Initial revision
claus
parents:
diff changeset
   123
    "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
   124
     Notice:
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   125
	This method is open coded (inlined) by the compiler(s)
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   126
	- redefining it may not work as expected."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   127
a27a279701f8 Initial revision
claus
parents:
diff changeset
   128
    ^ falseBlock value
a27a279701f8 Initial revision
claus
parents:
diff changeset
   129
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   130
574
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   131
or:aBlock
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   132
    "evaluate aBlock if the receiver is false.
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   133
     (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
   134
     Notice:
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   135
	This method is open coded (inlined) by the compiler(s)
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   136
	- redefining it may not work as expected."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   137
574
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   138
    ^ aBlock value
11825
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
   139
!
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
   140
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
   141
or:block1 or:block2
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
   142
    block1 value ifTrue:[^ true].
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
   143
    ^ block2 value
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
   144
!
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
   145
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
   146
or:block1 or:block2 or:block3
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
   147
    block1 value ifTrue:[^ true].
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
   148
    block2 value ifTrue:[^ true].
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
   149
    ^ block3 value
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
   150
!
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
   151
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
   152
or:block1 or:block2 or:block3 or:block4
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
   153
    block1 value ifTrue:[^ true].
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
   154
    block2 value ifTrue:[^ true].
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
   155
    block3 value ifTrue:[^ true].
c93f1263c53d +and:and...
Claus Gittinger <cg@exept.de>
parents: 11818
diff changeset
   156
    ^ block4 value
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   157
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
   158
10817
f73fcb4b935b +asNumber
Claus Gittinger <cg@exept.de>
parents: 9662
diff changeset
   159
!False methodsFor:'converting'!
f73fcb4b935b +asNumber
Claus Gittinger <cg@exept.de>
parents: 9662
diff changeset
   160
11759
7772f14f36ae +asInteger
Claus Gittinger <cg@exept.de>
parents: 10817
diff changeset
   161
asInteger
7772f14f36ae +asInteger
Claus Gittinger <cg@exept.de>
parents: 10817
diff changeset
   162
    "false->0; true->1"
7772f14f36ae +asInteger
Claus Gittinger <cg@exept.de>
parents: 10817
diff changeset
   163
7772f14f36ae +asInteger
Claus Gittinger <cg@exept.de>
parents: 10817
diff changeset
   164
    ^ 0
7772f14f36ae +asInteger
Claus Gittinger <cg@exept.de>
parents: 10817
diff changeset
   165
!
7772f14f36ae +asInteger
Claus Gittinger <cg@exept.de>
parents: 10817
diff changeset
   166
10817
f73fcb4b935b +asNumber
Claus Gittinger <cg@exept.de>
parents: 9662
diff changeset
   167
asNumber
f73fcb4b935b +asNumber
Claus Gittinger <cg@exept.de>
parents: 9662
diff changeset
   168
    "false->0; true->1"
f73fcb4b935b +asNumber
Claus Gittinger <cg@exept.de>
parents: 9662
diff changeset
   169
f73fcb4b935b +asNumber
Claus Gittinger <cg@exept.de>
parents: 9662
diff changeset
   170
    ^ 0
f73fcb4b935b +asNumber
Claus Gittinger <cg@exept.de>
parents: 9662
diff changeset
   171
! !
f73fcb4b935b +asNumber
Claus Gittinger <cg@exept.de>
parents: 9662
diff changeset
   172
574
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   173
!False methodsFor:'logical operations'!
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   174
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   175
& aBoolean
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   176
    "return true, if both the receiver and the argument are true
6906
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   177
     (since the receiver is false, return false)
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   178
     Notice: 
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   179
         as this is a binary message, the argument is always evaluated. 
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   180
         It might be better to use and:[...], which does not evaluate
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   181
         the argument if the receiver is already false."
574
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   182
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   183
    ^ false
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   184
!
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
eqv:aBoolean
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   187
    "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
   188
     (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
   189
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   190
    ^ aBoolean not
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   191
!
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   192
9000
74a49b889c33 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6906
diff changeset
   193
implies:aBoolean
74a49b889c33 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6906
diff changeset
   194
   "return true if receiver => argument"
74a49b889c33 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6906
diff changeset
   195
74a49b889c33 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6906
diff changeset
   196
    ^ true
74a49b889c33 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6906
diff changeset
   197
!
74a49b889c33 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6906
diff changeset
   198
574
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   199
not
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   200
    "return true, if the receiver is false, false otherwise
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   201
     (since the receiver is false, return true).
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   202
     Notice:
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   203
	This method is open coded (inlined) by the compiler(s)
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   204
	- redefining it may not work as expected."
574
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   205
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   206
    ^ true
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   207
!
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
xor:aBoolean
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   210
    "return true, if the receiver and the argument are different truth values
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   211
     (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
   212
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   213
    ^ aBoolean
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   214
!
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   215
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   216
| aBoolean
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   217
    "return true, if either the receiver or the argument is true
6906
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   218
     (since the receiver is false, return the argument).
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   219
     Notice: 
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   220
         as this is a binary message, the argument is always evaluated. 
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   221
         It might be better to use or:[...], which does not evaluate
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   222
         the argument if the receiver is already true."
574
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   223
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   224
    ^ aBoolean
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   225
! !
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   226
5e7cbb66d6c7 testing cvs
Claus Gittinger <cg@exept.de>
parents: 573
diff changeset
   227
!False methodsFor:'printing & storing'!
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   228
a27a279701f8 Initial revision
claus
parents:
diff changeset
   229
printString
54
06dbdeeed4f9 *** empty log message ***
claus
parents: 38
diff changeset
   230
    "return character sequence representing the receiver"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   231
a27a279701f8 Initial revision
claus
parents:
diff changeset
   232
    ^ 'false'
a27a279701f8 Initial revision
claus
parents:
diff changeset
   233
! !
2
claus
parents: 1
diff changeset
   234
692
24ea6761b4a9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
   235
!False class methodsFor:'documentation'!
24ea6761b4a9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
   236
24ea6761b4a9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
   237
version
11917
de1675e8ba46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11825
diff changeset
   238
    ^ '$Header: /cvs/stx/stx/libbasic/False.st,v 1.28 2009-09-14 12:49:49 cg Exp $'
6906
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   239
! !