Path: utzoo!attcan!uunet!husc6!bbn!rochester!pt.cs.cmu.edu!andrew.cmu.edu!sa1z+ From: sa1z+@andrew.cmu.edu (Sudheer Apte) Newsgroups: comp.lang.smalltalk Subject: Message dispatch on argument class Message-ID: Date: 7 Nov 88 01:38:30 GMT Organization: Carnegie Mellon Lines: 20 Suppose I want the same selector to behave differently depending upon the class of the argument. In Smalltalk (I run ParcPlace V2.2 on a Sun 3/50) I have to write the method thus: add: anObject (anObject class == Class1) ifTrue: [^self privateAdd1: anObject] ifFalse: ["Code dealing with all other valid classes"] I have to make this decision within the method because I have no way in Smalltalk to specify different methods to be invoked by the same message selector depending upon the class of the argument. It seems this problem has been well researched, and some kind of solution has been found which does not sacrifice speed. Anyone know anything about this? Thanks, Sudheer. _____________