There was one little thing that I found unnecessarily hard in porting code between squeak and other Smalltalk dialects. It had a long standing “bug” in that it handled sends of
ifNotNil:with a one-argument block differently than the source code of
The problem was that if you did something like:
anObject ifNotNil: [:obj| obj doSomething].
and anObject was not nil, you got an exception instead of the result of doSomething. This bug was known for many years and nobody ever fixed it. Since the Squeak compiler never runs the sourcecode of ifNotNil:, but runs a primitive instead, it was surprising to see the exception because the source code of the method does handle one-argument blocks as well as zero-argument blocks.
In some newsgroup or mailing list (I can’t really remember) was told to use
ifNotNilDo: for my purposes, which is not present in any of the Smalltalk dialects that I use.
In Pharo it’s been fixed long ago, and today somebody removed all sends of
ifNotNilDo:, so the era of one of my “major small Squeak annoyances” finally completely ends today and
ifNotNilDo: is history, at least in Pharo.