[ENH] CollectionEnh-dgd
Diego Gomez Deck
DiegoGomezDeck at ConsultAr.com
Mon Sep 13 21:50:23 UTC 2004
Hi Scott,
You're absolutely right, sorry for my mistake.
You know, working 12 hours a day, 7 days a week is definitively not
healthy :)
BTW, I just sent a right (I hope) version...
See you,
-- Diego
PS: Did you see my look&feel changes? What do you think?
> Hi, Diego,
>
> Worthy stuff! But note the following...
>
>
> (1) Your #select:thenDo: is identical in implementation to our
> long-standing #select:thenCollect:
>
>
> (2) As for your other two (#collect:thenDo: and #reject:thenDo:), it
> seems to me that they're either slightly mis-named or else slightly
> mis-implemented. Either the second-step should really be a *do*
> rather than a *collect*, or else the selector name should hint at the
> "collecting" nature of the final action. (Or am I missing something
> here?)
>
> Thus, for example, I would expect that a method named
> #collect:thenDo: would be implemented as follows:
>
> collect: block1 thenDo: block2
> (self collect: block1) do: block2
>
> or, if we retain your implementation, we might prefer to use a
> different selector, e.g.:
>
> collect: block1 thenCollect: block2
> ^ (self collect: block1) collect: block2
>
>
> ... and similarly for the #reject: variant.
>
> -----
>
> When I first added #collect:thenSelect: and #select:thenCollect: to
> Squeak, back in 1996, there were some murmurings that these were not
> strictly necessary, but my justification for these was on
> "readability" grounds -- same argument as yours here -- and I feel
> that the fullness of time has justified those additions.
>
> I feel similarly about your suggested additions, but let's get the
> selector names and the actual implementations more tightly correlated.
>
>
> Cheers,
>
> -- Scott
More information about the Squeak-dev
mailing list
|