ImmutableArray.st
changeset 12538 e6bf8c42e1d4
parent 12492 d63fd473f6e7
child 14023 a61f74fd04c9
--- a/ImmutableArray.st	Mon Nov 16 09:58:03 2009 +0100
+++ b/ImmutableArray.st	Mon Nov 16 09:59:40 2009 +0100
@@ -9,7 +9,7 @@
  other person.  No title to or ownership of the software is
  hereby transferred.
 "
-"{ Package: 'stx:libcomp' }"
+"{ Package: 'stx:libbasic' }"
 
 Array variableSubclass:#ImmutableArray
 	instanceVariableNames:''
@@ -39,7 +39,7 @@
     By default, array literals in smalltalk are mutable objects. That
     may lead to some subtle (and hard to find errors), if some method passes
     a literal array constant as argument to someone else, who changes the
-    array using at:put: like messages. Since the array object is kept in 
+    array using at:put: like messages. Since the array object is kept in
     the first methods literals, the array constant has now been changed without
     having the method's sourcecode reflect this. Thus, the method will
     behave differently from what its source may make you think.
@@ -48,7 +48,7 @@
     configured to create instances of this ImmutableArray instead of Arrays
     for array literals. Instances of ImmutableArray catch storing accesses and
     enter the debugger. Although useful, this feature is disabled by default
-    for compatibility to other smalltalk implementations. 
+    for compatibility to other smalltalk implementations.
     (Also, if turned on, this makes inspecting array literals entered in
      a workspace somewhat strange: you cannot modify it any longer).
 
@@ -57,40 +57,40 @@
 
 
     ATTENTION:
-        there may be still code around which checks for explicit class being Array
-        (both in Smalltalk and in primitive code). All code like foo 'class == Array'
-        or '__isArray' will not work with ImmutableArrays.
-        A somewhat better approach would be to either add a flag to the object (mutability)
-        and check this dynamically (expensive) or to place immutable objects into a readonly
-        memory segment (the good solution). We will eventually implement the second in the future...
+	there may be still code around which checks for explicit class being Array
+	(both in Smalltalk and in primitive code). All code like foo 'class == Array'
+	or '__isArray' will not work with ImmutableArrays.
+	A somewhat better approach would be to either add a flag to the object (mutability)
+	and check this dynamically (expensive) or to place immutable objects into a readonly
+	memory segment (the good solution). We will eventually implement the second in the future...
 
     [see also:]
-        ImmutableString
-        Parser Scanner
+	ImmutableString
+	Parser Scanner
 
     [author:]
-        Claus Gittinger
+	Claus Gittinger
 "
 ! !
 
 !ImmutableArray methodsFor:'accessing'!
 
-at:index put:value 
+at:index put:value
     "Trigger an error if an immutable array is stored into.
      The store will be performed (for compatibility reasons) if you continue
      in the debugger."
-    
+
     self noModificationError.
     ^ super at:index put:value
 
     "Modified: / 3.8.1998 / 14:45:23 / cg"
 !
 
-basicAt:index put:value 
+basicAt:index put:value
     "Trigger an error if an immutable array is stored into.
      The store will be performed (for compatibility reasons) if you continue
      in the debugger."
-    
+
     self noModificationError.
     ^ super basicAt:index put:value
 
@@ -141,12 +141,12 @@
 
 !ImmutableArray methodsFor:'error handling'!
 
-creator 
+creator
     "find the method that contains me"
 
     ^ Method allSubInstances detect:[:aMethod | (aMethod referencesGlobal:self)] ifNone:nil.
 
-    " 
+    "
       #(1 2 3) creator
     "
 
@@ -161,7 +161,7 @@
 
     creator := self creator.
     creator notNil ifTrue:[
-        msg := ' (' , creator whoString , ')'
+	msg := ' (' , creator whoString , ')'
     ].
     context := thisContext sender.
      "
@@ -171,10 +171,10 @@
      If you don't want this, press abort and check your code.
      Storing into literals is VERY VERY bad coding style.
     "
-    NoModificationError 
-        raiseRequestWith:self
-        errorString:msg
-        in:context.
+    NoModificationError
+	raiseRequestWith:self
+	errorString:msg
+	in:context.
 
     "Created: / 3.8.1998 / 14:47:45 / cg"
 ! !
@@ -200,10 +200,10 @@
 
 !ImmutableArray methodsFor:'specials'!
 
-become:anotherObject 
+become:anotherObject
     "trigger an error if I should become something else
      (this would be an even more tricky manipulation)"
-    
+
     self noModificationError.
     ^ super become:anotherObject
 !
@@ -211,7 +211,7 @@
 becomeNil
     "trigger an error if I should become nil
      (this would be an even more tricky manipulation)"
-    
+
     self noModificationError.
     ^ super becomeNil
 ! !
@@ -219,9 +219,9 @@
 !ImmutableArray class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ImmutableArray.st,v 1.27 2009-11-05 17:37:55 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ImmutableArray.st,v 1.28 2009-11-16 08:59:40 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/ImmutableArray.st,v 1.27 2009-11-05 17:37:55 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ImmutableArray.st,v 1.28 2009-11-16 08:59:40 stefan Exp $'
 ! !