--- a/SequenceableCollection.st Tue Jul 13 17:42:02 1999 +0200
+++ b/SequenceableCollection.st Tue Jul 13 18:12:05 1999 +0200
@@ -75,14 +75,6 @@
!SequenceableCollection class methodsFor:'instance creation'!
-decodeFromLiteralArray:anArray
- "create & return a new instance from information encoded in anArray."
-
- ^ (self new:(anArray size - 1)) fromLiteralArrayEncoding:anArray.
-
-
-!
-
new:size withAll:element
"return a new collection of size, where all elements are
initialized to element."
@@ -1263,37 +1255,11 @@
"Modified: / 18.5.1999 / 14:51:58 / cg"
!
-fromLiteralArrayEncoding:anArray
- "reconstructed my values from a literal encoding array."
-
- anArray keysAndValuesDo:[:idx :el |
- idx ~~ 1 ifTrue:[
- self at:(idx-1) put:el decodeAsLiteralArray
- ]
- ]
-
- "
- (Array with:(Color red:50 green:50 blue:50)
- with:(1 @ 2)
- ) literalArrayEncoding
- decodeAsLiteralArray
- "
-
- "Modified: 22.4.1996 / 13:00:56 / cg"
-!
-
literalArrayEncoding
"encode myself as an array literal, from which a copy of the receiver
can be reconstructed with #decodeAsLiteralArray."
- |a|
-
- a := Array new:self size + 1.
- self keysAndValuesDo:[:idx :el |
- a at:(idx+1) put:el literalArrayEncoding
- ].
- a at:1 put:self class name.
- ^ a
+ ^ (self collect:[:el | el literalArrayEncoding]) asArray
"
(Array with:(Color red:50 green:50 blue:50)
@@ -4303,6 +4269,6 @@
!SequenceableCollection class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/SequenceableCollection.st,v 1.108 1999-07-13 15:42:02 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/SequenceableCollection.st,v 1.109 1999-07-13 16:12:05 cg Exp $'
! !
SequenceableCollection initialize!