[squeak-dev] sane defaults and doesNotUnderstand: (was Future
blah blah blah)
Joshua Gargus
schwa at fastmail.us
Tue Jun 30 15:57:51 UTC 2009
David Goehrig wrote:
> On Tue, Jun 30, 2009 at 12:22 AM, Michael van der Gulik
> <mikevdg at gmail.com <mailto:mikevdg at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20090630/feede7f4/attachment.htm
More information about the Squeak-dev
mailing list
|