Hi Eliot, hi all,
I'm skeptical about this change, as it creates or expands a special role of the selectors #ifNil:, #ifNotNil:, and their combinations. IMHO, it unnecessarily complicates the simple Smalltalk syntax. While I know and sometimes dislike these UndefinedVariable notifications, too, I don't know whether differentiating them by the selector is the right strategy to improve this situation.
Consider the following examples:
How would you explain to a naive Smalltalker which of these variables will be marked as undefined at this point and why? (Of course, you can explain it by pointing to the implementation, but I think that's a significantly less intuitive explanation than just saying "you must declare any variable before using it".)
This behavior leads to a mental model that disambiguates between null and undefined similar to JavaScript which I never have found helpful.
Also, with this change, the compiler leaks the default value of any temporary variable, which we previously were able to hide at least partially.
In many cases, I think explicitly setting a temporary variable to nil before it is initialized within some non-trivial conditional complex would be more explicit, thus more readable, and something which we should generally encourage programmers to do.
Looking forward to your opinion!
Best,
Christoph