Use of ByteArray>>collect: bug, feature, nuisance, or what?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Use of ByteArray>>collect: bug, feature, nuisance, or what?

Igor Stasenko
Hello,

i just noticed that #collect: used for ByteArray is quite crippling.
#(1 2 3 4) asByteArray collect: [:ea | ea hex ]

Sure i can do

bytearray asArray collect: [:ea | ea hex ]

but this is a bit confusing.. i even expected to get '^ self' in its
#asArray method (before trying it out), since
byte array is array.

I remember someone added new protocol, collect:into: .
Is it adopted already? If yes, then it seems time to migrate my stuff
to a newer image :)

But apart of it, do you think its ok to keep such #collect: behavior limitation?

'aaaaa' collect: [:ea | 1]
having same symthoms.. so it seems like i need to get some sleep.. :)

--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

Re: Use of ByteArray>>collect: bug, feature, nuisance, or what?

Nicolas Cellier
#[1 2 3 4] collect: [:ea | ea hex ] as: Array

2010/2/28 Igor Stasenko <[hidden email]>:

> Hello,
>
> i just noticed that #collect: used for ByteArray is quite crippling.
> #(1 2 3 4) asByteArray collect: [:ea | ea hex ]
>
> Sure i can do
>
> bytearray asArray collect: [:ea | ea hex ]
>
> but this is a bit confusing.. i even expected to get '^ self' in its
> #asArray method (before trying it out), since
> byte array is array.
>
> I remember someone added new protocol, collect:into: .
> Is it adopted already? If yes, then it seems time to migrate my stuff
> to a newer image :)
>
> But apart of it, do you think its ok to keep such #collect: behavior limitation?
>
> 'aaaaa' collect: [:ea | 1]
> having same symthoms.. so it seems like i need to get some sleep.. :)
>
> --
> Best regards,
> Igor Stasenko AKA sig.
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Use of ByteArray>>collect: bug, feature, nuisance, or what?

Igor Stasenko
On 28 February 2010 11:45, Nicolas Cellier
<[hidden email]> wrote:
> #[1 2 3 4] collect: [:ea | ea hex ] as: Array
>
my image can't parse bytearray literals, nor having #collect:as:
:)
it's half of year old maybe.. damn.. things going too fast :)

> 2010/2/28 Igor Stasenko <[hidden email]>:
>> Hello,
>>
>> i just noticed that #collect: used for ByteArray is quite crippling.
>> #(1 2 3 4) asByteArray collect: [:ea | ea hex ]
>>
>> Sure i can do
>>
>> bytearray asArray collect: [:ea | ea hex ]
>>
>> but this is a bit confusing.. i even expected to get '^ self' in its
>> #asArray method (before trying it out), since
>> byte array is array.
>>
>> I remember someone added new protocol, collect:into: .
>> Is it adopted already? If yes, then it seems time to migrate my stuff
>> to a newer image :)
>>
>> But apart of it, do you think its ok to keep such #collect: behavior limitation?
>>
>> 'aaaaa' collect: [:ea | 1]
>> having same symthoms.. so it seems like i need to get some sleep.. :)
>>
>> --
>> Best regards,
>> Igor Stasenko AKA sig.
>>
>>
>
>



--
Best regards,
Igor Stasenko AKA sig.