[squeak-dev] #collect: on strings
Colin Putney
cputney at wiresong.ca
Wed Jun 25 16:35:26 UTC 2008
On 25-Jun-08, at 1:46 AM, Damien Cassou wrote:
> On Wed, Jun 25, 2008 at 9:39 AM, cdrick <cdrick65 at gmail.com> wrote:
>> (Array withAll: 'something') collect: [ :letter | letter isVowel ].
>> #(false true false true false false true false false)
>
> I did that
>
> 'something' asArray collect: [ :letter | letter isVowel ].
>
> do get the desired behavior. However, it is not intuitive to me.
Let's do a thought experiment. What do you intuitively expect from this?
'something' collect: [:letter | letter asUppercase].
Something other than a String? If it did answer something other than a
String, would that be more surprising or less surprising than the
original example?
Colin
More information about the Squeak-dev
mailing list
|