added: #beImmutable
authorClaus Gittinger <cg@exept.de>
Thu, 07 Jun 2012 11:08:32 +0200
changeset 14158 8565a6b7f00a
parent 14157 1d68587ae2da
child 14159 cd88acc36933
added: #beImmutable changed: #asImmutableArray
Array.st
--- a/Array.st	Tue Jun 05 14:29:47 2012 +0200
+++ b/Array.st	Thu Jun 07 11:08:32 2012 +0200
@@ -431,8 +431,19 @@
 asImmutableArray
     "return a write-protected copy of myself"
 
-    self assert:(ImmutableArray notNil).
-    ^ self copy changeClassTo:ImmutableArray
+    "/ self assert:(ImmutableArray notNil).
+    ^ self copy beImmutable
+
+    "Modified: / 07-06-2012 / 11:06:48 / cg"
+!
+
+beImmutable
+    "make myself write-protected"
+
+    "/ self assert:(ImmutableArray notNil).
+    self changeClassTo:ImmutableArray
+
+    "Created: / 07-06-2012 / 11:06:33 / cg"
 ! !
 
 !Array methodsFor:'copying'!
@@ -2527,9 +2538,9 @@
 !Array class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Array.st,v 1.149 2010-09-21 06:57:51 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Array.st,v 1.150 2012-06-07 09:08:32 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/Array.st,v 1.149 2010-09-21 06:57:51 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Array.st,v 1.150 2012-06-07 09:08:32 cg Exp $'
 ! !