[Pharo-dev] [Moose-dev] #deepCollect:

Tudor Girba tudor at tudorgirba.com
Wed Dec 25 09:14:34 EST 2013


As I mentioned before, his API is a particular case of the DeepTraverser
and it is covered out of the box with the DeepTraverser implementation.

But, keep in mind that Chris's deepCollect: works only for collections,
while mine works for any object as starting point.

Also, the DeepTraverser package has 427 lines of code (including comments),
so I would say it is not quite that large :). It would be great to have it
added to Pharo (actually that was the original intention).

Cheers,
Doru



On Tue, Dec 24, 2013 at 6:26 PM, Stéphane Ducasse <stephane.ducasse at inria.fr
> wrote:

> Hi chris
>
> I think that it would be great if:
> - your api is compatible with the one of doru
> - that we can introduce your extension to Pharo
> - keep the package of doru outside because it is larger.
>
> With such approach we could get a first version with your code and a
> larger one with the one of doru and people
> would love it on demand.
>
> Stef
>
> On 13 Dec 2013, at 18:02, Chris Cunningham <cunningham.cb at gmail.com>
> wrote:
>
> Hi.
>
> I was reading with interest the blog post on Traversal-enabled objects (
> http://www.humane-assessment.com/blog/traversal-enabled-pharo-objects )
> when I noticed the method #deepCollect: referenced.  Interestingly, I have
> a method called #deepCollect: that is use (wtih related methods like
> #deepDo: and #deepSelect:).  I suspect these uses may be compatible, with
> the traveral versions being more generic.
>
> My set of #deep methods allow arbitrary flattening of collections.  The
> #flatCollect: suite in Pharo today flattens objects 1 level; the
> #deepCollect: flattens the collections as many levels deep as they are
> nested.  I found this to be a really useful ability when I work with
> PetitParser parsings, which tend give back massively nested Arrays by
> default.
>
> If you are interested, it is published at:
> http://www.smalltalkhub.com/#!/~cbc/DeepCollection/ .
>
> -cbc
>
>
>


-- 
www.tudorgirba.com

"Every thing has its own flow"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20131225/550398ef/attachment-0002.html>


More information about the Pharo-dev mailing list