Em 04/12/2009 05:58, Lukas Renggli < [email protected] > escreveu:

> I wonder if ever something along the following lines was considered?
> 
> Dictionary>>keys
> "Answer a Set containing the receiver's keys."
> 
> | result |
> result := Set basicNew.
> result setTally: tally array: (array collect: [ :each |
> each isNil ifFalse: [ each key ] ]).
> ^ result

Why not:

| result |
result := Set basicNew.
result setTally: tally array: (array collect: [ :each |
each ifNil: [ each key ] ]).
^ result

A bit more OO ;-) 

Reading Andrés' book is making more aware of those subtleties :-D
 
My .019999...

-
Cesar Rabak

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

Reply via email to