OB enhancement Object>>asArray considered harmful

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

OB enhancement Object>>asArray considered harmful

Igor Stasenko
Hello guys,
i do not post this to OB list, because i'm too lazy to subscribing to
it, and i know that OB people is here :)

I don't think that such enhancement pays for error-free code
asArray
        ^ Array with: self

recently i made own class (a kind of linked list), and forgot to add
#asArray implementation to it.

And i lost 2 hours trying to understand why my code does not working
and getting Array with: myList
where i expecting to see array of myList elements.

--
Best regards,
Igor Stasenko AKA sig.

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: OB enhancement Object>>asArray considered harmful

David Röthlisberger-2

> i do not post this to OB list, because i'm too lazy to subscribing to
> it, and i know that OB people is here :)
>
> I don't think that such enhancement pays for error-free code
> asArray
> ^ Array with: self

I think Juraj added this method for the tree he contributed.
I acutally don't think it's needed anymore, you should be able to safely remove it.
If not, please let me know.

David

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: OB enhancement Object>>asArray considered harmful

Igor Stasenko
2009/3/5 David Röthlisberger <[hidden email]>:

>
>> i do not post this to OB list, because i'm too lazy to subscribing to
>> it, and i know that OB people is here :)
>>
>> I don't think that such enhancement pays for error-free code
>> asArray
>>       ^ Array with: self
>
> I think Juraj added this method for the tree he contributed.
> I acutally don't think it's needed anymore, you should be able to safely remove it.
> If not, please let me know.
>
Surely, i can remove it from my image, but not from OB package which
adds this extension to Object class.

> David
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>



--
Best regards,
Igor Stasenko AKA sig.

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: OB enhancement Object>>asArray considered harmful

cedreek
Name: OB-Enhancements-CB.312
Author: CB
Time: 5 March 2009, 3:18:34 pm
UUID: cae3e197-dd58-403a-8161-49f38bbb610b
Ancestors: OB-Enhancements-damiencassou.311

removed  Object>>asArray

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: OB enhancement Object>>asArray considered harmful

Igor Stasenko
2009/3/5 Cédrick Béler <[hidden email]>:
> Name: OB-Enhancements-CB.312
> Author: CB
> Time: 5 March 2009, 3:18:34 pm
> UUID: cae3e197-dd58-403a-8161-49f38bbb610b
> Ancestors: OB-Enhancements-damiencassou.311
>
> removed  Object>>asArray

so fast?!  i expected a discussion and arguments :)
My argument:
this method belongs to a collections protocol (like #isEmpty) and
should not have a default implementation.

> - Show quoted text -
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>



--
Best regards,
Igor Stasenko AKA sig.

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: OB enhancement Object>>asArray considered harmful

cedreek
>> removed  Object>>asArray
>
> so fast?!  i expected a discussion and arguments :)
> My argument:
> this method belongs to a collections protocol (like #isEmpty) and
> should not have a default implementation.
>
I quite agree... and your 2 hours looking for the error is a good
reason to me (unexpected behavior).

and it doesn't seem to be used in OB Enhancement anymore, so ok to
remove it ? ;)

Cédrick

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: OB enhancement Object>>asArray considered harmful

Igor Stasenko
2009/3/5 Cédrick Béler <[hidden email]>:

>>> removed  Object>>asArray
>>
>> so fast?!  i expected a discussion and arguments :)
>> My argument:
>> this method belongs to a collections protocol (like #isEmpty) and
>> should not have a default implementation.
>>
> I quite agree... and your 2 hours looking for the error is a good
> reason to me (unexpected behavior).
>
> and it doesn't seem to be used in OB Enhancement anymore, so ok to
> remove it ? ;)
>
haha... We givng you my permission

> Cédrick
> - Show quoted text -
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project



--
Best regards,
Igor Stasenko AKA sig.

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project