Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucsd!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: <7776@charlie.OZ> Date: 1 Sep 89 02:57:19 GMT References: <56930@aerospace.AERO.ORG> Sender: root@charlie.OZ Reply-To: rad@aragorn.UUCP (Robert Alan Dew) Organization: Department of Computing & Mathematics - Deakin University Lines: 63 In article <56930@aerospace.AERO.ORG> abbott@itro3.aero.org writes: >if an object has a response defined for a message sent to it, then it >is of the "right type." Basically all objects produce a response to any message. I guess you want to exclude the doesNotUnderstand: response. >In trying to understand what that means, I came up with the >following. I'm sure this must have been worked out properly somewhere. >Does anyone know where? Two suggestions: - forget about 'type'. - understand the following and there relationships class class instance message instance variable instance method class variable class method inheritance of instance variables instance methods class variables class methods self super Anyway, if you want to think about types then class is the analogy. >where a message is a message name, a list of the types of the >parameters, and the type of the result, i.e., > >Msg ::= Name(param1: Type1; param2: Type2; ..., paramn: Typen): Type A message has: - a selector. Which is a Symbol and does consist of the 'message names'. eg. #at:put: - arguments. An Array containing the parameters. A message does not return an object, therefore no result type is required. For a better understanding separate messages from methods. The method returns an object, the method is not restricted to returning only one class of object. Anyway, part of a system I am building includes a class where: - a variety of messages can be sent to instances of that class. - an instance of the class does not understand any of the messages, except for the doesNotUnderstand: and a few initialization messages. - the class instance was intended not to understand messages. The response when an instance did not understand would be due to the method for doesNotUnderstand:. which was redefined in the class. Robert Dew rad@aragorn.cm.deakin.oz Department of Computing and Mathematics Deakin University Geelong Victoria Australia 3217