[squeak-dev] Re: #collect: on strings

Nicolas Cellier ncellier at ifrance.com
Wed Jun 25 12:36:33 UTC 2008


Damien Cassou <damien.cassou <at> gmail.com> writes:
> 
> Hi,
> 
> is it normal that the following code fails:
> 
> 'something' collect: [ :letter | letter isVowel ].
> 
> It fails because #collect: creates a new string and tries to put
> booleans in it. However, I don't think this is the desired behavior.
> 

That's not only the case with String

(ByteArray with: 255) collect: [:e | e + 1000].
(ShortIntegerArray with: 1) collect: [:e | e + 16r10000].
(FloatArray with: 1.0) collect: [:e | e printString].

Nicolas





More information about the Squeak-dev mailing list