diff -r b4d3fba8e356 -r 5cca8a5308fc Iterator.st --- a/Iterator.st Thu Oct 17 15:03:59 2013 +0200 +++ b/Iterator.st Mon Oct 21 17:09:39 2013 +0200 @@ -308,6 +308,25 @@ !Iterator methodsFor:'enumerating'! +collect:aBlock as:aClass + "Reimplemented here as Iterator does not support #size" + + |newCollection| + + newCollection := aClass new. + self do:[:el | + newCollection add:(aBlock value:el). + ]. + ^ newCollection + + " + #(one two three four five six) collect:[:element | element asUppercase] as:OrderedCollection + 'abcdef' collect:[:char | char digitValue] as:ByteArray + " + + "Created: / 21-10-2013 / 16:07:53 / Jan Vrany " +! + do: aBlock block value: aBlock ! @@ -398,10 +417,10 @@ !Iterator class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libbasic2/Iterator.st,v 1.25 2013-05-21 20:22:21 cg Exp $' + ^ '$Header: /cvs/stx/stx/libbasic2/Iterator.st,v 1.26 2013-10-21 15:09:39 vrany Exp $' ! version_CVS - ^ '$Header: /cvs/stx/stx/libbasic2/Iterator.st,v 1.25 2013-05-21 20:22:21 cg Exp $' + ^ '$Header: /cvs/stx/stx/libbasic2/Iterator.st,v 1.26 2013-10-21 15:09:39 vrany Exp $' ! !