Boolean.st
author Claus Gittinger <cg@exept.de>
Thu, 21 Jan 2010 12:48:59 +0100
changeset 12651 ada42382ffd1
parent 12163 bcb16f2fda53
child 13131 19fb1740fdd1
permissions -rw-r--r--
oops - spray extensions
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
159
514c749165c3 *** empty log message ***
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
"
5467
248b61f615c8 General encoding method (#encodeOn:with:)
Stefan Vogel <sv@exept.de>
parents: 4878
diff changeset
    12
"{ Package: 'stx:libbasic' }"
248b61f615c8 General encoding method (#encodeOn:with:)
Stefan Vogel <sv@exept.de>
parents: 4878
diff changeset
    13
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    14
Object subclass:#Boolean
1245
c8afea3d5af0 commentary
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
    15
	instanceVariableNames:''
c8afea3d5af0 commentary
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
    16
	classVariableNames:''
c8afea3d5af0 commentary
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
    17
	poolDictionaries:''
c8afea3d5af0 commentary
Claus Gittinger <cg@exept.de>
parents: 1119
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
!Boolean 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
159
514c749165c3 *** empty log message ***
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
    Boolean is an abstract class defining the common protocol for logical
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    40
    values. The logical values are represented by its two subclasses True and False.
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    41
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    42
    There are no instances of Boolean in the system and there is only one
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    43
    instance of True (which is the global true) and one of False (false).
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    44
88
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    45
    Boolean redefines some messages which deal with copying Booleans,
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    46
    to make certain there is only one instance of each.
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    47
    The system will behave strange if you fiddle around here and create
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    48
    new instances of True or False (i.e. it will not recognize these new
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    49
    instances as being true or false).
1294
e26bbb61f6b2 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    50
e26bbb61f6b2 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    51
    [author:]
4656
aa895a9835a2 added #hasSharedInstances and tracing support.
Claus Gittinger <cg@exept.de>
parents: 3070
diff changeset
    52
	Claus Gittinger
88
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    53
"
81dacba7a63a *** empty log message ***
claus
parents: 54
diff changeset
    54
! !
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    55
a27a279701f8 Initial revision
claus
parents:
diff changeset
    56
!Boolean class methodsFor:'instance creation'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    57
a27a279701f8 Initial revision
claus
parents:
diff changeset
    58
basicNew
1119
956d62a5656c compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents: 698
diff changeset
    59
    "{ Pragma: +optSpace }"
956d62a5656c compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents: 698
diff changeset
    60
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    61
    "catch instance creation
2
claus
parents: 1
diff changeset
    62
     - there must be exactly one instance of each - no more"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    63
a27a279701f8 Initial revision
claus
parents:
diff changeset
    64
    self error:'new instances of True/False are not allowed'
8517
c3827ae1ead2 readFrom fixed.
Claus Gittinger <cg@exept.de>
parents: 8394
diff changeset
    65
!
c3827ae1ead2 readFrom fixed.
Claus Gittinger <cg@exept.de>
parents: 8394
diff changeset
    66
c3827ae1ead2 readFrom fixed.
Claus Gittinger <cg@exept.de>
parents: 8394
diff changeset
    67
readFrom:aStringOrStream onError:exceptionBlock
c3827ae1ead2 readFrom fixed.
Claus Gittinger <cg@exept.de>
parents: 8394
diff changeset
    68
    "return a new Boolean, reading a printed representation from aStringOrStream."
c3827ae1ead2 readFrom fixed.
Claus Gittinger <cg@exept.de>
parents: 8394
diff changeset
    69
c3827ae1ead2 readFrom fixed.
Claus Gittinger <cg@exept.de>
parents: 8394
diff changeset
    70
    |str word|
c3827ae1ead2 readFrom fixed.
Claus Gittinger <cg@exept.de>
parents: 8394
diff changeset
    71
c3827ae1ead2 readFrom fixed.
Claus Gittinger <cg@exept.de>
parents: 8394
diff changeset
    72
    str := aStringOrStream readStream.
c3827ae1ead2 readFrom fixed.
Claus Gittinger <cg@exept.de>
parents: 8394
diff changeset
    73
    str skipSeparators.
c3827ae1ead2 readFrom fixed.
Claus Gittinger <cg@exept.de>
parents: 8394
diff changeset
    74
    word := str nextAlphaNumericWord.
c3827ae1ead2 readFrom fixed.
Claus Gittinger <cg@exept.de>
parents: 8394
diff changeset
    75
    word = 'true' ifTrue:[^ true].
c3827ae1ead2 readFrom fixed.
Claus Gittinger <cg@exept.de>
parents: 8394
diff changeset
    76
    word = 'false' ifTrue:[^ false].
c3827ae1ead2 readFrom fixed.
Claus Gittinger <cg@exept.de>
parents: 8394
diff changeset
    77
    ^ exceptionBlock value.
c3827ae1ead2 readFrom fixed.
Claus Gittinger <cg@exept.de>
parents: 8394
diff changeset
    78
c3827ae1ead2 readFrom fixed.
Claus Gittinger <cg@exept.de>
parents: 8394
diff changeset
    79
    "
c3827ae1ead2 readFrom fixed.
Claus Gittinger <cg@exept.de>
parents: 8394
diff changeset
    80
     Boolean readFrom:'true'      
c3827ae1ead2 readFrom fixed.
Claus Gittinger <cg@exept.de>
parents: 8394
diff changeset
    81
     Boolean readFrom:'false'     
c3827ae1ead2 readFrom fixed.
Claus Gittinger <cg@exept.de>
parents: 8394
diff changeset
    82
     Boolean readFrom:'xxx'  
c3827ae1ead2 readFrom fixed.
Claus Gittinger <cg@exept.de>
parents: 8394
diff changeset
    83
     Boolean readFrom:'  true'     
c3827ae1ead2 readFrom fixed.
Claus Gittinger <cg@exept.de>
parents: 8394
diff changeset
    84
     Boolean readFrom:'  false'    
c3827ae1ead2 readFrom fixed.
Claus Gittinger <cg@exept.de>
parents: 8394
diff changeset
    85
     Boolean readFrom:'true xxx'      
c3827ae1ead2 readFrom fixed.
Claus Gittinger <cg@exept.de>
parents: 8394
diff changeset
    86
     Boolean readFrom:'false xxx'     
c3827ae1ead2 readFrom fixed.
Claus Gittinger <cg@exept.de>
parents: 8394
diff changeset
    87
c3827ae1ead2 readFrom fixed.
Claus Gittinger <cg@exept.de>
parents: 8394
diff changeset
    88
     Boolean readFromString:'true xxx'   
c3827ae1ead2 readFrom fixed.
Claus Gittinger <cg@exept.de>
parents: 8394
diff changeset
    89
     Boolean readFromString:'false xxx'  
c3827ae1ead2 readFrom fixed.
Claus Gittinger <cg@exept.de>
parents: 8394
diff changeset
    90
    "
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    91
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
    92
3
24d81bf47225 *** empty log message ***
claus
parents: 2
diff changeset
    93
!Boolean class methodsFor:'queries'!
24d81bf47225 *** empty log message ***
claus
parents: 2
diff changeset
    94
4656
aa895a9835a2 added #hasSharedInstances and tracing support.
Claus Gittinger <cg@exept.de>
parents: 3070
diff changeset
    95
hasSharedInstances
aa895a9835a2 added #hasSharedInstances and tracing support.
Claus Gittinger <cg@exept.de>
parents: 3070
diff changeset
    96
    "return true if this class has shared instances, that is, instances
aa895a9835a2 added #hasSharedInstances and tracing support.
Claus Gittinger <cg@exept.de>
parents: 3070
diff changeset
    97
     with the same value are identical.
9147
9e6e5c149778 comment
Claus Gittinger <cg@exept.de>
parents: 8830
diff changeset
    98
     True returned here - there is only one true and only one false."
4656
aa895a9835a2 added #hasSharedInstances and tracing support.
Claus Gittinger <cg@exept.de>
parents: 3070
diff changeset
    99
aa895a9835a2 added #hasSharedInstances and tracing support.
Claus Gittinger <cg@exept.de>
parents: 3070
diff changeset
   100
    ^ true
aa895a9835a2 added #hasSharedInstances and tracing support.
Claus Gittinger <cg@exept.de>
parents: 3070
diff changeset
   101
!
aa895a9835a2 added #hasSharedInstances and tracing support.
Claus Gittinger <cg@exept.de>
parents: 3070
diff changeset
   102
3
24d81bf47225 *** empty log message ***
claus
parents: 2
diff changeset
   103
isBuiltInClass
1266
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1245
diff changeset
   104
    "return true if this class is known by the run-time-system.
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1245
diff changeset
   105
     Here, true is returned (for my two subclasses)."
3
24d81bf47225 *** empty log message ***
claus
parents: 2
diff changeset
   106
24d81bf47225 *** empty log message ***
claus
parents: 2
diff changeset
   107
    ^ true
1266
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1245
diff changeset
   108
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1245
diff changeset
   109
    "Modified: 23.4.1996 / 15:58:22 / cg"
3
24d81bf47225 *** empty log message ***
claus
parents: 2
diff changeset
   110
! !
24d81bf47225 *** empty log message ***
claus
parents: 2
diff changeset
   111
698
04533375e12c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   112
12651
ada42382ffd1 oops - spray extensions
Claus Gittinger <cg@exept.de>
parents: 12163
diff changeset
   113
ada42382ffd1 oops - spray extensions
Claus Gittinger <cg@exept.de>
parents: 12163
diff changeset
   114
4878
1a64a89d6c01 blocked #onChangeSend:to:
ca
parents: 4728
diff changeset
   115
!Boolean methodsFor:'blocked'!
1a64a89d6c01 blocked #onChangeSend:to:
ca
parents: 4728
diff changeset
   116
1a64a89d6c01 blocked #onChangeSend:to:
ca
parents: 4728
diff changeset
   117
onChangeSend:selector to:someOne
1a64a89d6c01 blocked #onChangeSend:to:
ca
parents: 4728
diff changeset
   118
    "/ not really an error ...
1a64a89d6c01 blocked #onChangeSend:to:
ca
parents: 4728
diff changeset
   119
    "/ self error:'should not be invoked for booleans'
1a64a89d6c01 blocked #onChangeSend:to:
ca
parents: 4728
diff changeset
   120
! !
1a64a89d6c01 blocked #onChangeSend:to:
ca
parents: 4728
diff changeset
   121
422
claus
parents: 384
diff changeset
   122
!Boolean methodsFor:'converting'!
claus
parents: 384
diff changeset
   123
5937
928b9ed64cbb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5825
diff changeset
   124
asBoolean
928b9ed64cbb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5825
diff changeset
   125
    ^ self
928b9ed64cbb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5825
diff changeset
   126
!
928b9ed64cbb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5825
diff changeset
   127
422
claus
parents: 384
diff changeset
   128
literalArrayEncoding
1245
c8afea3d5af0 commentary
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   129
    "encode myself as an array literal, from which a copy of the receiver
c8afea3d5af0 commentary
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   130
     can be reconstructed with #decodeAsLiteralArray."
422
claus
parents: 384
diff changeset
   131
claus
parents: 384
diff changeset
   132
    ^ self
claus
parents: 384
diff changeset
   133
claus
parents: 384
diff changeset
   134
    "Modified: 5.9.1995 / 22:46:57 / claus"
1245
c8afea3d5af0 commentary
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   135
    "Modified: 22.4.1996 / 13:00:05 / cg"
422
claus
parents: 384
diff changeset
   136
! !
claus
parents: 384
diff changeset
   137
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   138
!Boolean methodsFor:'copying'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   139
159
514c749165c3 *** empty log message ***
claus
parents: 92
diff changeset
   140
copy
514c749165c3 *** empty log message ***
claus
parents: 92
diff changeset
   141
    "return a shallow copy of the receiver
514c749165c3 *** empty log message ***
claus
parents: 92
diff changeset
   142
     - since both true and false are unique, return the receiver"
514c749165c3 *** empty log message ***
claus
parents: 92
diff changeset
   143
514c749165c3 *** empty log message ***
claus
parents: 92
diff changeset
   144
    ^ self
514c749165c3 *** empty log message ***
claus
parents: 92
diff changeset
   145
!
514c749165c3 *** empty log message ***
claus
parents: 92
diff changeset
   146
10944
7a49334eb90b deepCopy change
ab
parents: 9656
diff changeset
   147
deepCopyUsing:aDictionary postCopySelector:postCopySelector
12
8e03bd717355 *** empty log message ***
claus
parents: 5
diff changeset
   148
    "return a deep copy of the receiver
8e03bd717355 *** empty log message ***
claus
parents: 5
diff changeset
   149
     - since both true and false are unique, return the receiver"
8e03bd717355 *** empty log message ***
claus
parents: 5
diff changeset
   150
8e03bd717355 *** empty log message ***
claus
parents: 5
diff changeset
   151
    ^ self
8e03bd717355 *** empty log message ***
claus
parents: 5
diff changeset
   152
!
8e03bd717355 *** empty log message ***
claus
parents: 5
diff changeset
   153
698
04533375e12c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   154
shallowCopy
04533375e12c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   155
    "return a shallow copy of the receiver
04533375e12c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   156
     - since both true and false are unique, return the receiver"
04533375e12c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   157
04533375e12c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   158
    ^ self
04533375e12c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   159
!
04533375e12c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   160
12
8e03bd717355 *** empty log message ***
claus
parents: 5
diff changeset
   161
simpleDeepCopy
8e03bd717355 *** empty log message ***
claus
parents: 5
diff changeset
   162
    "return a deep copy of the receiver
8e03bd717355 *** empty log message ***
claus
parents: 5
diff changeset
   163
     - since both true and false are unique, return the receiver"
8e03bd717355 *** empty log message ***
claus
parents: 5
diff changeset
   164
8e03bd717355 *** empty log message ***
claus
parents: 5
diff changeset
   165
    ^ self
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   166
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
   167
698
04533375e12c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   168
!Boolean methodsFor:'printing & storing'!
04533375e12c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   169
04533375e12c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   170
printOn:aStream
12163
bcb16f2fda53 comment/format in: #printOn:
Claus Gittinger <cg@exept.de>
parents: 10944
diff changeset
   171
    "append a character sequence representing the receiver to the argument, aStream"
698
04533375e12c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   172
04533375e12c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   173
    aStream nextPutAll:self printString
04533375e12c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   174
!
04533375e12c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   175
04533375e12c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   176
storeOn:aStream
04533375e12c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   177
    "append a character sequence to the argument, aStream from which the
04533375e12c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   178
     receiver can be reconstructed using readFrom:."
04533375e12c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   179
04533375e12c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   180
    ^ self printOn:aStream
04533375e12c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   181
!
04533375e12c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   182
04533375e12c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   183
storeString
04533375e12c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   184
    "return  a character sequence to the argument, aStream from which the
04533375e12c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   185
     receiver can be reconstructed using readFrom:."
04533375e12c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   186
04533375e12c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   187
    ^ self printString
04533375e12c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   188
! !
04533375e12c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   189
12651
ada42382ffd1 oops - spray extensions
Claus Gittinger <cg@exept.de>
parents: 12163
diff changeset
   190
5825
6743e22cd010 Added method isBoolean; need this!
martin
parents: 5467
diff changeset
   191
!Boolean methodsFor:'testing'!
6743e22cd010 Added method isBoolean; need this!
martin
parents: 5467
diff changeset
   192
6743e22cd010 Added method isBoolean; need this!
martin
parents: 5467
diff changeset
   193
isBoolean
9448
d7fd5533b1cb comment
Claus Gittinger <cg@exept.de>
parents: 9147
diff changeset
   194
    "Return true, because it is a boolean."
5825
6743e22cd010 Added method isBoolean; need this!
martin
parents: 5467
diff changeset
   195
6743e22cd010 Added method isBoolean; need this!
martin
parents: 5467
diff changeset
   196
    ^ true.
9448
d7fd5533b1cb comment
Claus Gittinger <cg@exept.de>
parents: 9147
diff changeset
   197
d7fd5533b1cb comment
Claus Gittinger <cg@exept.de>
parents: 9147
diff changeset
   198
    "Modified: / 17-07-2006 / 14:14:24 / cg"
8305
7f80b5a18ffc asBoolean for WO
werner
parents: 5937
diff changeset
   199
!
7f80b5a18ffc asBoolean for WO
werner
parents: 5937
diff changeset
   200
7f80b5a18ffc asBoolean for WO
werner
parents: 5937
diff changeset
   201
isLiteral
7f80b5a18ffc asBoolean for WO
werner
parents: 5937
diff changeset
   202
    "return true, if the receiver can be used as a literal constant in ST syntax
7f80b5a18ffc asBoolean for WO
werner
parents: 5937
diff changeset
   203
     (i.e. can be used in constant arrays)"
7f80b5a18ffc asBoolean for WO
werner
parents: 5937
diff changeset
   204
7f80b5a18ffc asBoolean for WO
werner
parents: 5937
diff changeset
   205
    ^ true
5825
6743e22cd010 Added method isBoolean; need this!
martin
parents: 5467
diff changeset
   206
! !
4728
37eaa8241422 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4682
diff changeset
   207
4656
aa895a9835a2 added #hasSharedInstances and tracing support.
Claus Gittinger <cg@exept.de>
parents: 3070
diff changeset
   208
!Boolean methodsFor:'tracing'!
aa895a9835a2 added #hasSharedInstances and tracing support.
Claus Gittinger <cg@exept.de>
parents: 3070
diff changeset
   209
4682
4158042a9c8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4656
diff changeset
   210
traceInto:aRequestor level:level from:referrer
4656
aa895a9835a2 added #hasSharedInstances and tracing support.
Claus Gittinger <cg@exept.de>
parents: 3070
diff changeset
   211
    "double dispatch into tracer, passing my type implicitely in the selector"
aa895a9835a2 added #hasSharedInstances and tracing support.
Claus Gittinger <cg@exept.de>
parents: 3070
diff changeset
   212
4682
4158042a9c8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4656
diff changeset
   213
    ^ aRequestor traceBoolean:self level:level from:referrer
4656
aa895a9835a2 added #hasSharedInstances and tracing support.
Claus Gittinger <cg@exept.de>
parents: 3070
diff changeset
   214
aa895a9835a2 added #hasSharedInstances and tracing support.
Claus Gittinger <cg@exept.de>
parents: 3070
diff changeset
   215
aa895a9835a2 added #hasSharedInstances and tracing support.
Claus Gittinger <cg@exept.de>
parents: 3070
diff changeset
   216
! !
aa895a9835a2 added #hasSharedInstances and tracing support.
Claus Gittinger <cg@exept.de>
parents: 3070
diff changeset
   217
8394
da194de43766 Generalize visitor pattern and define #visit...:with: -methods instead
Stefan Vogel <sv@exept.de>
parents: 8305
diff changeset
   218
!Boolean methodsFor:'visiting'!
da194de43766 Generalize visitor pattern and define #visit...:with: -methods instead
Stefan Vogel <sv@exept.de>
parents: 8305
diff changeset
   219
da194de43766 Generalize visitor pattern and define #visit...:with: -methods instead
Stefan Vogel <sv@exept.de>
parents: 8305
diff changeset
   220
acceptVisitor:aVisitor with:aParameter
da194de43766 Generalize visitor pattern and define #visit...:with: -methods instead
Stefan Vogel <sv@exept.de>
parents: 8305
diff changeset
   221
da194de43766 Generalize visitor pattern and define #visit...:with: -methods instead
Stefan Vogel <sv@exept.de>
parents: 8305
diff changeset
   222
    ^ aVisitor visitBoolean:self with:aParameter
da194de43766 Generalize visitor pattern and define #visit...:with: -methods instead
Stefan Vogel <sv@exept.de>
parents: 8305
diff changeset
   223
! !
da194de43766 Generalize visitor pattern and define #visit...:with: -methods instead
Stefan Vogel <sv@exept.de>
parents: 8305
diff changeset
   224
698
04533375e12c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   225
!Boolean class methodsFor:'documentation'!
54
06dbdeeed4f9 *** empty log message ***
claus
parents: 37
diff changeset
   226
698
04533375e12c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   227
version
12651
ada42382ffd1 oops - spray extensions
Claus Gittinger <cg@exept.de>
parents: 12163
diff changeset
   228
    ^ '$Header: /cvs/stx/stx/libbasic/Boolean.st,v 1.40 2010-01-21 11:48:59 cg Exp $'
12163
bcb16f2fda53 comment/format in: #printOn:
Claus Gittinger <cg@exept.de>
parents: 10944
diff changeset
   229
!
bcb16f2fda53 comment/format in: #printOn:
Claus Gittinger <cg@exept.de>
parents: 10944
diff changeset
   230
bcb16f2fda53 comment/format in: #printOn:
Claus Gittinger <cg@exept.de>
parents: 10944
diff changeset
   231
version_CVS
12651
ada42382ffd1 oops - spray extensions
Claus Gittinger <cg@exept.de>
parents: 12163
diff changeset
   232
    ^ '$Header: /cvs/stx/stx/libbasic/Boolean.st,v 1.40 2010-01-21 11:48:59 cg Exp $'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   233
! !