[ENH] RBRelatedPatches [sm]

Ned Konz ned at bike-nomad.com
Wed Sep 17 02:15:12 UTC 2003


On Tuesday 16 September 2003 04:02 pm, Andreas Raab wrote:
> > 4. Collection>>ifEmpty:ifNotEmpty: and variations.
>
> -1: This should not be sneaked in as a "small change" given that it
> significantly extends the collection protocol. And is questionable
> in the semantics - the asymmetry between #ifEmpty: (0-arg block)
> and #ifNotEmpty: (1-arg block) greatly disturbs me.

Though we could have both:

ifEmpty: [ ] ifNotEmpty: [ ]

and

ifEmpty: [ ] ifNotEmptyDo: [ :v | ]

for consistency with existing protocols.

Ah, I see that Julian already suggested that.

Well, we could also have:

ifNil: [ ] ifNotNilDo: [ :v | ]

and (for Dictionaries)

at: #key ifAbsent: [ ] ifPresentDo: [ :v | ]

-- 
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE



More information about the Squeak-dev mailing list