UndefObj.st
author Stefan Vogel <sv@exept.de>
Thu, 14 Dec 1995 23:42:02 +0100
changeset 757 93d5f6b86e98
parent 695 20ec350f92ca
child 1029 c469a63e88e2
permissions -rw-r--r--
Add SemaphoreSet.
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: 95
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
"
a27a279701f8 Initial revision
claus
parents:
diff changeset
    12
a27a279701f8 Initial revision
claus
parents:
diff changeset
    13
Object subclass:#UndefinedObject
695
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    14
	 instanceVariableNames:''
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    15
	 classVariableNames:''
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    16
	 poolDictionaries:''
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    17
	 category:'Kernel-Objects'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    18
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    19
88
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    20
!UndefinedObject class methodsFor:'documentation'!
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    21
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    22
copyright
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    23
"
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    24
 COPYRIGHT (c) 1988 by Claus Gittinger
159
514c749165c3 *** empty log message ***
claus
parents: 95
diff changeset
    25
	      All Rights Reserved
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    26
88
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    27
 This software is furnished under a license and may be used
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    28
 only in accordance with the terms of that license and with the
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    29
 inclusion of the above copyright notice.   This software may not
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    30
 be provided or otherwise made available to, or used by, any
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    31
 other person.  No title to or ownership of the software is
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    32
 hereby transferred.
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    33
"
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    34
!
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    35
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    36
documentation
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    37
"
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    38
    there is only one instance of this class: nil, representing an undefined
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    39
    or otherwise unspecified object.
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    40
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    41
    All instance variables, array elements and even method/block local 
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    42
    variables are initially set to nil.
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    43
    Since in Smalltalk/X, nil is represented by a special pointer value,
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    44
    there can be only one instance of UndefinedObject, and no subclassing is
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    45
    possible. 
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    46
    (to be exact: subclassing is technically possible, but instances of it 
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    47
     would not be recognized as being nil - therefore, subclassing is blocked)
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    48
"
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    49
! !
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    50
a27a279701f8 Initial revision
claus
parents:
diff changeset
    51
!UndefinedObject class methodsFor:'instance creation'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    52
a27a279701f8 Initial revision
claus
parents:
diff changeset
    53
basicNew
a27a279701f8 Initial revision
claus
parents:
diff changeset
    54
    "catch new - there MUST be only one nil in the system"
a27a279701f8 Initial revision
claus
parents:
diff changeset
    55
a27a279701f8 Initial revision
claus
parents:
diff changeset
    56
    ^ nil
a27a279701f8 Initial revision
claus
parents:
diff changeset
    57
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    58
a27a279701f8 Initial revision
claus
parents:
diff changeset
    59
basicNew:size
a27a279701f8 Initial revision
claus
parents:
diff changeset
    60
    "catch new - there MUST be only one nil in the system"
a27a279701f8 Initial revision
claus
parents:
diff changeset
    61
a27a279701f8 Initial revision
claus
parents:
diff changeset
    62
    ^ nil
a27a279701f8 Initial revision
claus
parents:
diff changeset
    63
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
    64
51
9b7ae5e18f3e *** empty log message ***
claus
parents: 41
diff changeset
    65
!UndefinedObject class methodsFor:'queries'!
9b7ae5e18f3e *** empty log message ***
claus
parents: 41
diff changeset
    66
9b7ae5e18f3e *** empty log message ***
claus
parents: 41
diff changeset
    67
canBeSubclassed
9b7ae5e18f3e *** empty log message ***
claus
parents: 41
diff changeset
    68
    "return true, if its allowed to create subclasses of the receiver.
9b7ae5e18f3e *** empty log message ***
claus
parents: 41
diff changeset
    69
     Return nil here - since it is NOT possible for UndefinedObject"
9b7ae5e18f3e *** empty log message ***
claus
parents: 41
diff changeset
    70
9b7ae5e18f3e *** empty log message ***
claus
parents: 41
diff changeset
    71
    ^ false
9b7ae5e18f3e *** empty log message ***
claus
parents: 41
diff changeset
    72
! !
9b7ae5e18f3e *** empty log message ***
claus
parents: 41
diff changeset
    73
695
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    74
!UndefinedObject methodsFor:'copying'!
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    75
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    76
copy
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    77
    "return a shallow copy of myself
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    78
     - since there is only one nil in the system return self"
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    79
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    80
    ^ self
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    81
!
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    82
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    83
deepCopy
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    84
    "return a deep copy of myself
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    85
     - since there is only one nil in the system return self"
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    86
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    87
    ^ self
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    88
!
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    89
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    90
deepCopyUsing:aDictionary
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    91
    "return a deep copy of myself
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    92
     - since there is only one nil in the system return self"
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    93
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    94
    ^ self
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    95
!
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    96
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    97
shallowCopy
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    98
    "return a shallow copy of myself
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    99
     - since there is only one nil in the system return self"
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   100
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   101
    ^ self
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   102
!
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   103
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   104
simpleDeepCopy
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   105
    "return a deep copy of myself
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   106
     - since there is only one nil in the system return self"
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   107
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   108
    ^ self
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   109
! !
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   110
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   111
!UndefinedObject methodsFor:'error catching'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   112
a27a279701f8 Initial revision
claus
parents:
diff changeset
   113
basicAt:index
a27a279701f8 Initial revision
claus
parents:
diff changeset
   114
    "catch array access - its illegal
a27a279701f8 Initial revision
claus
parents:
diff changeset
   115
     defined here since basicAt: in Object ommits the nil-check"
a27a279701f8 Initial revision
claus
parents:
diff changeset
   116
a27a279701f8 Initial revision
claus
parents:
diff changeset
   117
    ^ self notIndexed
a27a279701f8 Initial revision
claus
parents:
diff changeset
   118
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   119
a27a279701f8 Initial revision
claus
parents:
diff changeset
   120
basicAt:index put:anObject
a27a279701f8 Initial revision
claus
parents:
diff changeset
   121
    "catch array access - its illegal
a27a279701f8 Initial revision
claus
parents:
diff changeset
   122
     defined here since basicAt:put: in Object ommits the nil-check"
a27a279701f8 Initial revision
claus
parents:
diff changeset
   123
a27a279701f8 Initial revision
claus
parents:
diff changeset
   124
    ^ self notIndexed
a27a279701f8 Initial revision
claus
parents:
diff changeset
   125
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
   126
a27a279701f8 Initial revision
claus
parents:
diff changeset
   127
!UndefinedObject methodsFor:'printing & storing'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   128
63
1f0cdefb013f *** empty log message ***
claus
parents: 51
diff changeset
   129
printOn:aStream
1f0cdefb013f *** empty log message ***
claus
parents: 51
diff changeset
   130
    "append a printed representation of the receiver to the
1f0cdefb013f *** empty log message ***
claus
parents: 51
diff changeset
   131
     argument, aStream"
1f0cdefb013f *** empty log message ***
claus
parents: 51
diff changeset
   132
1f0cdefb013f *** empty log message ***
claus
parents: 51
diff changeset
   133
    aStream nextPutAll:'nil'
1f0cdefb013f *** empty log message ***
claus
parents: 51
diff changeset
   134
!
1f0cdefb013f *** empty log message ***
claus
parents: 51
diff changeset
   135
695
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   136
printString
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   137
    "return a string for printing myself"
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   138
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   139
    ^ 'nil'
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   140
!
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   141
63
1f0cdefb013f *** empty log message ***
claus
parents: 51
diff changeset
   142
storeOn:aStream
1f0cdefb013f *** empty log message ***
claus
parents: 51
diff changeset
   143
    "append a printed representation of the receiver to the
1f0cdefb013f *** empty log message ***
claus
parents: 51
diff changeset
   144
     argument, aStream, which allows reconstruction of it"
1f0cdefb013f *** empty log message ***
claus
parents: 51
diff changeset
   145
1f0cdefb013f *** empty log message ***
claus
parents: 51
diff changeset
   146
    ^ self printOn:aStream
695
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   147
!
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   148
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   149
storeString
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   150
    "return a string for storing myself"
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   151
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   152
    ^ 'nil'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   153
! !
2
claus
parents: 1
diff changeset
   154
77
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   155
!UndefinedObject methodsFor:'subclass creation'!
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   156
202
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   157
nilSubclass:selector args:args
356
claus
parents: 293
diff changeset
   158
    "common helper for subclass creation.
claus
parents: 293
diff changeset
   159
     Creates a nil-superclass class with entries for the minimum
claus
parents: 293
diff changeset
   160
     required protocol (#class, #isBehavior and #doesNotUnderstand:).
claus
parents: 293
diff changeset
   161
     These are required to avoid getting into deep trouble when
claus
parents: 293
diff changeset
   162
     inspecting or debugging instances of this new class.
77
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   163
356
claus
parents: 293
diff changeset
   164
     The methods get a modified source code to remind you that these
claus
parents: 293
diff changeset
   165
     methods were automatically generated."
claus
parents: 293
diff changeset
   166
claus
parents: 293
diff changeset
   167
    |newClass mA|
202
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   168
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   169
    Class withoutUpdatingChangesDo:
77
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   170
    [
202
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   171
	newClass := Object perform:selector withArguments:args
77
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   172
    ].
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   173
    newClass notNil ifTrue:[
159
514c749165c3 *** empty log message ***
claus
parents: 95
diff changeset
   174
	newClass setSuperclass:nil.
356
claus
parents: 293
diff changeset
   175
claus
parents: 293
diff changeset
   176
	"
claus
parents: 293
diff changeset
   177
	 copy over method objects from Object
claus
parents: 293
diff changeset
   178
	"
159
514c749165c3 *** empty log message ***
claus
parents: 95
diff changeset
   179
	newClass 
356
claus
parents: 293
diff changeset
   180
	    setSelectors:(Array 
claus
parents: 293
diff changeset
   181
			    with:#class
claus
parents: 293
diff changeset
   182
			    with:#isBehavior 
claus
parents: 293
diff changeset
   183
			    with:#doesNotUnderstand:)
claus
parents: 293
diff changeset
   184
	    methods:(mA := Array 
claus
parents: 293
diff changeset
   185
			    with:(Object compiledMethodAt:#class) copy
claus
parents: 293
diff changeset
   186
			    with:(Object compiledMethodAt:#isBehavior) copy
claus
parents: 293
diff changeset
   187
			    with:(Object compiledMethodAt:#doesNotUnderstand:) copy).
claus
parents: 293
diff changeset
   188
claus
parents: 293
diff changeset
   189
	"
claus
parents: 293
diff changeset
   190
	 and modify the source code
claus
parents: 293
diff changeset
   191
	"
claus
parents: 293
diff changeset
   192
	mA do:[:m |
claus
parents: 293
diff changeset
   193
	    m source:m source , '
claus
parents: 293
diff changeset
   194
"
claus
parents: 293
diff changeset
   195
*** WARNING
claus
parents: 293
diff changeset
   196
***
claus
parents: 293
diff changeset
   197
*** this method has been automatically created,
claus
parents: 293
diff changeset
   198
*** since all nil-subclasses should respond to some minimum required
claus
parents: 293
diff changeset
   199
*** protocol.
claus
parents: 293
diff changeset
   200
***
claus
parents: 293
diff changeset
   201
*** Inspection and/or debugging of instances may not be possible,
claus
parents: 293
diff changeset
   202
*** if you remove/change this method. 
claus
parents: 293
diff changeset
   203
"
claus
parents: 293
diff changeset
   204
'.
claus
parents: 293
diff changeset
   205
	].
159
514c749165c3 *** empty log message ***
claus
parents: 95
diff changeset
   206
	Class addChangeRecordForClass:newClass.
77
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   207
    ].
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   208
    ^ newClass
202
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   209
!
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   210
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   211
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s category:cat
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   212
    "create a new class which has nil as superclass 
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   213
     - i.e. traps into doesNotUnderstand: for all of its messages."
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   214
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   215
    ^ self nilSubclass:(thisContext selector) args:(thisContext args)
695
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   216
!
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   217
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   218
variableByteSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s category:cat
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   219
    "create a new class which has nil as superclass 
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   220
     - i.e. traps into doesNotUnderstand: for all of its messages."
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   221
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   222
    ^ self nilSubclass:(thisContext selector) args:(thisContext args)
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   223
!
77
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   224
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   225
variableSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s category:cat
159
514c749165c3 *** empty log message ***
claus
parents: 95
diff changeset
   226
    "create a new class which has nil as superclass 
514c749165c3 *** empty log message ***
claus
parents: 95
diff changeset
   227
     - i.e. traps into doesNotUnderstand: for all of its messages."
77
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   228
202
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   229
    ^ self nilSubclass:(thisContext selector) args:(thisContext args)
695
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   230
! !
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   231
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   232
!UndefinedObject methodsFor:'testing'!
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   233
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   234
basicSize
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   235
    "return the number of indexed instvars
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   236
     defined here since size in Object ommits the nil-check"
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   237
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   238
    ^ 0
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   239
!
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   240
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   241
hash
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   242
    "return an integer useful as a hash key"
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   243
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   244
    ^ 0
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   245
!
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   246
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   247
identityHash
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   248
    "return an integer useful as a hash key"
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   249
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   250
    ^ 0
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   251
!
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   252
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   253
isLiteral
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   254
    "return true, if the receiver can be used as a literal
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   255
     (i.e. can be used in constant arrays)"
77
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   256
695
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   257
    ^ true
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   258
!
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   259
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   260
isNil
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   261
    "return true if I am nil - since I am, return true"
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   262
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   263
    ^ true
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   264
!
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   265
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   266
notNil
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   267
    "return true if I am not nil - since I am nil, return false"
77
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   268
695
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   269
    ^ false
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   270
!
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   271
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   272
size
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   273
    "return the number of indexed instvars
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   274
     defined here since size in Object ommits the nil-check"
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   275
 
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   276
    ^ 0
77
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   277
! !
695
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   278
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   279
!UndefinedObject class methodsFor:'documentation'!
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   280
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   281
version
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   282
    ^ '$Header: /cvs/stx/stx/libbasic/Attic/UndefObj.st,v 1.19 1995-12-07 19:40:59 cg Exp $'
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   283
! !