> 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!

Reply via email to