[Pharo-users] where are the nills come from and how do I get rid of them

2020-09-20 Thread Roelof Wobben via Pharo-users
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            

[Pharo-users] Re: where are the nills come from and how do I get rid of them

2020-09-20 Thread jtuc...@objektfabrik.de
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