My chief concern is that I am a bear of very little brain, and if you change the meaning of #isNil to anything at all other than "is the receiver identical to nil" you *WILL* (not may) confuse me.
I can understand your probably well-justified concern that power can always be misused. I also understand a key principle of Smalltalk to be âempower and trust the programmerâ. Edge cases like this where Smalltalk principles like pervasive message passing are not true bring their own share of confusion.
"How should a proxy (https://en.wikipedia.org/wiki/Proxy_pattern) to nil respond to the #âisNilâ message?"
It SHOULD NOT LIE. A proxy *isn't* nil, and it doesn't *behave* like nil, even if it is a proxy for nil. A proxy, qua proxy, can do things that nil cannot. Use another selector, #isEffectivelyNil, or whatever reveals your intentions, and give it what semantics you find useful.
I find the concept of âisâ and âequalâ to be generally confusing in Smalltalk. Does \`#=\` mean âall state is the sameâ? âall relevant state is the same (minus e.g. caching)â? âThis represents the same domain objectâ? I can see how a proxy claiming to be nil is a âlieâ for one/some definitions of âisâ, but I donât think itâs universally true. Really interesting conversation!