A bit of collection trivia...
Collection ifEmpty: [ foo ] returns nil if the collection is not empty, owing to the placement of the return in
ifEmpty: aBlock "Evaluate the block if I'm empty" ^ self isEmpty ifTrue: aBlock
I did the same observation some time ago and found it very irritating that it does not behave the same was as for example the expression
^ var ifNil: [ var := 1 ]
does.
I would vote to change that, so that I can write
^ var ifEmpty: [ #( 1 ) ]
to be sure to get a collection with at least one element.
Cheers, Lukas