Missing #removeDuplicates

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

Missing #removeDuplicates

volkert-2
What happens to OrderedCollection>>removeDuplicates in Pharo 5.0? In
Pharo 4.0 it was part of a Package "GroupManager"?

It breaks the nice Package "AthensScratch" in Pharo 5.0

BW.
Volkert

Reply | Threaded
Open this post in threaded view
|

Re: Missing #removeDuplicates

stepharo


Le 9/4/16 22:36, Volkert a écrit :
> What happens to OrderedCollection>>removeDuplicates in Pharo 5.0? In
> Pharo 4.0 it was part of a Package "GroupManager"?

It was probably badly implemented or only used in group manager (whose
code was terrible) and we cleaned it.
Now we could reintroduce it but in the right place and with tests.
> It breaks the nice Package "AthensScratch" in Pharo 5.0

what is athenscracth?
>
> BW.
> Volkert
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Missing #removeDuplicates

volkert-2
Sorry. i meant AthensSkatch ;-) It is a nice demo about using athens.

http://smalltalkhub.com/#!/~NicolaiHess/AthensSketch


On 10.04.2016 07:42, stepharo wrote:

>
>
> Le 9/4/16 22:36, Volkert a écrit :
>> What happens to OrderedCollection>>removeDuplicates in Pharo 5.0? In
>> Pharo 4.0 it was part of a Package "GroupManager"?
>
> It was probably badly implemented or only used in group manager (whose
> code was terrible) and we cleaned it.
> Now we could reintroduce it but in the right place and with tests.
>> It breaks the nice Package "AthensScratch" in Pharo 5.0
>
> what is athenscracth?
>>
>> BW.
>> Volkert
>>
>>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Missing #removeDuplicates

Nicolai Hess-3-2


2016-04-10 8:55 GMT+02:00 Volkert <[hidden email]>:
Sorry. i meant AthensSkatch ;-) It is a nice demo about using athens.

http://smalltalkhub.com/#!/~NicolaiHess/AthensSketch


Hi Volkert,
I just replaced
#removeDuplicates with
#asSet
(this should work now).

(and replaced some deprecated on:send:to: calls (for Announcements) with
when:send:to:

in the latest version.


Nicolai
 



On 10.04.2016 07:42, stepharo wrote:


Le 9/4/16 22:36, Volkert a écrit :
What happens to OrderedCollection>>removeDuplicates in Pharo 5.0? In Pharo 4.0 it was part of a Package "GroupManager"?

It was probably badly implemented or only used in group manager (whose code was terrible) and we cleaned it.
Now we could reintroduce it but in the right place and with tests.
It breaks the nice Package "AthensScratch" in Pharo 5.0

what is athenscracth?

BW.
Volkert







Reply | Threaded
Open this post in threaded view
|

Re: Missing #removeDuplicates

stepharo
thanks nicolai.
Do you think the old removeAll would be good to add to the collection.


Le 11/4/16 09:06, Nicolai Hess a écrit :


2016-04-10 8:55 GMT+02:00 Volkert <[hidden email]>:
Sorry. i meant AthensSkatch ;-) It is a nice demo about using athens.

http://smalltalkhub.com/#!/~NicolaiHess/AthensSketch


Hi Volkert,
I just replaced
#removeDuplicates with
#asSet
(this should work now).

(and replaced some deprecated on:send:to: calls (for Announcements) with
when:send:to:

in the latest version.


Nicolai
 



On 10.04.2016 07:42, stepharo wrote:


Le 9/4/16 22:36, Volkert a écrit :
What happens to OrderedCollection>>removeDuplicates in Pharo 5.0? In Pharo 4.0 it was part of a Package "GroupManager"?

It was probably badly implemented or only used in group manager (whose code was terrible) and we cleaned it.
Now we could reintroduce it but in the right place and with tests.
It breaks the nice Package "AthensScratch" in Pharo 5.0

what is athenscracth?

BW.
Volkert








Reply | Threaded
Open this post in threaded view
|

Re: Missing #removeDuplicates

Nicolai Hess-3-2


2016-04-14 9:16 GMT+02:00 stepharo <[hidden email]>:
thanks nicolai.
Do you think the old removeAll would be good to add to the collection.



It may be handy, but I don't know if it is used alot.

 
Le 11/4/16 09:06, Nicolai Hess a écrit :


2016-04-10 8:55 GMT+02:00 Volkert <[hidden email]>:
Sorry. i meant AthensSkatch ;-) It is a nice demo about using athens.

http://smalltalkhub.com/#!/~NicolaiHess/AthensSketch


Hi Volkert,
I just replaced
#removeDuplicates with
#asSet
(this should work now).

(and replaced some deprecated on:send:to: calls (for Announcements) with
when:send:to:

in the latest version.


Nicolai
 



On 10.04.2016 07:42, stepharo wrote:


Le 9/4/16 22:36, Volkert a écrit :
What happens to OrderedCollection>>removeDuplicates in Pharo 5.0? In Pharo 4.0 it was part of a Package "GroupManager"?

It was probably badly implemented or only used in group manager (whose code was terrible) and we cleaned it.
Now we could reintroduce it but in the right place and with tests.
It breaks the nice Package "AthensScratch" in Pharo 5.0

what is athenscracth?

BW.
Volkert









Reply | Threaded
Open this post in threaded view
|

Re: Missing #removeDuplicates

Uko2
In reply to this post by Nicolai Hess-3-2

On 11 Apr 2016, at 09:06, Nicolai Hess <[hidden email]> wrote:



2016-04-10 8:55 GMT+02:00 Volkert <[hidden email]>:
Sorry. i meant AthensSkatch ;-) It is a nice demo about using athens.

http://smalltalkhub.com/#!/~NicolaiHess/AthensSketch


Hi Volkert,
I just replaced
#removeDuplicates with
#asSet
(this should work now).

I think that it would be nice to have removeDuplicates. Because sometimes you need to end up with ordered collection and then you need to do something like `obj asSet asArray` and it is ugly.

Uko


(and replaced some deprecated on:send:to: calls (for Announcements) with
when:send:to:

in the latest version.


Nicolai
 



On 10.04.2016 07:42, stepharo wrote:


Le 9/4/16 22:36, Volkert a écrit :
What happens to OrderedCollection>>removeDuplicates in Pharo 5.0? In Pharo 4.0 it was part of a Package "GroupManager"?

It was probably badly implemented or only used in group manager (whose code was terrible) and we cleaned it.
Now we could reintroduce it but in the right place and with tests.
It breaks the nice Package "AthensScratch" in Pharo 5.0

what is athenscracth?

BW.
Volkert








Reply | Threaded
Open this post in threaded view
|

Re: Missing #removeDuplicates

stepharo


Le 15/4/16 23:57, Yuriy Tymchuk a écrit :

On 11 Apr 2016, at 09:06, Nicolai Hess <[hidden email]> wrote:



2016-04-10 8:55 GMT+02:00 Volkert <[hidden email]>:
Sorry. i meant AthensSkatch ;-) It is a nice demo about using athens.

http://smalltalkhub.com/#!/~NicolaiHess/AthensSketch


Hi Volkert,
I just replaced
#removeDuplicates with
#asSet
(this should work now).

I think that it would be nice to have removeDuplicates. Because sometimes you need to end up with ordered collection and then you need to do something like `obj asSet asArray` and it is ugly.

But this is just curing the consequences not the causes.



Uko


(and replaced some deprecated on:send:to: calls (for Announcements) with
when:send:to:

in the latest version.


Nicolai
 



On 10.04.2016 07:42, stepharo wrote:


Le 9/4/16 22:36, Volkert a écrit :
What happens to OrderedCollection>>removeDuplicates in Pharo 5.0? In Pharo 4.0 it was part of a Package "GroupManager"?

It was probably badly implemented or only used in group manager (whose code was terrible) and we cleaned it.
Now we could reintroduce it but in the right place and with tests.
It breaks the nice Package "AthensScratch" in Pharo 5.0

what is athenscracth?

BW.
Volkert









Reply | Threaded
Open this post in threaded view
|

Re: Missing #removeDuplicates

stepharo
In reply to this post by Uko2
And I do not see why removeDuplicates is less ugly than asSet asArray. Just that it is doing two passes.

Stef

Le 15/4/16 23:57, Yuriy Tymchuk a écrit :

On 11 Apr 2016, at 09:06, Nicolai Hess <[hidden email]> wrote:



2016-04-10 8:55 GMT+02:00 Volkert <[hidden email]>:
Sorry. i meant AthensSkatch ;-) It is a nice demo about using athens.

http://smalltalkhub.com/#!/~NicolaiHess/AthensSketch


Hi Volkert,
I just replaced
#removeDuplicates with
#asSet
(this should work now).

I think that it would be nice to have removeDuplicates. Because sometimes you need to end up with ordered collection and then you need to do something like `obj asSet asArray` and it is ugly.

Uko


(and replaced some deprecated on:send:to: calls (for Announcements) with
when:send:to:

in the latest version.


Nicolai
 



On 10.04.2016 07:42, stepharo wrote:


Le 9/4/16 22:36, Volkert a écrit :
What happens to OrderedCollection>>removeDuplicates in Pharo 5.0? In Pharo 4.0 it was part of a Package "GroupManager"?

It was probably badly implemented or only used in group manager (whose code was terrible) and we cleaned it.
Now we could reintroduce it but in the right place and with tests.
It breaks the nice Package "AthensScratch" in Pharo 5.0

what is athenscracth?

BW.
Volkert









Reply | Threaded
Open this post in threaded view
|

Re: Missing #removeDuplicates

volkert-2
In reply to this post by Nicolai Hess-3-2
I have done the same ;-)

On 11.04.2016 09:06, Nicolai Hess wrote:


2016-04-10 8:55 GMT+02:00 Volkert <[hidden email]>:
Sorry. i meant AthensSkatch ;-) It is a nice demo about using athens.

http://smalltalkhub.com/#!/~NicolaiHess/AthensSketch


Hi Volkert,
I just replaced
#removeDuplicates with
#asSet
(this should work now).

(and replaced some deprecated on:send:to: calls (for Announcements) with
when:send:to:

in the latest version.


Nicolai
 



On 10.04.2016 07:42, stepharo wrote:


Le 9/4/16 22:36, Volkert a écrit :
What happens to OrderedCollection>>removeDuplicates in Pharo 5.0? In Pharo 4.0 it was part of a Package "GroupManager"?

It was probably badly implemented or only used in group manager (whose code was terrible) and we cleaned it.
Now we could reintroduce it but in the right place and with tests.
It breaks the nice Package "AthensScratch" in Pharo 5.0

what is athenscracth?

BW.
Volkert








Reply | Threaded
Open this post in threaded view
|

Re: Missing #removeDuplicates

wernerk
In reply to this post by stepharo
perhaps it is a speed question? using pharo4.0 (with polymath):
a:=DhbVector new: 50 random: 20.
b:=a copy asOrderedCollection  .
Smalltalk garbageCollect .
[ b removeDuplicates]bench. "'47,004 per second'"
b:=a copy asArray.
Smalltalk garbageCollect .
[ b asSet asArray    ]bench.  "'27,249 per second'"
werner

On 04/16/2016 09:01 AM, stepharo wrote:

> And I do not see why removeDuplicates is less ugly than asSet asArray.
> Just that it is doing two passes.
>
> Stef
>
> Le 15/4/16 23:57, Yuriy Tymchuk a écrit :
>>
>>> On 11 Apr 2016, at 09:06, Nicolai Hess
>>> <<mailto:[hidden email]>[hidden email]> wrote:
>>>
>>>
>>>
>>> 2016-04-10 8:55 GMT+02:00 Volkert
>>> <<mailto:[hidden email]>[hidden email]>:
>>>
>>>     Sorry. i meant AthensSkatch ;-) It is a nice demo about using athens.
>>>
>>>     http://smalltalkhub.com/#!/~NicolaiHess/AthensSketch
>>>     <http://smalltalkhub.com/#%21/%7ENicolaiHess/AthensSketch>
>>>
>>>
>>>
>>> Hi Volkert,
>>> I just replaced
>>> #removeDuplicates with
>>> #asSet
>>> (this should work now).
>>
>> I think that it would be nice to have removeDuplicates. Because
>> sometimes you need to end up with ordered collection and then you need
>> to do something like `obj asSet asArray` and it is ugly.
>>
>> Uko
>>
>>>
>>> (and replaced some deprecated on:send:to: calls (for Announcements) with
>>> when:send:to:
>>>
>>> in the latest version.
>>>
>>>
>>> Nicolai
>>>
>>>
>>>
>>>
>>>     On 10.04.2016 07:42, stepharo wrote:
>>>
>>>
>>>
>>>         Le 9/4/16 22:36, Volkert a écrit :
>>>
>>>             What happens to OrderedCollection>>removeDuplicates in
>>>             Pharo 5.0? In Pharo 4.0 it was part of a Package
>>>             "GroupManager"?
>>>
>>>
>>>         It was probably badly implemented or only used in group
>>>         manager (whose code was terrible) and we cleaned it.
>>>         Now we could reintroduce it but in the right place and with
>>>         tests.
>>>
>>>             It breaks the nice Package "AthensScratch" in Pharo 5.0
>>>
>>>
>>>         what is athenscracth?
>>>
>>>
>>>             BW.
>>>             Volkert
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: Missing #removeDuplicates

Nicolai Hess-3-2


2016-04-16 14:50 GMT+02:00 Werner Kassens <[hidden email]>:
perhaps it is a speed question? using pharo4.0 (with polymath):
a:=DhbVector new: 50 random: 20.
b:=a copy asOrderedCollection  .
Smalltalk garbageCollect .
[ b removeDuplicates]bench. "'47,004 per second'"
b:=a copy asArray.
Smalltalk garbageCollect .
[ b asSet asArray    ]bench.  "'27,249 per second'"
werner

the advantage for removeDuplicates ( and maybe the reason it was implemented) is, it
preserves the order.
 

On 04/16/2016 09:01 AM, stepharo wrote:
And I do not see why removeDuplicates is less ugly than asSet asArray.
Just that it is doing two passes.

Stef

Le 15/4/16 23:57, Yuriy Tymchuk a écrit :

On 11 Apr 2016, at 09:06, Nicolai Hess
<<mailto:[hidden email]>[hidden email]> wrote:



2016-04-10 8:55 GMT+02:00 Volkert
<<mailto:[hidden email]>[hidden email]>:

    Sorry. i meant AthensSkatch ;-) It is a nice demo about using athens.

    http://smalltalkhub.com/#!/~NicolaiHess/AthensSketch
    <http://smalltalkhub.com/#%21/%7ENicolaiHess/AthensSketch>




Hi Volkert,
I just replaced
#removeDuplicates with
#asSet
(this should work now).

I think that it would be nice to have removeDuplicates. Because
sometimes you need to end up with ordered collection and then you need
to do something like `obj asSet asArray` and it is ugly.

Uko


(and replaced some deprecated on:send:to: calls (for Announcements) with
when:send:to:

in the latest version.


Nicolai




    On 10.04.2016 07:42, stepharo wrote:



        Le 9/4/16 22:36, Volkert a écrit :

            What happens to OrderedCollection>>removeDuplicates in
            Pharo 5.0? In Pharo 4.0 it was part of a Package
            "GroupManager"?


        It was probably badly implemented or only used in group
        manager (whose code was terrible) and we cleaned it.
        Now we could reintroduce it but in the right place and with
        tests.

            It breaks the nice Package "AthensScratch" in Pharo 5.0


        what is athenscracth?


            BW.
            Volkert











Reply | Threaded
Open this post in threaded view
|

Re: Missing #removeDuplicates

wernerk
yes, that _is_ occasionally an advantage.
werner

On 04/16/2016 03:12 PM, Nicolai Hess wrote:

>
>
> 2016-04-16 14:50 GMT+02:00 Werner Kassens <[hidden email]
> <mailto:[hidden email]>>:
>
>     perhaps it is a speed question? using pharo4.0 (with polymath):
>     a:=DhbVector new: 50 random: 20.
>     b:=a copy asOrderedCollection  .
>     Smalltalk garbageCollect .
>     [ b removeDuplicates]bench. "'47,004 per second'"
>     b:=a copy asArray.
>     Smalltalk garbageCollect .
>     [ b asSet asArray    ]bench.  "'27,249 per second'"
>     werner
>
>
> the advantage for removeDuplicates ( and maybe the reason it was
> implemented) is, it
> preserves the order.
>
>
>     On 04/16/2016 09:01 AM, stepharo wrote:
>
>         And I do not see why removeDuplicates is less ugly than asSet
>         asArray.
>         Just that it is doing two passes.
>
>         Stef
>
>         Le 15/4/16 23:57, Yuriy Tymchuk a écrit :
>
>
>                 On 11 Apr 2016, at 09:06, Nicolai Hess
>                 <<mailto:[hidden email]
>                 <mailto:[hidden email]>>[hidden email]
>                 <mailto:[hidden email]>> wrote:
>
>
>
>                 2016-04-10 8:55 GMT+02:00 Volkert
>                 <<mailto:[hidden email]
>                 <mailto:[hidden email]>>[hidden email]
>                 <mailto:[hidden email]>>:
>
>                      Sorry. i meant AthensSkatch ;-) It is a nice demo
>                 about using athens.
>
>                 http://smalltalkhub.com/#!/~NicolaiHess/AthensSketch
>
>                 <http://smalltalkhub.com/#%21/%7ENicolaiHess/AthensSketch>
>
>
>
>
>                 Hi Volkert,
>                 I just replaced
>                 #removeDuplicates with
>                 #asSet
>                 (this should work now).
>
>
>             I think that it would be nice to have removeDuplicates. Because
>             sometimes you need to end up with ordered collection and
>             then you need
>             to do something like `obj asSet asArray` and it is ugly.
>
>             Uko
>
>
>                 (and replaced some deprecated on:send:to: calls (for
>                 Announcements) with
>                 when:send:to:
>
>                 in the latest version.
>
>
>                 Nicolai
>
>
>
>
>                      On 10.04.2016 07:42, stepharo wrote:
>
>
>
>                          Le 9/4/16 22:36, Volkert a écrit :
>
>                              What happens to
>                 OrderedCollection>>removeDuplicates in
>                              Pharo 5.0? In Pharo 4.0 it was part of a
>                 Package
>                              "GroupManager"?
>
>
>                          It was probably badly implemented or only used
>                 in group
>                          manager (whose code was terrible) and we
>                 cleaned it.
>                          Now we could reintroduce it but in the right
>                 place and with
>                          tests.
>
>                              It breaks the nice Package "AthensScratch"
>                 in Pharo 5.0
>
>
>                          what is athenscracth?
>
>
>                              BW.
>                              Volkert
>
>
>
>
>
>
>
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Missing #removeDuplicates

stepharo
In reply to this post by Nicolai Hess-3-2


Le 16/4/16 15:12, Nicolai Hess a écrit :


2016-04-16 14:50 GMT+02:00 Werner Kassens <[hidden email]>:
perhaps it is a speed question? using pharo4.0 (with polymath):
a:=DhbVector new: 50 random: 20.
b:=a copy asOrderedCollection  .
Smalltalk garbageCollect .
[ b removeDuplicates]bench. "'47,004 per second'"
b:=a copy asArray.
Smalltalk garbageCollect .
[ b asSet asArray    ]bench.  "'27,249 per second'"
werner

the advantage for removeDuplicates ( and maybe the reason it was implemented) is, it
preserves the order.

this would be an argument in favor of having it in addition to avoid double iteration.
Now people may also want to use OrderedSet.

Stef
 

On 04/16/2016 09:01 AM, stepharo wrote:
And I do not see why removeDuplicates is less ugly than asSet asArray.
Just that it is doing two passes.

Stef

Le 15/4/16 23:57, Yuriy Tymchuk a écrit :

On 11 Apr 2016, at 09:06, Nicolai Hess
<<mailto:[hidden email]>[hidden email]> wrote:



2016-04-10 8:55 GMT+02:00 Volkert
<<mailto:[hidden email]>[hidden email]>:

    Sorry. i meant AthensSkatch ;-) It is a nice demo about using athens.

    http://smalltalkhub.com/#!/~NicolaiHess/AthensSketch
    <http://smalltalkhub.com/#%21/%7ENicolaiHess/AthensSketch>




Hi Volkert,
I just replaced
#removeDuplicates with
#asSet
(this should work now).

I think that it would be nice to have removeDuplicates. Because
sometimes you need to end up with ordered collection and then you need
to do something like `obj asSet asArray` and it is ugly.

Uko


(and replaced some deprecated on:send:to: calls (for Announcements) with
when:send:to:

in the latest version.


Nicolai




    On 10.04.2016 07:42, stepharo wrote:



        Le 9/4/16 22:36, Volkert a écrit :

            What happens to OrderedCollection>>removeDuplicates in
            Pharo 5.0? In Pharo 4.0 it was part of a Package
            "GroupManager"?


        It was probably badly implemented or only used in group
        manager (whose code was terrible) and we cleaned it.
        Now we could reintroduce it but in the right place and with
        tests.

            It breaks the nice Package "AthensScratch" in Pharo 5.0


        what is athenscracth?


            BW.
            Volkert