argument of ifNotNil: must be a 0-argument block

David T. Lewis lewis at mail.msen.com
Sun Sep 3 14:52:18 UTC 2006


On Sun, Sep 03, 2006 at 02:21:47PM +0200, Mathieu wrote:
> Klaus D. Witzel a ?crit :
> > On Sat, 02 Sep 2006 14:20:59 +0200, David T. Lewis wrote:
> > ...
> >> Tests are good, but they do not detect this kind of problem.
> > 
> > Did you mean that in Smalltalk it is impossible to test, whether or not
> > the compiler accepts a syntactical construct, like in " Compiler
> > evaluate: 'put your test here' ".
> > 
> > If not, mind to explain what it is that cannot be detected.
> 
> This is beceause #ifNotNil: it's never call(compier inline it) so you do not know if the guy who
> write #ifNotNil: implementation do it correctly.
> 
> I think it's why he say this.

Yes, that's what I meant. I expect that a pre-existing suite of
unit tests would probably not have detected the incorrect change.

Andreas rightly points out that if someone had attempted to write
a unit test that documented the incorrect change, the test would
not have been compilable, and the problem would have been noticed.

Furthermore, if my imaginary pre-existing tests had existed, and
if the person changing #ifNotNil: had also gone to the unit tests
and added something to document the new behavior, then the problem
would have been detected.

This all sounds like a more perfect world that any we are likely
to inhabit, but I certainly don't want to discourage it from
coming to pass, so I hereby withdraw my original remark ;-)

Setting aside the unit test discussion, has this issue been put
on Mantis? If noone has done so, I'll add one later today.

Dave




More information about the Squeak-dev mailing list