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