[Pharo-dev] Missing collectAsSet: in Pharo 3.0

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Tue Dec 10 10:19:09 EST 2013


Do I really need to respond to this? Well you're lucky, my child not yet
awoke:
1) size is often implemented O(1) above is O(n)
2) typing size is very short compared to open code you provided
3) size has many senders which makes it worth
4) size is part of ANSI
Which of these points apply to (someCollection collectAsSet: #asUppercase)
vs (someCollection collect: #asUppercase as: Set).

But you could find better example of some more questionable methods in
Squeak/Pharo.


2013/12/10 Roberto Minelli <roberto.minelli at usi.ch>

> So if "self do: [:each | tally := tally + 1]" computes the size of a
> collection, why do we need the #size selector?
>
> On Dec 10, 2013, at 3:08 PM, Igor Stasenko <siguctua at gmail.com> wrote:
>
> > So if collect:as: does the job why the hell add yet another selector?
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20131210/77b26e6b/attachment-0002.html>


More information about the Pharo-dev mailing list