UndefinedObject.st
author Claus Gittinger <cg@exept.de>
Tue, 22 Oct 1996 21:38:13 +0200
changeset 1803 754f9205b651
parent 1638 8df0060e4d73
child 1868 1cd4273ea11b
permissions -rw-r--r--
meta's superclass should be class - not Object.
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
1029
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
    14
	instanceVariableNames:''
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
    15
	classVariableNames:''
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
    16
	poolDictionaries:''
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
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
"
1303
8fdc2c653d13 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1294
diff changeset
    38
    there is only one instance of this class: nil, 
8fdc2c653d13 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1294
diff changeset
    39
    representing an undefined or otherwise unspecified object.
88
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.
1303
8fdc2c653d13 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1294
diff changeset
    43
8fdc2c653d13 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1294
diff changeset
    44
    Since in Smalltalk/X, nil is represented by a special pointer value (NULL),
88
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    45
    there can be only one instance of UndefinedObject, and no subclassing is
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    46
    possible. 
1303
8fdc2c653d13 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1294
diff changeset
    47
    (to be exact: subclassing UndefinedObject is technically possible, 
8fdc2c653d13 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1294
diff changeset
    48
     but instances of it would not be recognized as being nil 
8fdc2c653d13 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1294
diff changeset
    49
     - therefore, subclassing is blocked and an error is raised when it is tried)
8fdc2c653d13 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1294
diff changeset
    50
8fdc2c653d13 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1294
diff changeset
    51
    For advanced users:
8fdc2c653d13 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1294
diff changeset
    52
      Beside the above role, nil can be subclassed (!!).
8fdc2c653d13 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1294
diff changeset
    53
      This creates a class which inherits no protocol whatsoever - not even
8fdc2c653d13 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1294
diff changeset
    54
      the basic interfaces as defined by the Object class. Subclasses of nil
8fdc2c653d13 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1294
diff changeset
    55
      are useful if all messages send to instances should trap into the
8fdc2c653d13 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1294
diff changeset
    56
      #doesNotUnderstand: method. For example, proxy objects are typically defined
8fdc2c653d13 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1294
diff changeset
    57
      this way.
1294
e26bbb61f6b2 documentation
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
    58
e26bbb61f6b2 documentation
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
    59
    [author:]
e26bbb61f6b2 documentation
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
    60
        Claus Gittinger
88
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    61
"
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    62
! !
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    63
a27a279701f8 Initial revision
claus
parents:
diff changeset
    64
!UndefinedObject class methodsFor:'instance creation'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    65
a27a279701f8 Initial revision
claus
parents:
diff changeset
    66
basicNew
a27a279701f8 Initial revision
claus
parents:
diff changeset
    67
    "catch new - there MUST be only one nil in the system"
a27a279701f8 Initial revision
claus
parents:
diff changeset
    68
a27a279701f8 Initial revision
claus
parents:
diff changeset
    69
    ^ nil
a27a279701f8 Initial revision
claus
parents:
diff changeset
    70
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    71
a27a279701f8 Initial revision
claus
parents:
diff changeset
    72
basicNew:size
a27a279701f8 Initial revision
claus
parents:
diff changeset
    73
    "catch new - there MUST be only one nil in the system"
a27a279701f8 Initial revision
claus
parents:
diff changeset
    74
a27a279701f8 Initial revision
claus
parents:
diff changeset
    75
    ^ nil
a27a279701f8 Initial revision
claus
parents:
diff changeset
    76
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
    77
51
9b7ae5e18f3e *** empty log message ***
claus
parents: 41
diff changeset
    78
!UndefinedObject class methodsFor:'queries'!
9b7ae5e18f3e *** empty log message ***
claus
parents: 41
diff changeset
    79
9b7ae5e18f3e *** empty log message ***
claus
parents: 41
diff changeset
    80
canBeSubclassed
9b7ae5e18f3e *** empty log message ***
claus
parents: 41
diff changeset
    81
    "return true, if its allowed to create subclasses of the receiver.
9b7ae5e18f3e *** empty log message ***
claus
parents: 41
diff changeset
    82
     Return nil here - since it is NOT possible for UndefinedObject"
9b7ae5e18f3e *** empty log message ***
claus
parents: 41
diff changeset
    83
9b7ae5e18f3e *** empty log message ***
claus
parents: 41
diff changeset
    84
    ^ false
9b7ae5e18f3e *** empty log message ***
claus
parents: 41
diff changeset
    85
! !
9b7ae5e18f3e *** empty log message ***
claus
parents: 41
diff changeset
    86
695
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    87
!UndefinedObject methodsFor:'copying'!
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
copy
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    90
    "return a shallow copy of myself
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    91
     - since there is only one nil in the system return self"
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    92
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    93
    ^ self
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    94
!
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
deepCopy
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    97
    "return a deep copy of myself
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    98
     - since there is only one nil in the system return self"
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    99
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   100
    ^ self
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   101
!
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
deepCopyUsing:aDictionary
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   104
    "return a deep copy of myself
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   105
     - since there is only one nil in the system return self"
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   106
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   107
    ^ self
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   108
!
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
shallowCopy
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   111
    "return a shallow copy of myself
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   112
     - since there is only one nil in the system return self"
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   113
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   114
    ^ self
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   115
!
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   116
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   117
simpleDeepCopy
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   118
    "return a deep copy of myself
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   119
     - since there is only one nil in the system return self"
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   120
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   121
    ^ self
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   122
! !
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   123
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   124
!UndefinedObject methodsFor:'error catching'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   125
a27a279701f8 Initial revision
claus
parents:
diff changeset
   126
basicAt:index
a27a279701f8 Initial revision
claus
parents:
diff changeset
   127
    "catch array access - its illegal
a27a279701f8 Initial revision
claus
parents:
diff changeset
   128
     defined here since basicAt: in Object ommits the nil-check"
a27a279701f8 Initial revision
claus
parents:
diff changeset
   129
a27a279701f8 Initial revision
claus
parents:
diff changeset
   130
    ^ self notIndexed
a27a279701f8 Initial revision
claus
parents:
diff changeset
   131
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   132
a27a279701f8 Initial revision
claus
parents:
diff changeset
   133
basicAt:index put:anObject
a27a279701f8 Initial revision
claus
parents:
diff changeset
   134
    "catch array access - its illegal
a27a279701f8 Initial revision
claus
parents:
diff changeset
   135
     defined here since basicAt:put: in Object ommits the nil-check"
a27a279701f8 Initial revision
claus
parents:
diff changeset
   136
a27a279701f8 Initial revision
claus
parents:
diff changeset
   137
    ^ self notIndexed
a27a279701f8 Initial revision
claus
parents:
diff changeset
   138
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
   139
a27a279701f8 Initial revision
claus
parents:
diff changeset
   140
!UndefinedObject methodsFor:'printing & storing'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   141
63
1f0cdefb013f *** empty log message ***
claus
parents: 51
diff changeset
   142
printOn: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"
1f0cdefb013f *** empty log message ***
claus
parents: 51
diff changeset
   145
1f0cdefb013f *** empty log message ***
claus
parents: 51
diff changeset
   146
    aStream nextPutAll:'nil'
1f0cdefb013f *** empty log message ***
claus
parents: 51
diff changeset
   147
!
1f0cdefb013f *** empty log message ***
claus
parents: 51
diff changeset
   148
695
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   149
printString
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   150
    "return a string for printing 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'
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   153
!
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   154
63
1f0cdefb013f *** empty log message ***
claus
parents: 51
diff changeset
   155
storeOn:aStream
1f0cdefb013f *** empty log message ***
claus
parents: 51
diff changeset
   156
    "append a printed representation of the receiver to the
1f0cdefb013f *** empty log message ***
claus
parents: 51
diff changeset
   157
     argument, aStream, which allows reconstruction of it"
1f0cdefb013f *** empty log message ***
claus
parents: 51
diff changeset
   158
1f0cdefb013f *** empty log message ***
claus
parents: 51
diff changeset
   159
    ^ self printOn:aStream
695
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   160
!
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   161
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   162
storeString
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   163
    "return a string for storing myself"
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   164
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   165
    ^ 'nil'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   166
! !
2
claus
parents: 1
diff changeset
   167
77
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   168
!UndefinedObject methodsFor:'subclass creation'!
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   169
202
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   170
nilSubclass:selector args:args
356
claus
parents: 293
diff changeset
   171
    "common helper for subclass creation.
claus
parents: 293
diff changeset
   172
     Creates a nil-superclass class with entries for the minimum
claus
parents: 293
diff changeset
   173
     required protocol (#class, #isBehavior and #doesNotUnderstand:).
claus
parents: 293
diff changeset
   174
     These are required to avoid getting into deep trouble when
claus
parents: 293
diff changeset
   175
     inspecting or debugging instances of this new class.
77
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   176
356
claus
parents: 293
diff changeset
   177
     The methods get a modified source code to remind you that these
claus
parents: 293
diff changeset
   178
     methods were automatically generated."
claus
parents: 293
diff changeset
   179
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1303
diff changeset
   180
    |newClass methodDict method|
202
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   181
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1303
diff changeset
   182
    Class withoutUpdatingChangesDo:[
1029
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   183
        newClass := Object perform:selector withArguments:args
77
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   184
    ].
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   185
    newClass notNil ifTrue:[
1029
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   186
        newClass setSuperclass:nil.
1803
754f9205b651 meta's superclass should be class - not Object.
Claus Gittinger <cg@exept.de>
parents: 1638
diff changeset
   187
        newClass class setSuperclass:Class.
356
claus
parents: 293
diff changeset
   188
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1303
diff changeset
   189
        newClass methodDictionary size == 0 ifTrue:[
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1303
diff changeset
   190
            "
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1303
diff changeset
   191
             copy over method objects from Object
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1303
diff changeset
   192
             and modify the source code
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1303
diff changeset
   193
            "
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1303
diff changeset
   194
            methodDict := MethodDictionary new:3.
1638
8df0060e4d73 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
   195
            #(#class #isBehavior #doesNotUnderstand:) do:[:sel|
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1303
diff changeset
   196
                method := (Object compiledMethodAt:sel) copy.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1303
diff changeset
   197
                method source: method source , '
356
claus
parents: 293
diff changeset
   198
"
claus
parents: 293
diff changeset
   199
*** WARNING
claus
parents: 293
diff changeset
   200
***
claus
parents: 293
diff changeset
   201
*** this method has been automatically created,
claus
parents: 293
diff changeset
   202
*** since all nil-subclasses should respond to some minimum required
claus
parents: 293
diff changeset
   203
*** protocol.
claus
parents: 293
diff changeset
   204
***
claus
parents: 293
diff changeset
   205
*** Inspection and/or debugging of instances may not be possible,
claus
parents: 293
diff changeset
   206
*** if you remove/change this method. 
claus
parents: 293
diff changeset
   207
"
claus
parents: 293
diff changeset
   208
'.
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1303
diff changeset
   209
                methodDict at:sel put:method.
1029
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   210
            ].
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1303
diff changeset
   211
            newClass methodDictionary:methodDict.
1029
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   212
            Class addChangeRecordForClass:newClass.
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   213
        ]
77
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   214
    ].
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   215
    ^ newClass
1029
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   216
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1303
diff changeset
   217
    "Modified: 12.6.1996 / 10:46:15 / stefan"
1803
754f9205b651 meta's superclass should be class - not Object.
Claus Gittinger <cg@exept.de>
parents: 1638
diff changeset
   218
    "Modified: 22.10.1996 / 20:30:06 / cg"
202
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   219
!
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   220
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   221
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s category:cat
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   222
    "create a new class which has nil as superclass 
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   223
     - i.e. traps into doesNotUnderstand: for all of its messages."
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   224
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   225
    ^ self nilSubclass:(thisContext selector) args:(thisContext args)
695
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   226
!
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   227
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   228
variableByteSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s category:cat
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   229
    "create a new class which has nil as superclass 
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   230
     - i.e. traps into doesNotUnderstand: for all of its messages."
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
    ^ self nilSubclass:(thisContext selector) args:(thisContext args)
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   233
!
77
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   234
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   235
variableSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s category:cat
159
514c749165c3 *** empty log message ***
claus
parents: 95
diff changeset
   236
    "create a new class which has nil as superclass 
514c749165c3 *** empty log message ***
claus
parents: 95
diff changeset
   237
     - i.e. traps into doesNotUnderstand: for all of its messages."
77
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   238
202
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   239
    ^ self nilSubclass:(thisContext selector) args:(thisContext args)
695
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
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   242
!UndefinedObject methodsFor:'testing'!
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
basicSize
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   245
    "return the number of indexed instvars
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   246
     defined here since size in Object ommits the nil-check"
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   247
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   248
    ^ 0
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
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   251
hash
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   252
    "return an integer useful as a hash key"
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   253
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   254
    ^ 0
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   255
!
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   256
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   257
identityHash
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   258
    "return an integer useful as a hash key"
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
    ^ 0
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   261
!
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
isLiteral
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   264
    "return true, if the receiver can be used as a literal
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   265
     (i.e. can be used in constant arrays)"
77
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   266
695
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   267
    ^ true
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   268
!
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   269
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   270
isNil
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   271
    "return true if I am nil - since I am, return true"
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   272
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   273
    ^ true
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   274
!
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
notNil
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   277
    "return true if I am not nil - since I am nil, return false"
77
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   278
695
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   279
    ^ false
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
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   282
size
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   283
    "return the number of indexed instvars
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   284
     defined here since size in Object ommits the nil-check"
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   285
 
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   286
    ^ 0
77
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   287
! !
695
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   288
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   289
!UndefinedObject class methodsFor:'documentation'!
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   290
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   291
version
1803
754f9205b651 meta's superclass should be class - not Object.
Claus Gittinger <cg@exept.de>
parents: 1638
diff changeset
   292
    ^ '$Header: /cvs/stx/stx/libbasic/UndefinedObject.st,v 1.26 1996-10-22 19:38:13 cg Exp $'
695
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   293
! !