True.st
author Stefan Vogel <sv@exept.de>
Fri, 27 Oct 2017 16:14:37 +0200
branchexpecco_2_11_1_branch
changeset 22329 20662662693b
parent 20196 f2ce74d623d1
child 20206 51652e7f46dd
child 22052 1f0b557bdb3f
permissions -rw-r--r--
Add 2.11.0 Patch
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
384
claus
parents: 378
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
19705
af1b4569a96a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 13598
diff changeset
    14
"{ NameSpace: Smalltalk }"
af1b4569a96a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 13598
diff changeset
    15
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    16
Boolean subclass:#True
1238
a1b8da9895ad commentary
Claus Gittinger <cg@exept.de>
parents: 694
diff changeset
    17
	instanceVariableNames:''
a1b8da9895ad commentary
Claus Gittinger <cg@exept.de>
parents: 694
diff changeset
    18
	classVariableNames:''
a1b8da9895ad commentary
Claus Gittinger <cg@exept.de>
parents: 694
diff changeset
    19
	poolDictionaries:''
a1b8da9895ad commentary
Claus Gittinger <cg@exept.de>
parents: 694
diff changeset
    20
	category:'Kernel-Objects'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    21
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    22
88
81dacba7a63a *** empty log message ***
claus
parents: 65
diff changeset
    23
!True class methodsFor:'documentation'!
81dacba7a63a *** empty log message ***
claus
parents: 65
diff changeset
    24
81dacba7a63a *** empty log message ***
claus
parents: 65
diff changeset
    25
copyright
81dacba7a63a *** empty log message ***
claus
parents: 65
diff changeset
    26
"
81dacba7a63a *** empty log message ***
claus
parents: 65
diff changeset
    27
 COPYRIGHT (c) 1988 by Claus Gittinger
384
claus
parents: 378
diff changeset
    28
	      All Rights Reserved
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    29
88
81dacba7a63a *** empty log message ***
claus
parents: 65
diff changeset
    30
 This software is furnished under a license and may be used
81dacba7a63a *** empty log message ***
claus
parents: 65
diff changeset
    31
 only in accordance with the terms of that license and with the
81dacba7a63a *** empty log message ***
claus
parents: 65
diff changeset
    32
 inclusion of the above copyright notice.   This software may not
81dacba7a63a *** empty log message ***
claus
parents: 65
diff changeset
    33
 be provided or otherwise made available to, or used by, any
81dacba7a63a *** empty log message ***
claus
parents: 65
diff changeset
    34
 other person.  No title to or ownership of the software is
81dacba7a63a *** empty log message ***
claus
parents: 65
diff changeset
    35
 hereby transferred.
81dacba7a63a *** empty log message ***
claus
parents: 65
diff changeset
    36
"
81dacba7a63a *** empty log message ***
claus
parents: 65
diff changeset
    37
!
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    38
88
81dacba7a63a *** empty log message ***
claus
parents: 65
diff changeset
    39
documentation
81dacba7a63a *** empty log message ***
claus
parents: 65
diff changeset
    40
"
81dacba7a63a *** empty log message ***
claus
parents: 65
diff changeset
    41
    True has only one instance, true, representing logical truth.
1238
a1b8da9895ad commentary
Claus Gittinger <cg@exept.de>
parents: 694
diff changeset
    42
88
81dacba7a63a *** empty log message ***
claus
parents: 65
diff changeset
    43
    Some methods are implemented here and in False, instead of the common
20196
f2ce74d623d1 #OTHER by mawalch
mawalch
parents: 19705
diff changeset
    44
    superclass Boolean. This has the advantage that no truth-value checks
f2ce74d623d1 #OTHER by mawalch
mawalch
parents: 19705
diff changeset
    45
    are needed, but instead the truth check is done in the method lookup.
88
81dacba7a63a *** empty log message ***
claus
parents: 65
diff changeset
    46
    However, remember that some messages to booleans are inline coded in
81dacba7a63a *** empty log message ***
claus
parents: 65
diff changeset
    47
    the compilers (both interpreted and machine code). Therefore redefinition
81dacba7a63a *** empty log message ***
claus
parents: 65
diff changeset
    48
    of some methods here will not have any effect on compiled code.
81dacba7a63a *** empty log message ***
claus
parents: 65
diff changeset
    49
    (redefining ifTrue: to something else will probably crash the smalltalk
81dacba7a63a *** empty log message ***
claus
parents: 65
diff changeset
    50
     world anyway ...)
1294
e26bbb61f6b2 documentation
Claus Gittinger <cg@exept.de>
parents: 1238
diff changeset
    51
1303
8fdc2c653d13 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1294
diff changeset
    52
    [see also:]
8fdc2c653d13 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1294
diff changeset
    53
        False
20196
f2ce74d623d1 #OTHER by mawalch
mawalch
parents: 19705
diff changeset
    54
1294
e26bbb61f6b2 documentation
Claus Gittinger <cg@exept.de>
parents: 1238
diff changeset
    55
    [author:]
e26bbb61f6b2 documentation
Claus Gittinger <cg@exept.de>
parents: 1238
diff changeset
    56
        Claus Gittinger
88
81dacba7a63a *** empty log message ***
claus
parents: 65
diff changeset
    57
"
81dacba7a63a *** empty log message ***
claus
parents: 65
diff changeset
    58
! !
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    59
11758
1d173e000611 +asInteger
Claus Gittinger <cg@exept.de>
parents: 10816
diff changeset
    60
20196
f2ce74d623d1 #OTHER by mawalch
mawalch
parents: 19705
diff changeset
    61
693
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    62
!True methodsFor:'conditional evaluation'!
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    63
a27a279701f8 Initial revision
claus
parents:
diff changeset
    64
and:aBlock
a27a279701f8 Initial revision
claus
parents:
diff changeset
    65
    "evaluate aBlock if the receiver is true.
a27a279701f8 Initial revision
claus
parents:
diff changeset
    66
     since the receiver is known to be true,
a27a279701f8 Initial revision
claus
parents:
diff changeset
    67
     return the value of evaluating the block.
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
    68
     Notice:
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
    69
	This method is open coded (inlined) by the compiler(s)
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
    70
	- redefining it may not work as expected."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    71
a27a279701f8 Initial revision
claus
parents:
diff changeset
    72
    ^ aBlock value
a27a279701f8 Initial revision
claus
parents:
diff changeset
    73
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    74
11817
30001ffb7b63 changed #and:and:
Claus Gittinger <cg@exept.de>
parents: 11758
diff changeset
    75
and:block1 and:block2
11826
b2c70b0a0acf +and:and...
Claus Gittinger <cg@exept.de>
parents: 11817
diff changeset
    76
    "evaluate block1 if the receiver is true, 
b2c70b0a0acf +and:and...
Claus Gittinger <cg@exept.de>
parents: 11817
diff changeset
    77
     if that is also true, return the result from block2."
11817
30001ffb7b63 changed #and:and:
Claus Gittinger <cg@exept.de>
parents: 11758
diff changeset
    78
13598
e8bfb407fc60 added: #version_CVS
Claus Gittinger <cg@exept.de>
parents: 11918
diff changeset
    79
    block1 value ifFalse: [^ false].
e8bfb407fc60 added: #version_CVS
Claus Gittinger <cg@exept.de>
parents: 11918
diff changeset
    80
    ^ block2 value
e8bfb407fc60 added: #version_CVS
Claus Gittinger <cg@exept.de>
parents: 11918
diff changeset
    81
e8bfb407fc60 added: #version_CVS
Claus Gittinger <cg@exept.de>
parents: 11918
diff changeset
    82
    "Modified: / 20-08-2011 / 16:31:27 / cg"
11817
30001ffb7b63 changed #and:and:
Claus Gittinger <cg@exept.de>
parents: 11758
diff changeset
    83
!
30001ffb7b63 changed #and:and:
Claus Gittinger <cg@exept.de>
parents: 11758
diff changeset
    84
11826
b2c70b0a0acf +and:and...
Claus Gittinger <cg@exept.de>
parents: 11817
diff changeset
    85
and:block1 and:block2 and:block3
11918
d401a6edcefc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11826
diff changeset
    86
    "evaluate block1 if the receiver is true, 
d401a6edcefc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11826
diff changeset
    87
     if that is also true, evaluate block2.
d401a6edcefc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11826
diff changeset
    88
     if that is also true, return the result from block3."
d401a6edcefc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11826
diff changeset
    89
11826
b2c70b0a0acf +and:and...
Claus Gittinger <cg@exept.de>
parents: 11817
diff changeset
    90
    block1 value ifFalse:[^ false].
b2c70b0a0acf +and:and...
Claus Gittinger <cg@exept.de>
parents: 11817
diff changeset
    91
    block2 value ifFalse:[^ false].
b2c70b0a0acf +and:and...
Claus Gittinger <cg@exept.de>
parents: 11817
diff changeset
    92
    ^ block3 value
b2c70b0a0acf +and:and...
Claus Gittinger <cg@exept.de>
parents: 11817
diff changeset
    93
!
b2c70b0a0acf +and:and...
Claus Gittinger <cg@exept.de>
parents: 11817
diff changeset
    94
b2c70b0a0acf +and:and...
Claus Gittinger <cg@exept.de>
parents: 11817
diff changeset
    95
and:block1 and:block2 and:block3 and:block4
11918
d401a6edcefc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11826
diff changeset
    96
    "evaluate block1 if the receiver is true, 
d401a6edcefc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11826
diff changeset
    97
     if that is also true, evaluate block2.
d401a6edcefc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11826
diff changeset
    98
     if that is also true, evaluate block3.
d401a6edcefc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11826
diff changeset
    99
     if that is also true, return the result from block4."
d401a6edcefc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11826
diff changeset
   100
11826
b2c70b0a0acf +and:and...
Claus Gittinger <cg@exept.de>
parents: 11817
diff changeset
   101
    block1 value ifFalse:[^ false].
b2c70b0a0acf +and:and...
Claus Gittinger <cg@exept.de>
parents: 11817
diff changeset
   102
    block2 value ifFalse:[^ false].
b2c70b0a0acf +and:and...
Claus Gittinger <cg@exept.de>
parents: 11817
diff changeset
   103
    block3 value ifFalse:[^ false].
b2c70b0a0acf +and:and...
Claus Gittinger <cg@exept.de>
parents: 11817
diff changeset
   104
    ^ block4 value
b2c70b0a0acf +and:and...
Claus Gittinger <cg@exept.de>
parents: 11817
diff changeset
   105
!
b2c70b0a0acf +and:and...
Claus Gittinger <cg@exept.de>
parents: 11817
diff changeset
   106
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   107
ifFalse:aBlock
9224
487672a775ec *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9000
diff changeset
   108
    "If the receiver is false, return the value of evaluating aBlock; nil otherwise.
487672a775ec *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9000
diff changeset
   109
     Since the receiver is definitely true here, unconditionally return nil value.
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   110
     Notice:
9224
487672a775ec *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9000
diff changeset
   111
        This method is open coded (inlined) by the compiler(s)
487672a775ec *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9000
diff changeset
   112
        - redefining it may not work as expected."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   113
a27a279701f8 Initial revision
claus
parents:
diff changeset
   114
    ^ nil
a27a279701f8 Initial revision
claus
parents:
diff changeset
   115
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   116
693
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   117
ifFalse:falseBlock ifTrue:trueBlock
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   118
    "return the value of evaluating trueBlock (since the receiver is true)
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   119
     Notice:
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   120
	This method is open coded (inlined) by the compiler(s)
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   121
	- redefining it may not work as expected."
693
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   122
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   123
    ^ trueBlock value
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   124
!
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   125
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   126
ifTrue:aBlock
9224
487672a775ec *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9000
diff changeset
   127
    "If the receiver is true, return the value of evaluating aBlock; nil otherwise.
487672a775ec *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9000
diff changeset
   128
     Since the receiver is definitely true here, unconditionally return the blocks value.
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   129
     Notice:
9224
487672a775ec *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9000
diff changeset
   130
        This method is open coded (inlined) by the compiler(s)
487672a775ec *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9000
diff changeset
   131
        - redefining it may not work as expected."
693
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   132
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   133
    ^ aBlock value
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   134
!
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   135
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   136
ifTrue:trueBlock ifFalse:falseBlock
a27a279701f8 Initial revision
claus
parents:
diff changeset
   137
    "return the value of evaluating trueBlock (since the receiver is true)
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   138
     Notice:
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   139
	This method is open coded (inlined) by the compiler(s)
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   140
	- redefining it may not work as expected."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   141
a27a279701f8 Initial revision
claus
parents:
diff changeset
   142
    ^ trueBlock value
a27a279701f8 Initial revision
claus
parents:
diff changeset
   143
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   144
693
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   145
or:aBlock
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   146
    "evaluate aBlock if the receiver is false.
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   147
     since the receiver is known to be true simply return true.
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   148
     Notice:
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   149
	This method is open coded (inlined) by the compiler(s)
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   150
	- redefining it may not work as expected."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   151
693
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   152
    ^ self
11826
b2c70b0a0acf +and:and...
Claus Gittinger <cg@exept.de>
parents: 11817
diff changeset
   153
!
b2c70b0a0acf +and:and...
Claus Gittinger <cg@exept.de>
parents: 11817
diff changeset
   154
b2c70b0a0acf +and:and...
Claus Gittinger <cg@exept.de>
parents: 11817
diff changeset
   155
or:block1 or:block2
b2c70b0a0acf +and:and...
Claus Gittinger <cg@exept.de>
parents: 11817
diff changeset
   156
    ^ self
b2c70b0a0acf +and:and...
Claus Gittinger <cg@exept.de>
parents: 11817
diff changeset
   157
!
b2c70b0a0acf +and:and...
Claus Gittinger <cg@exept.de>
parents: 11817
diff changeset
   158
b2c70b0a0acf +and:and...
Claus Gittinger <cg@exept.de>
parents: 11817
diff changeset
   159
or:block1 or:block2 or:block3
b2c70b0a0acf +and:and...
Claus Gittinger <cg@exept.de>
parents: 11817
diff changeset
   160
    ^ self
b2c70b0a0acf +and:and...
Claus Gittinger <cg@exept.de>
parents: 11817
diff changeset
   161
!
b2c70b0a0acf +and:and...
Claus Gittinger <cg@exept.de>
parents: 11817
diff changeset
   162
b2c70b0a0acf +and:and...
Claus Gittinger <cg@exept.de>
parents: 11817
diff changeset
   163
or:block1 or:block2 or:block3 or:block4
b2c70b0a0acf +and:and...
Claus Gittinger <cg@exept.de>
parents: 11817
diff changeset
   164
    ^ self
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   165
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
   166
10816
be3982069cfe +asNumber
Claus Gittinger <cg@exept.de>
parents: 9652
diff changeset
   167
!True methodsFor:'converting'!
be3982069cfe +asNumber
Claus Gittinger <cg@exept.de>
parents: 9652
diff changeset
   168
11758
1d173e000611 +asInteger
Claus Gittinger <cg@exept.de>
parents: 10816
diff changeset
   169
asInteger
1d173e000611 +asInteger
Claus Gittinger <cg@exept.de>
parents: 10816
diff changeset
   170
    "false->0; true->1"
1d173e000611 +asInteger
Claus Gittinger <cg@exept.de>
parents: 10816
diff changeset
   171
1d173e000611 +asInteger
Claus Gittinger <cg@exept.de>
parents: 10816
diff changeset
   172
    ^ 1
1d173e000611 +asInteger
Claus Gittinger <cg@exept.de>
parents: 10816
diff changeset
   173
!
1d173e000611 +asInteger
Claus Gittinger <cg@exept.de>
parents: 10816
diff changeset
   174
10816
be3982069cfe +asNumber
Claus Gittinger <cg@exept.de>
parents: 9652
diff changeset
   175
asNumber
be3982069cfe +asNumber
Claus Gittinger <cg@exept.de>
parents: 9652
diff changeset
   176
    "false->0; true->1"
be3982069cfe +asNumber
Claus Gittinger <cg@exept.de>
parents: 9652
diff changeset
   177
be3982069cfe +asNumber
Claus Gittinger <cg@exept.de>
parents: 9652
diff changeset
   178
    ^ 1
be3982069cfe +asNumber
Claus Gittinger <cg@exept.de>
parents: 9652
diff changeset
   179
! !
be3982069cfe +asNumber
Claus Gittinger <cg@exept.de>
parents: 9652
diff changeset
   180
693
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   181
!True methodsFor:'logical operations'!
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   182
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   183
& aBoolean
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   184
   "return true if both the receiver and the argument are true
6906
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   185
    (since the receiver is true, return the argument, aBoolen)
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   186
     Notice: 
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   187
         as this is a binary message, the argument is always evaluated. 
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   188
         It might be better to use and:[...], which does not evaluate
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   189
         the argument if the receiver is already false."
693
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   190
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   191
    ^ aBoolean
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   192
!
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   193
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   194
eqv:aBoolean
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   195
   "return true if both the receiver and the argument are the same truth value
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   196
    (since the receiver is true, return true if the argument is also)"
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   197
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   198
    ^ aBoolean
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   199
!
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   200
9000
74a49b889c33 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6906
diff changeset
   201
implies:aBoolean
74a49b889c33 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6906
diff changeset
   202
   "return true if receiver => argument"
74a49b889c33 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6906
diff changeset
   203
74a49b889c33 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6906
diff changeset
   204
    ^ aBoolean
74a49b889c33 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6906
diff changeset
   205
!
74a49b889c33 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6906
diff changeset
   206
693
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   207
not
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   208
   "return true if the receiver is false, false otherwise
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   209
    (since the receiver is true, return false).
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   210
    Notice:
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   211
	This method is open coded (inlined) by the compiler(s)
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   212
	- redefining it may not work as expected."
693
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   213
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   214
    ^ false
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   215
!
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   216
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   217
xor:aBoolean
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   218
   "return true if the receiver and the argument are different truth values
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   219
    (since the receiver is true, return true, if the argument is not)"
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   220
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   221
    ^ aBoolean not
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   222
!
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   223
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   224
| aBoolean
6906
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   225
    "return true if either the receiver or the argument are true
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   226
     (since the receiver is true, return true).
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   227
     Notice: 
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   228
         as this is a binary message, the argument is always evaluated. 
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   229
         It might be better to use or:[...], which does not evaluate
87afb9964006 comments
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   230
         the argument if the receiver is already true."
693
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   231
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   232
    ^ true
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   233
! !
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   234
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   235
!True methodsFor:'printing & storing'!
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   236
a27a279701f8 Initial revision
claus
parents:
diff changeset
   237
printString
65
63f19c1157b6 *** empty log message ***
claus
parents: 41
diff changeset
   238
    "return character sequence representing the receiver"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   239
a27a279701f8 Initial revision
claus
parents:
diff changeset
   240
    ^ 'true'
a27a279701f8 Initial revision
claus
parents:
diff changeset
   241
! !
2
claus
parents: 1
diff changeset
   242
693
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   243
!True class methodsFor:'documentation'!
2
claus
parents: 1
diff changeset
   244
693
fb4d82421da8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   245
version
19705
af1b4569a96a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 13598
diff changeset
   246
    ^ '$Header$'
af1b4569a96a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 13598
diff changeset
   247
!
af1b4569a96a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 13598
diff changeset
   248
af1b4569a96a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 13598
diff changeset
   249
version_CVS
af1b4569a96a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 13598
diff changeset
   250
    ^ '$Header$'
2
claus
parents: 1
diff changeset
   251
! !
19705
af1b4569a96a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 13598
diff changeset
   252