Hello,
I have to make a word count from a sentence so I did this :
countWordsSentence: aString
| splitted result |
splitted := aString splitOn: [ :each | ', ' includes: each ].
result := splitted
inject: Bag new
into: [ :wordBag :word |
wordBag
Roelof,
I guess your are taking about what you see in the inspector... There is
nothing to worry about.
Try inspecting wordBag asOrderedCollection and see if there are still
nils. Or ask the Bad for occurencesOf: nil.
It is completely normal to see nils in an Inspector on a Set or Bag. Has