David Goehrig wrote:
On Tue, Jun 30, 2009 at 12:22 AM, Michael van der Gulik <mikevdg@gmail.com mailto:mikevdg@gmail.com> wrote:
I am implicitly stating that I expect anArbitraryObject will return a boolean when passed the message #someMethod. This expectation has nothing to do with the implementation of anArbitraryObject, or with the meaning of #someMethod, only in the semantics of how it fits within the overall structure of the statement.
Similarly if I were to say something like:
( anArbitraryObject + 1 ) < someLimit ifFalse: anotherBlock
Taking < as an example, what do you say about these two fragments of semantically equivalent code?
anArbitraryObject < someLimit ifFalse: anotherBlock
anArbitraryObject >= someLimit ifTrue: anotherBlock
In the first case, anotherBlock is evaluated, and in the second it is not. Making #doesNotUnderstand: return false cannot possibly "do what you expect" because it will behave differently depending on how you phrase your expectation. Check, and mate? :-)
Cheers, Josh