Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!gem.mps.ohio-state.edu!ginosko!uunet!mcsun!ukc!mucs!alan From: alan@ux.cs.man.ac.uk (Alan Wills) Newsgroups: comp.lang.smalltalk Subject: Re: Smalltalk types Message-ID: <6483@ux.cs.man.ac.uk> Date: 8 Sep 89 10:42:27 GMT References: <7793@charlie.OZ> Organization: Dept. of Computer Science, University of Manchester, UK. Lines: 26 In-reply-to: rad@aragorn.cm.deakin.oz.au's message of 6 Sep 89 14:24:51 GMT Robert Dew's list of sets of Smalltalk classes which understand the same set of messages is worth contrasting with the notion of a type as being the set of objects which understand a particular set of messages. For example, in Smalltalk, if we look at the set of all objects which understand the messages "<", "=<", ">", ">=", "=" : we get all instances of Magnitude (and its subclasses) and all instances of String (and its subclasses). Even more interesting is that, although the implementations of these functions are different in the two inheritance subtrees, this correspondence isn't just a mere overloading of names: the relations obey the same rules about how they're interrelated. For example: if I know and also then I can infer x < y (y < x) not x =< y (x = y) not x < y x > y y < x x < y y < z x < z etc I guess this helps to illustrate that this notion of type --- equivalence sets wrt parts of behaviours --- is useful when into the nitty-gritty of reasoning about programs to check they're going to do the right things. Alan Wills Manchester University, UK -- Alan Wills +44-61-273 7121 x5699