Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!uhccux!munnari.oz.au!murtoa.cs.mu.oz.au!charlie!aragorn!rad From: rad@aragorn.cm.deakin.oz.au (Robert Alan Dew) Newsgroups: comp.lang.smalltalk Subject: Re: Smalltalk types Message-ID: <7792@charlie.OZ> Date: 6 Sep 89 14:22:09 GMT References: <56929@aerospace.AERO.ORG> <7784@charlie.OZ> <7785@charlie.OZ> <9120@june.cs.washington.edu> Sender: root@charlie.OZ Reply-To: rad@aragorn.UUCP (Robert Alan Dew) Organization: Department of Computing & Mathematics - Deakin University Lines: 32 In article <9120@june.cs.washington.edu> rkr@june.cs.washington.edu.cs.washington.edu (R. K. Raj) writes: [ ... ] #Just one more thing. Robert Dew (rad@aragorn.cm.deakin.oz) has suggested #the following definition of type equivalence: # #>Let O be the set of all objects. #>Let M be the set of all messages. #>Let S denote a subset of M. #>Let T:O -> S be a mapping from an object to a set of all messages the object #>understands. #> #>Two objects o1 and o2 are of the same type iff #> T(o1) = T(o2). # #The concept of conformity is useful in object-oriented languages in #extending the notion of type equivalence. We should be interested in knowing #when one object can be used in place of another. I agree, but knowing whether the objects are of the same type is only part of the solution. #For instance, using the #above notation, we can say that o1 can be used in place of o2 iff # T(o1) is a superset of T(o2). I disagree. The definition for replacement must be stronger. Care should be taken when o1 replaces o2, this is because o1 can have a completely different behaviour when recieving the same message. The message does not imply the same behaviour for objects of the same type. Robert Dew rad@aragorn.cm.deakin.oz