UndefinedObject.st
author Claus Gittinger <cg@exept.de>
Thu, 25 Apr 1996 18:20:46 +0200
changeset 1290 15ba3221b89b
parent 1030 a21295a6725d
child 1294 e26bbb61f6b2
permissions -rw-r--r--
documentation
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
"
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
    [
1029
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
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:[
1029
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   174
        newClass setSuperclass:nil.
356
claus
parents: 293
diff changeset
   175
1030
a21295a6725d oops - the last one did not do it
Claus Gittinger <cg@exept.de>
parents: 1029
diff changeset
   176
        newClass selectorArray size == 0 ifTrue:[
1029
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   177
        "
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   178
         copy over method objects from Object
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   179
        "
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   180
        newClass 
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   181
            setSelectors:(Array 
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   182
                            with:#class
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   183
                            with:#isBehavior 
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   184
                            with:#doesNotUnderstand:)
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   185
            methods:(mA := Array 
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   186
                            with:(Object compiledMethodAt:#class) copy
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   187
                            with:(Object compiledMethodAt:#isBehavior) copy
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   188
                            with:(Object compiledMethodAt:#doesNotUnderstand:) copy).
356
claus
parents: 293
diff changeset
   189
1029
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   190
        "
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   191
         and modify the source code
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   192
        "
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   193
        mA do:[:m |
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   194
            m source:m source , '
356
claus
parents: 293
diff changeset
   195
"
claus
parents: 293
diff changeset
   196
*** WARNING
claus
parents: 293
diff changeset
   197
***
claus
parents: 293
diff changeset
   198
*** this method has been automatically created,
claus
parents: 293
diff changeset
   199
*** since all nil-subclasses should respond to some minimum required
claus
parents: 293
diff changeset
   200
*** protocol.
claus
parents: 293
diff changeset
   201
***
claus
parents: 293
diff changeset
   202
*** Inspection and/or debugging of instances may not be possible,
claus
parents: 293
diff changeset
   203
*** if you remove/change this method. 
claus
parents: 293
diff changeset
   204
"
claus
parents: 293
diff changeset
   205
'.
1029
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   206
            ].
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   207
            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
   208
        ]
77
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   209
    ].
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   210
    ^ newClass
1029
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   211
1030
a21295a6725d oops - the last one did not do it
Claus Gittinger <cg@exept.de>
parents: 1029
diff changeset
   212
    "Modified: 28.2.1996 / 15:47:41 / cg"
202
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   213
!
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   214
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   215
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s category:cat
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   216
    "create a new class which has nil as superclass 
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   217
     - i.e. traps into doesNotUnderstand: for all of its messages."
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   218
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   219
    ^ self nilSubclass:(thisContext selector) args:(thisContext args)
695
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   220
!
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
variableByteSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s category:cat
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   223
    "create a new class which has nil as superclass 
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   224
     - i.e. traps into doesNotUnderstand: for all of its messages."
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   225
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   226
    ^ self nilSubclass:(thisContext selector) args:(thisContext args)
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   227
!
77
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   228
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   229
variableSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s category:cat
159
514c749165c3 *** empty log message ***
claus
parents: 95
diff changeset
   230
    "create a new class which has nil as superclass 
514c749165c3 *** empty log message ***
claus
parents: 95
diff changeset
   231
     - i.e. traps into doesNotUnderstand: for all of its messages."
77
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   232
202
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   233
    ^ self nilSubclass:(thisContext selector) args:(thisContext args)
695
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   234
! !
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   235
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   236
!UndefinedObject methodsFor:'testing'!
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
basicSize
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   239
    "return the number of indexed instvars
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   240
     defined here since size in Object ommits the nil-check"
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
    ^ 0
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
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   245
hash
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   246
    "return an integer useful as a hash key"
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
identityHash
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
isLiteral
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   258
    "return true, if the receiver can be used as a literal
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   259
     (i.e. can be used in constant arrays)"
77
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   260
695
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   261
    ^ 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
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   264
isNil
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   265
    "return true if I am nil - since I am, return true"
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   266
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
notNil
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   271
    "return true if I am not nil - since I am nil, return false"
77
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   272
695
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   273
    ^ false
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
size
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   277
    "return the number of indexed instvars
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   278
     defined here since size in Object ommits the nil-check"
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   279
 
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   280
    ^ 0
77
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   281
! !
695
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   282
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   283
!UndefinedObject class methodsFor:'documentation'!
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   284
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   285
version
1030
a21295a6725d oops - the last one did not do it
Claus Gittinger <cg@exept.de>
parents: 1029
diff changeset
   286
    ^ '$Header: /cvs/stx/stx/libbasic/UndefinedObject.st,v 1.21 1996-02-28 14:50:02 cg Exp $'
695
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   287
! !