1
|
1 |
"
|
5
|
2 |
COPYRIGHT (c) 1988 by Claus Gittinger
|
13
|
3 |
All Rights Reserved
|
1
|
4 |
|
|
5 |
This software is furnished under a license and may be used
|
|
6 |
only in accordance with the terms of that license and with the
|
|
7 |
inclusion of the above copyright notice. This software may not
|
|
8 |
be provided or otherwise made available to, or used by, any
|
|
9 |
other person. No title to or ownership of the software is
|
|
10 |
hereby transferred.
|
|
11 |
"
|
|
12 |
|
|
13 |
Object subclass:#UndefinedObject
|
|
14 |
instanceVariableNames:''
|
|
15 |
classVariableNames:''
|
|
16 |
poolDictionaries:''
|
|
17 |
category:'Kernel-Objects'
|
|
18 |
!
|
|
19 |
|
|
20 |
UndefinedObject comment:'
|
|
21 |
|
5
|
22 |
COPYRIGHT (c) 1988 by Claus Gittinger
|
13
|
23 |
All Rights Reserved
|
1
|
24 |
|
|
25 |
there is only one instance of this class: nil
|
|
26 |
|
13
|
27 |
$Header: /cvs/stx/stx/libbasic/UndefinedObject.st,v 1.5 1993-12-11 00:59:21 claus Exp $
|
1
|
28 |
'!
|
|
29 |
|
|
30 |
!UndefinedObject class methodsFor:'instance creation'!
|
|
31 |
|
|
32 |
basicNew
|
|
33 |
"catch new - there MUST be only one nil in the system"
|
|
34 |
|
|
35 |
^ nil
|
|
36 |
!
|
|
37 |
|
|
38 |
basicNew:size
|
|
39 |
"catch new - there MUST be only one nil in the system"
|
|
40 |
|
|
41 |
^ nil
|
|
42 |
! !
|
|
43 |
|
|
44 |
!UndefinedObject methodsFor:'error catching'!
|
|
45 |
|
|
46 |
basicAt:index
|
|
47 |
"catch array access - its illegal
|
|
48 |
defined here since basicAt: in Object ommits the nil-check"
|
|
49 |
|
|
50 |
^ self notIndexed
|
|
51 |
!
|
|
52 |
|
|
53 |
at:index
|
|
54 |
"catch array access - its illegal
|
|
55 |
defined here since at: in Object ommits the nil-check"
|
|
56 |
|
|
57 |
^ self notIndexed
|
|
58 |
!
|
|
59 |
|
|
60 |
basicAt:index put:anObject
|
|
61 |
"catch array access - its illegal
|
|
62 |
defined here since basicAt:put: in Object ommits the nil-check"
|
|
63 |
|
|
64 |
^ self notIndexed
|
|
65 |
!
|
|
66 |
|
|
67 |
at:index put:anObject
|
|
68 |
"catch array access - its illegal
|
|
69 |
defined here since at:put: in Object ommits the nil-check"
|
|
70 |
|
|
71 |
^ self notIndexed
|
|
72 |
! !
|
|
73 |
|
|
74 |
!UndefinedObject methodsFor:'testing'!
|
|
75 |
|
|
76 |
isNil
|
|
77 |
"return true if I am nil - since I am, return true"
|
|
78 |
|
|
79 |
^ true
|
|
80 |
!
|
|
81 |
|
|
82 |
notNil
|
|
83 |
"return true if I am not nil - since I am nil, return false"
|
|
84 |
|
|
85 |
^ false
|
|
86 |
!
|
|
87 |
|
|
88 |
size
|
|
89 |
"return the number of indexed instvars
|
|
90 |
defined here since size in Object ommits the nil-check"
|
|
91 |
|
|
92 |
^ 0
|
|
93 |
!
|
|
94 |
|
|
95 |
basicSize
|
|
96 |
"return the number of indexed instvars
|
|
97 |
defined here since size in Object ommits the nil-check"
|
|
98 |
|
|
99 |
^ 0
|
|
100 |
!
|
|
101 |
|
|
102 |
hash
|
|
103 |
"return an integer useful as a hash key"
|
|
104 |
|
|
105 |
^ 0
|
|
106 |
!
|
|
107 |
|
|
108 |
identityHash
|
|
109 |
"return an integer useful as a hash key"
|
|
110 |
|
|
111 |
^ 0
|
|
112 |
! !
|
|
113 |
|
|
114 |
!UndefinedObject methodsFor:'copying'!
|
|
115 |
|
|
116 |
shallowCopy
|
|
117 |
"return a shallow copy of myself
|
|
118 |
- since there is only one nil in the system return self"
|
|
119 |
|
|
120 |
^ self
|
|
121 |
!
|
|
122 |
|
13
|
123 |
simpleDeepCopy
|
|
124 |
"return a deep copy of myself
|
|
125 |
- since there is only one nil in the system return self"
|
|
126 |
|
|
127 |
^ self
|
|
128 |
!
|
|
129 |
|
|
130 |
deepCopyUsing:aDictionary
|
|
131 |
"return a deep copy of myself
|
|
132 |
- since there is only one nil in the system return self"
|
|
133 |
|
|
134 |
^ self
|
|
135 |
!
|
|
136 |
|
1
|
137 |
deepCopy
|
|
138 |
"return a deep copy of myself
|
|
139 |
- since there is only one nil in the system return self"
|
|
140 |
|
|
141 |
^ self
|
|
142 |
! !
|
|
143 |
|
|
144 |
!UndefinedObject methodsFor:'printing & storing'!
|
|
145 |
|
|
146 |
printString
|
|
147 |
"return a string for printing myself"
|
|
148 |
|
|
149 |
^ 'nil'
|
|
150 |
!
|
|
151 |
|
|
152 |
storeString
|
|
153 |
"return a string for storing myself"
|
|
154 |
|
|
155 |
^ 'nil'
|
|
156 |
! !
|
2
|
157 |
|
|
158 |
!UndefinedObject methodsFor:'binary storage'!
|
|
159 |
|
|
160 |
hasSpecialBinaryRepresentation
|
|
161 |
^ true
|
|
162 |
!
|
|
163 |
|
|
164 |
storeBinaryOn: stream manager: manager
|
|
165 |
stream nextPut: (manager codeForNil)
|
|
166 |
! !
|