*** empty log message ***
authorClaus Gittinger <cg@exept.de>
Thu, 05 Jun 2003 20:39:33 +0200
changeset 1424 eb987ab75c1f
parent 1423 6460943f32b7
child 1425 4f698bf5ff76
*** empty log message ***
Structure.st
--- a/Structure.st	Wed Jun 04 11:32:58 2003 +0200
+++ b/Structure.st	Thu Jun 05 20:39:33 2003 +0200
@@ -13,10 +13,10 @@
 "{ Package: 'stx:libcomp' }"
 
 Object subclass:#Structure
-	instanceVariableNames:'superclass flags methodDictionary otherSupers instSize i1 i2 i3
-		i4 i5 i6 i7 i8 i9 i10 i11 i12 i13 i14 i15 i16 i17 i18 i19 i20 i21
-		i22 i23 i24 i25 i26 i27 i28 i29 i30 i31 i32 i33 i34 i35 i36 i37
-		i38 i39 i40 i41 i42 i43 i44 i45 i46 i47 i48 i49 i50'
+	instanceVariableNames:'superclass flags methodDictionary instSize i1 i2 i3 i4 i5 i6 i7
+		i8 i9 i10 i11 i12 i13 i14 i15 i16 i17 i18 i19 i20 i21 i22 i23 i24
+		i25 i26 i27 i28 i29 i30 i31 i32 i33 i34 i35 i36 i37 i38 i39 i40
+		i41 i42 i43 i44 i45 i46 i47 i48 i49 i50'
 	classVariableNames:'OneInstance DummyClass ReadAccessMethods WriteAccessMethods
 		OtherMethods OtherSelectors'
 	poolDictionaries:''
@@ -123,6 +123,10 @@
 
 initialize
     OneInstance isNil ifTrue:[
+        Behavior instSize ~~ 4 ifTrue:[
+            self halt:'must change definition of this class'.
+        ].
+
         OneInstance := self basicNew.
 
         DummyClass := Behavior shallowCopy.
@@ -198,7 +202,7 @@
      The argument must be a sequenceable collection of symbols.
      The new structures values are set to corresponding values from the second argument, values."
 
-    |arr sels mthds nInsts|
+    |arr sels mthds nInsts behviorsInstSize|
 
     nInsts := names size.
 
@@ -212,15 +216,15 @@
 
     "/ create a prototype object as an array ...
     "/ the object will be its own class, and have the indexable flag bit set;
-    "/ therefore, the first 5 instVars must correspond to Behavior instvars,
+    "/ therefore, the first behviorsInstSize instVars must correspond to Behavior instvars,
     "/ the remaining ones will be the indexed instvars.
+    behviorsInstSize := Behavior instSize.
 
-    arr := Array new:(nInsts + 5).
+    arr := Array new:(behviorsInstSize + nInsts).
     arr at:1 put:nil.                                                   "/ superclass
     arr at:2 put:(Behavior flagBehavior bitOr:Behavior flagPointers).   "/ flags
     arr at:3 put:(MethodDictionary withKeys:sels andValues:mthds).      "/ selectors & methods
-    arr at:4 put:nil.                                                   "/ other supers
-    arr at:5 put:5.                                                     "/ instSize 
+    arr at:4 put:behviorsInstSize.                                      "/ instSize 
 
     "/ now, the big trick ...
 
@@ -1185,22 +1189,6 @@
     ^ methodDictionary
 !
 
-otherSupers
-    "return otherSupers"
-
-    ^ otherSupers
-
-    "Created: 13.5.1996 / 21:19:24 / cg"
-!
-
-otherSupers:something
-    "set otherSupers"
-
-    otherSupers := something.
-
-    "Created: 13.5.1996 / 21:19:24 / cg"
-!
-
 superclass
     "return superclass - required class protocol"
 
@@ -1250,6 +1238,9 @@
         ^ InspectorView openOn:self
     ].
 
+    sel == #inspectorClass ifTrue:[
+        ^ InspectorView
+    ].
     sel == #inspect ifTrue:[
         ^ InspectorView openOn:self
     ].
@@ -1417,7 +1408,7 @@
 !Structure class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libcomp/Structure.st,v 1.16 2003-03-02 20:42:55 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libcomp/Structure.st,v 1.17 2003-06-05 18:39:33 cg Exp $'
 ! !
 
 Structure initialize!