Array.st
changeset 4474 d34823aa554e
parent 4385 dbe7d1e8c54c
child 4661 9ebc7608738d
--- a/Array.st	Sat Jul 31 14:43:43 1999 +0200
+++ b/Array.st	Sat Jul 31 14:45:01 1999 +0200
@@ -294,21 +294,22 @@
     REGISTER OBJ cls;
 
     if (__isSmallInteger(index)) {
-        indx = __intVal(index) - 1;
-        slf = self;
+	indx = __intVal(index) - 1;
+	slf = self;
 
-        nIndex = __BYTES2OBJS__(__qSize(slf) - OHDR_SIZE);
-        if ((cls = __qClass(slf)) != Array) {
-            if (indx < 0) goto badIndex;
-            indx += __intVal(__ClassInstPtr(cls)->c_ninstvars);
-        }
-        if ((unsigned)indx < (unsigned)nIndex) {
-            RETURN ( __InstPtr(slf)->i_instvars[indx] );
-        }
+	nIndex = __BYTES2OBJS__(__qSize(slf) - OHDR_SIZE);
+	if ((cls = __qClass(slf)) != Array) {
+	    if (indx < 0) goto badIndex;
+	    indx += __intVal(__ClassInstPtr(cls)->c_ninstvars);
+	}
+	if ((unsigned)indx < (unsigned)nIndex) {
+	    RETURN ( __InstPtr(slf)->i_instvars[indx] );
+	}
     }
 badIndex: ;
 %}.
-    ^ super at:index
+"/    ^ super at:index
+    ^ super basicAt:index   "/ knowing that super-#at: does #basicAt:
 !
 
 at:index put:anObject
@@ -327,23 +328,24 @@
     REGISTER OBJ cls;
 
     if (__isSmallInteger(index)) {
-        indx = __intVal(index) - 1;
-        slf = self;
+	indx = __intVal(index) - 1;
+	slf = self;
 
-        nIndex = __BYTES2OBJS__(__qSize(slf) - OHDR_SIZE);
-        if ((cls = __qClass(slf)) != Array) {
-            if (indx < 0) goto badIndex;
-            indx += __intVal(__ClassInstPtr(cls)->c_ninstvars);
-        }
-        if ((unsigned)indx < (unsigned)nIndex) {
-            __InstPtr(slf)->i_instvars[indx] = anObject;
-            __STORE(slf, anObject);
-            RETURN ( anObject );
-        }
+	nIndex = __BYTES2OBJS__(__qSize(slf) - OHDR_SIZE);
+	if ((cls = __qClass(slf)) != Array) {
+	    if (indx < 0) goto badIndex;
+	    indx += __intVal(__ClassInstPtr(cls)->c_ninstvars);
+	}
+	if ((unsigned)indx < (unsigned)nIndex) {
+	    __InstPtr(slf)->i_instvars[indx] = anObject;
+	    __STORE(slf, anObject);
+	    RETURN ( anObject );
+	}
     }
 badIndex: ;
 %}.
-    ^ super at:index put:anObject
+"/    ^ super at:index put:anObject
+    ^ super basicAt:index put:anObject  "/ knowing that super-#at:put: does #basicAt:put:
 
     "Modified: 19.4.1996 / 11:16:42 / cg"
 !
@@ -360,17 +362,17 @@
     REGISTER OBJ cls;
 
     if (__isSmallInteger(index)) {
-        indx = __intVal(index) - 1;
-        slf = self;
+	indx = __intVal(index) - 1;
+	slf = self;
 
-        nIndex = __BYTES2OBJS__(__qSize(slf) - OHDR_SIZE);
-        if ((cls = __qClass(slf)) != Array) {
-            if (indx < 0) goto badIndex;
-            indx += __intVal(__ClassInstPtr(cls)->c_ninstvars);
-        }
-        if ((unsigned)indx < (unsigned)nIndex) {
-            RETURN ( __InstPtr(slf)->i_instvars[indx] );
-        }
+	nIndex = __BYTES2OBJS__(__qSize(slf) - OHDR_SIZE);
+	if ((cls = __qClass(slf)) != Array) {
+	    if (indx < 0) goto badIndex;
+	    indx += __intVal(__ClassInstPtr(cls)->c_ninstvars);
+	}
+	if ((unsigned)indx < (unsigned)nIndex) {
+	    RETURN ( __InstPtr(slf)->i_instvars[indx] );
+	}
     }
 badIndex: ;
 %}.
@@ -390,19 +392,19 @@
     REGISTER OBJ cls;
 
     if (__isSmallInteger(index)) {
-        indx = __intVal(index) - 1;
-        slf = self;
+	indx = __intVal(index) - 1;
+	slf = self;
 
-        nIndex = __BYTES2OBJS__(__qSize(slf) - OHDR_SIZE);
-        if ((cls = __qClass(slf)) != Array) {
-            if (indx < 0) goto badIndex;
-            indx += __intVal(__ClassInstPtr(cls)->c_ninstvars);
-        }
-        if ((unsigned)indx < (unsigned)nIndex) {
-            __InstPtr(slf)->i_instvars[indx] = anObject;
-            __STORE(slf, anObject);
-            RETURN ( anObject );
-        }
+	nIndex = __BYTES2OBJS__(__qSize(slf) - OHDR_SIZE);
+	if ((cls = __qClass(slf)) != Array) {
+	    if (indx < 0) goto badIndex;
+	    indx += __intVal(__ClassInstPtr(cls)->c_ninstvars);
+	}
+	if ((unsigned)indx < (unsigned)nIndex) {
+	    __InstPtr(slf)->i_instvars[indx] = anObject;
+	    __STORE(slf, anObject);
+	    RETURN ( anObject );
+	}
     }
 badIndex: ;
 %}.
@@ -2382,5 +2384,5 @@
 !Array class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Array.st,v 1.117 1999-07-14 23:38:38 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Array.st,v 1.118 1999-07-31 12:45:01 cg Exp $'
 ! !