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