Hi - in my quest to understand the edgier details of Pharo (and Smalltalk) - 
and driven by fresh thoughts of completing exercism exercises - I was surprised 
to find that there is no #excludes: operation on collection to mirror the 
#includes: operation?

I was curious about this - its seems a strange omission?

Of course I can inverse it with not, or do things a different way - but we have 
ifTrue: mirrored with ifFalse, empty/notEmpty so am I missing something?

I wanted to write something like


aString detect: [:c | ($0 to: $1) excludes: c] ifFound: aBlock. (Evaluate a 
block if the string isn’t all 0 and 1’s)


Of course I can write this as:

(aString reject: [:c | c = $0 | c = $1)) ifNotEmpty: aBlock

But as recent messages in this vein have shown me (and taught me lots - thanks 
to those answering), the answer is often not what I thought.

Tim


Reply via email to