[FIX][KCP] KCP-0112-FixCanUnderstand

ducasse ducasse at iam.unibe.ch
Fri Dec 12 17:29:35 UTC 2003


Hi Peter

Good question. Nathanael will certainly reply but just two points:

	- if canUnderstand: #foo replies true when a class has a method
	foo
		^ self subclassResponsibility  or shouldNotImplement
	then there is something really wrong in smalltalk....because normally 
people think that
	they can call foo on the receiver but this is not the case with those 
examples.

	This means that you will never be able to find code from VW or nay 
other smalltalk that breaks what nathanael
	proposes because else the code itself breaks in the other dialects :) 
funny no!
	
	- The usage of canUnderstand: should really be restricted.
	In fact this is a meta level interface functionality and we should 
have a
	task force to carefully evaluate the use in the current image as
	usage of canUnderstand is 99 % of the time a sign of not so 
well-designed code.

Thanks for letting me having fun! This was really cool.

Stef

On 12 déc. 03, at 18:05, Peter van Rooijen wrote:

> From: <n.schaerli at gmx.net>
>> from preamble:
>>
>> "Change Set: KCP-0112-FixCanUnderstand
>> Date: 12 December 2003
>> Author: Nathanael Schaerli
>>
>> Fixes canUnderstand so that it deals with abstract methods (i.e.,
>> subclassResponsibility and shouldNotImplement) in the right way."!
>
> Natanael,
>
> Are you sure this is wise? How exactly did you decide what is "the 
> right
> way"?
>
> How do other dialects implement #canUnderstand:? Are they also "wrong"?
>
> If you need the new semantics for something you are working on, why 
> not add
> another method that does exactly what you want instead of modifying 
> this
> old-timer?
>
> Regards,
>
> Peter van Rooijen
>
>




More information about the Squeak-dev mailing list