Modification on CollectionsExtensions

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

Modification on CollectionsExtensions

Sebastian Tleye
Hello, 

Fixing some bugs in Traits we realized that it would be good idea to use CollectionsExtensions package (it has some useful functions), also it would be great to include CollectionsExtensions in Pharo 3.0. 

One "problem" we found is that CollectionsExtensions is depending on a Nile Package (that's not a desired feature). 
In the method Collection>>flatCollect: there is a line refering to a nile function "nsWriteStream".

If i change "nsWriteStream" for "writeStream" the dependency disapears.

I also run all the tests and they are working, so i was wondering if it would be possible to commit the change.

Thanks.

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] Modification on CollectionsExtensions

Sebastian Tleye
I don't know, i should see the implementation, i just want to remove the dependency between CollectionsExtensions and Nile and one way to do it is modifying #flatCollect: implementation.

if they are the same #flatCollect: could be remove safely replaced.


2013/6/11 Camille Teruel <[hidden email]>

On 11 juin 2013, at 15:18, Sebastian Tleye wrote:

> Hello,
>
> Fixing some bugs in Traits we realized that it would be good idea to use CollectionsExtensions package (it has some useful functions), also it would be great to include CollectionsExtensions in Pharo 3.0.
>
> One "problem" we found is that CollectionsExtensions is depending on a Nile Package (that's not a desired feature).
> In the method Collection>>flatCollect: there is a line refering to a nile function "nsWriteStream".

How this #flatCollect: is different from #gather: anyway?

>
> If i change "nsWriteStream" for "writeStream" the dependency disapears.
>
> I also run all the tests and they are working, so i was wondering if it would be possible to commit the change.
>
> Thanks.




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] Modification on CollectionsExtensions

Stéphane Ducasse
Yes please go ahead.

Stef

On Jun 11, 2013, at 4:49 PM, Sebastian Tleye <[hidden email]> wrote:

I don't know, i should see the implementation, i just want to remove the dependency between CollectionsExtensions and Nile and one way to do it is modifying #flatCollect: implementation.

if they are the same #flatCollect: could be remove safely replaced.


2013/6/11 Camille Teruel <[hidden email]>

On 11 juin 2013, at 15:18, Sebastian Tleye wrote:

> Hello,
>
> Fixing some bugs in Traits we realized that it would be good idea to use CollectionsExtensions package (it has some useful functions), also it would be great to include CollectionsExtensions in Pharo 3.0.
>
> One "problem" we found is that CollectionsExtensions is depending on a Nile Package (that's not a desired feature).
> In the method Collection>>flatCollect: there is a line refering to a nile function "nsWriteStream".

How this #flatCollect: is different from #gather: anyway?

>
> If i change "nsWriteStream" for "writeStream" the dependency disapears.
>
> I also run all the tests and they are working, so i was wondering if it would be possible to commit the change.
>
> Thanks.





_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] Modification on CollectionsExtensions

Guillaume Larcheveque
In reply to this post by Sebastian Tleye
I think the simplest solution is to keep both and that flatCollect directly call gather:

If you agree with that, I will correct the moose extension package


2013/6/11 Stéphane Ducasse <[hidden email]>
gather: sucks as a name.
flatCollect: is much better so do not remove it.

On Jun 11, 2013, at 4:53 PM, Sebastian Tleye <[hidden email]> wrote:

If they are not different so a better way would be replace #flatenCollect: by #gather:
but anyway, moose people should decide and commit the change since i am not a moose developer.


2013/6/11 Marcus Denker <[hidden email]>

On Jun 11, 2013, at 4:24 PM, Frank Shearar <[hidden email]> wrote:

> On 11 June 2013 14:18, Sebastian Tleye <[hidden email]> wrote:
>> Hello,
>>
>> Fixing some bugs in Traits we realized that it would be good idea to use
>> CollectionsExtensions package (it has some useful functions), also it would
>> be great to include CollectionsExtensions in Pharo 3.0.
>
> Is this the HPI library? I seem to recall TraitClasses [1] using it.

CollectionExtension is from Moose.

the Trait  based Stream refactoring was done some years ago but has not been used
or maintained.

        Marcus





--
Guillaume Larcheveque


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] Modification on CollectionsExtensions

Sebastian Tleye
+1


2013/6/12 Guillaume Larcheveque <[hidden email]>
I think the simplest solution is to keep both and that flatCollect directly call gather:

If you agree with that, I will correct the moose extension package


2013/6/11 Stéphane Ducasse <[hidden email]>
gather: sucks as a name.
flatCollect: is much better so do not remove it.

On Jun 11, 2013, at 4:53 PM, Sebastian Tleye <[hidden email]> wrote:

If they are not different so a better way would be replace #flatenCollect: by #gather:
but anyway, moose people should decide and commit the change since i am not a moose developer.


2013/6/11 Marcus Denker <[hidden email]>

On Jun 11, 2013, at 4:24 PM, Frank Shearar <[hidden email]> wrote:

> On 11 June 2013 14:18, Sebastian Tleye <[hidden email]> wrote:
>> Hello,
>>
>> Fixing some bugs in Traits we realized that it would be good idea to use
>> CollectionsExtensions package (it has some useful functions), also it would
>> be great to include CollectionsExtensions in Pharo 3.0.
>
> Is this the HPI library? I seem to recall TraitClasses [1] using it.

CollectionExtension is from Moose.

the Trait  based Stream refactoring was done some years ago but has not been used
or maintained.

        Marcus





--
Guillaume Larcheveque



_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] Modification on CollectionsExtensions

Stéphane Ducasse
In reply to this post by Guillaume Larcheveque
Why not the inverse.
They are much more users of flatCollect: then gather: 

and again gather: sucks. It does not convey that this is a mapcan 
ie happening the results of each iteration into the 

So flatCollect: is 10 times more explicit and better.
you flatten the results of the collect: 

Stef

I think the simplest solution is to keep both and that flatCollect directly call gather:

If you agree with that, I will correct the moose extension package


2013/6/11 Stéphane Ducasse <[hidden email]>
gather: sucks as a name.
flatCollect: is much better so do not remove it.

On Jun 11, 2013, at 4:53 PM, Sebastian Tleye <[hidden email]> wrote:

If they are not different so a better way would be replace #flatenCollect: by #gather:
but anyway, moose people should decide and commit the change since i am not a moose developer.


2013/6/11 Marcus Denker <[hidden email]>

On Jun 11, 2013, at 4:24 PM, Frank Shearar <[hidden email]> wrote:

> On 11 June 2013 14:18, Sebastian Tleye <[hidden email]> wrote:
>> Hello,
>>
>> Fixing some bugs in Traits we realized that it would be good idea to use
>> CollectionsExtensions package (it has some useful functions), also it would
>> be great to include CollectionsExtensions in Pharo 3.0.
>
> Is this the HPI library? I seem to recall TraitClasses [1] using it.

CollectionExtension is from Moose.

the Trait  based Stream refactoring was done some years ago but has not been used
or maintained.

        Marcus





--
Guillaume Larcheveque



_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] Modification on CollectionsExtensions

Sebastian Tleye
As far as i know the implementation of gather: is faster than the implementation of flatCollect:


2013/6/12 Stéphane Ducasse <[hidden email]>
Why not the inverse.
They are much more users of flatCollect: then gather: 

and again gather: sucks. It does not convey that this is a mapcan 
ie happening the results of each iteration into the 

So flatCollect: is 10 times more explicit and better.
you flatten the results of the collect: 

Stef


I think the simplest solution is to keep both and that flatCollect directly call gather:

If you agree with that, I will correct the moose extension package


2013/6/11 Stéphane Ducasse <[hidden email]>
gather: sucks as a name.
flatCollect: is much better so do not remove it.

On Jun 11, 2013, at 4:53 PM, Sebastian Tleye <[hidden email]> wrote:

If they are not different so a better way would be replace #flatenCollect: by #gather:
but anyway, moose people should decide and commit the change since i am not a moose developer.


2013/6/11 Marcus Denker <[hidden email]>

On Jun 11, 2013, at 4:24 PM, Frank Shearar <[hidden email]> wrote:

> On 11 June 2013 14:18, Sebastian Tleye <[hidden email]> wrote:
>> Hello,
>>
>> Fixing some bugs in Traits we realized that it would be good idea to use
>> CollectionsExtensions package (it has some useful functions), also it would
>> be great to include CollectionsExtensions in Pharo 3.0.
>
> Is this the HPI library? I seem to recall TraitClasses [1] using it.

CollectionExtension is from Moose.

the Trait  based Stream refactoring was done some years ago but has not been used
or maintained.

        Marcus





--
Guillaume Larcheveque




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] Modification on CollectionsExtensions

Guillaume Larcheveque
Ok so if everyone agree I will remove the flatCollect: method from CollectionExtensions since Sebastian made the correction in Pharo 3.0.


2013/6/12 Stéphane Ducasse <[hidden email]>

On Jun 12, 2013, at 1:02 PM, Sebastian Tleye <[hidden email]> wrote:

ok, i understood, 

Discussing with Marcus we believe that it would be better to keep Collecition>>gather: and add Collection>>flatCollect: (with the same implementation) and put a comment in gather: saying that is kept for compatibility purposes.

flatCollect: will be included in Pharo and will be removed from CollectionExtensions.


+ 1





--
Guillaume Larcheveque


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] Modification on CollectionsExtensions

Stéphane Ducasse
but pay attention because in 2.0 you will need it.
:)

On Jun 12, 2013, at 4:13 PM, Guillaume Larcheveque <[hidden email]> wrote:

Ok so if everyone agree I will remove the flatCollect: method from CollectionExtensions since Sebastian made the correction in Pharo 3.0.


2013/6/12 Stéphane Ducasse <[hidden email]>

On Jun 12, 2013, at 1:02 PM, Sebastian Tleye <[hidden email]> wrote:

ok, i understood, 

Discussing with Marcus we believe that it would be better to keep Collecition>>gather: and add Collection>>flatCollect: (with the same implementation) and put a comment in gather: saying that is kept for compatibility purposes.

flatCollect: will be included in Pharo and will be removed from CollectionExtensions.


+ 1





--
Guillaume Larcheveque



_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] Modification on CollectionsExtensions

Tudor Girba-2
First, thanks for looking at CollectionsExtensions.

But, please do not remove flatCollect: yet!

This is used everywhere in Moose. We will release Moose at the end of this month and we will move to Pharo 3.0, and then we can do what we want.

Doru

--

"Every thing has its own flow."

On 12.06.2013, at 17:41, Stéphane Ducasse <[hidden email]> wrote:

but pay attention because in 2.0 you will need it.
:)

On Jun 12, 2013, at 4:13 PM, Guillaume Larcheveque <[hidden email]> wrote:

Ok so if everyone agree I will remove the flatCollect: method from CollectionExtensions since Sebastian made the correction in Pharo 3.0.


2013/6/12 Stéphane Ducasse <[hidden email]>

On Jun 12, 2013, at 1:02 PM, Sebastian Tleye <[hidden email]> wrote:

ok, i understood, 

Discussing with Marcus we believe that it would be better to keep Collecition>>gather: and add Collection>>flatCollect: (with the same implementation) and put a comment in gather: saying that is kept for compatibility purposes.

flatCollect: will be included in Pharo and will be removed from CollectionExtensions.


+ 1





--
Guillaume Larcheveque



_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev