Mantis - tweak
Viewing Issue Advanced Details
5294 Any minor always 10-26-06 00:20 10-27-06 00:59
jdougan  
 
normal  
acknowledged  
open  
none    
none  
0005294: Method #any is unintuitive and collides with common usage.
Recently I had the pleasure of porting a large pile of VW code to Croquet and found #any to be a problem. In most code I have seen, and in an informal poll I conducted at OOPSLA, most people expected #any to return an arbitrary element of a collection.

I would suggest that #any be renamed to somrthing like #anyIn or #anyMatchingIn. These have the advantage of being more descriptive and syntactically they indicate that something should follow them, such as the #match: method.
#all probably should be modified in a similar manner.

Looking in the Tweak code in Croquet, it looks like there aren't many places that #all and #any are called in currently.

Notes
(0007891)
andreas   
10-26-06 01:16   
Agreed. It's on my own list of things to get rid of.
(0007896)
ChrisC   
10-27-06 00:59   
In base Squeak, there is the method Collection>>anyOne that returns 1 arbitrary element of the collection. That would probably be a good choice for the name.

For #all, maybe #allOfThem ? Random suggestion, there.