Issue 5134 in pharo: Comment of Collection>>#reduce:

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

Issue 5134 in pharo: Comment of Collection>>#reduce:

pharo
Status: Accepted
Owner: ----

New issue 5134 by renggli: Comment of Collection>>#reduce:
http://code.google.com/p/pharo/issues/detail?id=5134

The method comment of Collection>>#reduce: got replaced (ThomasHolzer  
4/15/2011 14:52) by a different and invalid one. It should be reverted to  
the correct previous one.


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

Re: Issue 5134 in pharo: Comment of Collection>>#reduce:

pharo
Updates:
        Status: FixToInclude
        Labels: Milestone-1.4

Comment #1 on issue 5134 by [hidden email]: Comment of  
Collection>>#reduce:
http://code.google.com/p/pharo/issues/detail?id=5134

Thanks what was the problem?


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

Re: Issue 5134 in pharo: Comment of Collection>>#reduce:

pharo

Comment #2 on issue 5134 by [hidden email]: Comment of  
Collection>>#reduce:
http://code.google.com/p/pharo/issues/detail?id=5134

Lukas should we keep the implementation? Because I was wondering why we  
should convert it in an orderedCollection. Is it used to build foldR and L?


I was reading the comment and I was wondering what is the general use of  
reduce:

#(1 2 3 4 5) asSet reduce: [ :a :b :c | a + b + c ]
                --> 1 + 2 + 3 + 4 + 5 = 15

What is the use to have a block with 3 parameters?
When I read #(1 2 3 4 5) asSet reduce: [ :a :b :c | a + b + c ]
I thought that it would be 1+2+3, 2+3+4 ....

So reduce: is like inject:into:?



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

Re: Issue 5134 in pharo: Comment of Collection>>#reduce:

pharo
Updates:
        Status: Closed

Comment #3 on issue 5134 by [hidden email]: Comment of  
Collection>>#reduce:
http://code.google.com/p/pharo/issues/detail?id=5134

in 14277


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