UndefObj.st
author Claus Gittinger <cg@exept.de>
Thu, 25 Apr 1996 19:02:53 +0200
changeset 1295 83f594f05c52
parent 1294 e26bbb61f6b2
child 1303 8fdc2c653d13
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)
1294
e26bbb61f6b2 documentation
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
    48
e26bbb61f6b2 documentation
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
    49
    [author:]
e26bbb61f6b2 documentation
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
    50
        Claus Gittinger
88
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    51
"
81dacba7a63a *** empty log message ***
claus
parents: 77
diff changeset
    52
! !
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    53
a27a279701f8 Initial revision
claus
parents:
diff changeset
    54
!UndefinedObject class methodsFor:'instance creation'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    55
a27a279701f8 Initial revision
claus
parents:
diff changeset
    56
basicNew
a27a279701f8 Initial revision
claus
parents:
diff changeset
    57
    "catch new - there MUST be only one nil in the system"
a27a279701f8 Initial revision
claus
parents:
diff changeset
    58
a27a279701f8 Initial revision
claus
parents:
diff changeset
    59
    ^ nil
a27a279701f8 Initial revision
claus
parents:
diff changeset
    60
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    61
a27a279701f8 Initial revision
claus
parents:
diff changeset
    62
basicNew:size
a27a279701f8 Initial revision
claus
parents:
diff changeset
    63
    "catch new - there MUST be only one nil in the system"
a27a279701f8 Initial revision
claus
parents:
diff changeset
    64
a27a279701f8 Initial revision
claus
parents:
diff changeset
    65
    ^ nil
a27a279701f8 Initial revision
claus
parents:
diff changeset
    66
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
    67
51
9b7ae5e18f3e *** empty log message ***
claus
parents: 41
diff changeset
    68
!UndefinedObject class methodsFor:'queries'!
9b7ae5e18f3e *** empty log message ***
claus
parents: 41
diff changeset
    69
9b7ae5e18f3e *** empty log message ***
claus
parents: 41
diff changeset
    70
canBeSubclassed
9b7ae5e18f3e *** empty log message ***
claus
parents: 41
diff changeset
    71
    "return true, if its allowed to create subclasses of the receiver.
9b7ae5e18f3e *** empty log message ***
claus
parents: 41
diff changeset
    72
     Return nil here - since it is NOT possible for UndefinedObject"
9b7ae5e18f3e *** empty log message ***
claus
parents: 41
diff changeset
    73
9b7ae5e18f3e *** empty log message ***
claus
parents: 41
diff changeset
    74
    ^ false
9b7ae5e18f3e *** empty log message ***
claus
parents: 41
diff changeset
    75
! !
9b7ae5e18f3e *** empty log message ***
claus
parents: 41
diff changeset
    76
695
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    77
!UndefinedObject methodsFor:'copying'!
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    78
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    79
copy
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    80
    "return a shallow copy of myself
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    81
     - since there is only one nil in the system return self"
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
    ^ self
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    84
!
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    85
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    86
deepCopy
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    87
    "return a deep copy of myself
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    88
     - since there is only one nil in the system return self"
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
    ^ self
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    91
!
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
deepCopyUsing:aDictionary
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    94
    "return a deep copy of myself
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    95
     - since there is only one nil in the system return self"
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
    ^ self
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    98
!
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
shallowCopy
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   101
    "return a shallow copy of myself
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   102
     - since there is only one nil in the system return self"
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
    ^ self
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   105
!
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
simpleDeepCopy
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   108
    "return a deep copy of myself
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   109
     - since there is only one nil in the system return self"
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   110
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   111
    ^ self
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   112
! !
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   113
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   114
!UndefinedObject methodsFor:'error catching'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   115
a27a279701f8 Initial revision
claus
parents:
diff changeset
   116
basicAt:index
a27a279701f8 Initial revision
claus
parents:
diff changeset
   117
    "catch array access - its illegal
a27a279701f8 Initial revision
claus
parents:
diff changeset
   118
     defined here since basicAt: in Object ommits the nil-check"
a27a279701f8 Initial revision
claus
parents:
diff changeset
   119
a27a279701f8 Initial revision
claus
parents:
diff changeset
   120
    ^ self notIndexed
a27a279701f8 Initial revision
claus
parents:
diff changeset
   121
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   122
a27a279701f8 Initial revision
claus
parents:
diff changeset
   123
basicAt:index put:anObject
a27a279701f8 Initial revision
claus
parents:
diff changeset
   124
    "catch array access - its illegal
a27a279701f8 Initial revision
claus
parents:
diff changeset
   125
     defined here since basicAt:put: in Object ommits the nil-check"
a27a279701f8 Initial revision
claus
parents:
diff changeset
   126
a27a279701f8 Initial revision
claus
parents:
diff changeset
   127
    ^ self notIndexed
a27a279701f8 Initial revision
claus
parents:
diff changeset
   128
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
   129
a27a279701f8 Initial revision
claus
parents:
diff changeset
   130
!UndefinedObject methodsFor:'printing & storing'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   131
63
1f0cdefb013f *** empty log message ***
claus
parents: 51
diff changeset
   132
printOn:aStream
1f0cdefb013f *** empty log message ***
claus
parents: 51
diff changeset
   133
    "append a printed representation of the receiver to the
1f0cdefb013f *** empty log message ***
claus
parents: 51
diff changeset
   134
     argument, aStream"
1f0cdefb013f *** empty log message ***
claus
parents: 51
diff changeset
   135
1f0cdefb013f *** empty log message ***
claus
parents: 51
diff changeset
   136
    aStream nextPutAll:'nil'
1f0cdefb013f *** empty log message ***
claus
parents: 51
diff changeset
   137
!
1f0cdefb013f *** empty log message ***
claus
parents: 51
diff changeset
   138
695
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   139
printString
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   140
    "return a string for printing myself"
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   141
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   142
    ^ 'nil'
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   143
!
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   144
63
1f0cdefb013f *** empty log message ***
claus
parents: 51
diff changeset
   145
storeOn:aStream
1f0cdefb013f *** empty log message ***
claus
parents: 51
diff changeset
   146
    "append a printed representation of the receiver to the
1f0cdefb013f *** empty log message ***
claus
parents: 51
diff changeset
   147
     argument, aStream, which allows reconstruction of it"
1f0cdefb013f *** empty log message ***
claus
parents: 51
diff changeset
   148
1f0cdefb013f *** empty log message ***
claus
parents: 51
diff changeset
   149
    ^ self printOn:aStream
695
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   150
!
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
storeString
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   153
    "return a string for storing myself"
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   154
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   155
    ^ 'nil'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   156
! !
2
claus
parents: 1
diff changeset
   157
77
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   158
!UndefinedObject methodsFor:'subclass creation'!
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   159
202
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   160
nilSubclass:selector args:args
356
claus
parents: 293
diff changeset
   161
    "common helper for subclass creation.
claus
parents: 293
diff changeset
   162
     Creates a nil-superclass class with entries for the minimum
claus
parents: 293
diff changeset
   163
     required protocol (#class, #isBehavior and #doesNotUnderstand:).
claus
parents: 293
diff changeset
   164
     These are required to avoid getting into deep trouble when
claus
parents: 293
diff changeset
   165
     inspecting or debugging instances of this new class.
77
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   166
356
claus
parents: 293
diff changeset
   167
     The methods get a modified source code to remind you that these
claus
parents: 293
diff changeset
   168
     methods were automatically generated."
claus
parents: 293
diff changeset
   169
claus
parents: 293
diff changeset
   170
    |newClass mA|
202
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   171
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   172
    Class withoutUpdatingChangesDo:
77
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   173
    [
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 := Object perform:selector withArguments:args
77
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   175
    ].
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   176
    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
   177
        newClass setSuperclass:nil.
356
claus
parents: 293
diff changeset
   178
1030
a21295a6725d oops - the last one did not do it
Claus Gittinger <cg@exept.de>
parents: 1029
diff changeset
   179
        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
   180
        "
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   181
         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
   182
        "
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   183
        newClass 
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   184
            setSelectors:(Array 
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   185
                            with:#class
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   186
                            with:#isBehavior 
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   187
                            with:#doesNotUnderstand:)
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   188
            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
   189
                            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
   190
                            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
   191
                            with:(Object compiledMethodAt:#doesNotUnderstand:) copy).
356
claus
parents: 293
diff changeset
   192
1029
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   193
        "
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   194
         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
   195
        "
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   196
        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
   197
            m source:m 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
'.
1029
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   209
            ].
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   210
            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
   211
        ]
77
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   212
    ].
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   213
    ^ newClass
1029
c469a63e88e2 only redefine #class/#isbehavior/#doesNotUnderstand once (if no methods are present yet)
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   214
1030
a21295a6725d oops - the last one did not do it
Claus Gittinger <cg@exept.de>
parents: 1029
diff changeset
   215
    "Modified: 28.2.1996 / 15:47:41 / cg"
202
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   216
!
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   217
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   218
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s category:cat
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   219
    "create a new class which has nil as superclass 
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   220
     - i.e. traps into doesNotUnderstand: for all of its messages."
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   221
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   222
    ^ self nilSubclass:(thisContext selector) args:(thisContext args)
695
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   223
!
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   224
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   225
variableByteSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s category:cat
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   226
    "create a new class which has nil as superclass 
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   227
     - i.e. traps into doesNotUnderstand: for all of its messages."
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   228
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   229
    ^ self nilSubclass:(thisContext selector) args:(thisContext args)
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   230
!
77
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   231
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   232
variableSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s category:cat
159
514c749165c3 *** empty log message ***
claus
parents: 95
diff changeset
   233
    "create a new class which has nil as superclass 
514c749165c3 *** empty log message ***
claus
parents: 95
diff changeset
   234
     - i.e. traps into doesNotUnderstand: for all of its messages."
77
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   235
202
40ca7cc6fb9c *** empty log message ***
claus
parents: 159
diff changeset
   236
    ^ self nilSubclass:(thisContext selector) args:(thisContext args)
695
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
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   239
!UndefinedObject methodsFor:'testing'!
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
basicSize
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   242
    "return the number of indexed instvars
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   243
     defined here since size in Object ommits the nil-check"
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
    ^ 0
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
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   248
hash
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   249
    "return an integer useful as a hash key"
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
    ^ 0
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
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   254
identityHash
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   255
    "return an integer useful as a hash key"
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
    ^ 0
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
isLiteral
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   261
    "return true, if the receiver can be used as a literal
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   262
     (i.e. can be used in constant arrays)"
77
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   263
695
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   264
    ^ true
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
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   267
isNil
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   268
    "return true if I am nil - since I am, return true"
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
    ^ true
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
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   273
notNil
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   274
    "return true if I am not nil - since I am nil, return false"
77
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   275
695
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   276
    ^ false
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   277
!
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
size
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   280
    "return the number of indexed instvars
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   281
     defined here since size in Object ommits the nil-check"
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
    ^ 0
77
6c38ca59927f *** empty log message ***
claus
parents: 63
diff changeset
   284
! !
695
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
!UndefinedObject class methodsFor:'documentation'!
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   287
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   288
version
1294
e26bbb61f6b2 documentation
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   289
    ^ '$Header: /cvs/stx/stx/libbasic/Attic/UndefObj.st,v 1.22 1996-04-25 16:53:16 cg Exp $'
695
20ec350f92ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   290
! !