Path: utzoo!attcan!uunet!know!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!uflorida!rex!rouge!cacs.usl.edu From: pcb@cacs.usl.edu (Peter C. Bahrs) Newsgroups: comp.object Subject: Re: Do we really need types in OOPL's? Message-ID: <15362@rouge.usl.edu> Date: 26 Sep 90 16:40:02 GMT Sender: anon@rouge.usl.edu Organization: The Center for Advanced Computer Studies, USL Lines: 43 Without being for or against, how do you implement polymorphism without types? For instance in OO|| syntax: Class A; A.(behavior x); A.(behavior y); st. x and y are different objects. How can you tell the difference? In C++ or OO|| you would define behavior (Classname id); behavior (Classname2 id); and the compiler or interpreter will invoke the correct behavior/method based on the class of the incoming objects. Otherwise each behavior must contain added code looking like a switch statement: behavior (id) { if ( (id.(class)).(== "Classname") ) { /* do this */ } else { if ( (id.(class)).(== "Classname2") ) ... } } This approach adds more complexity to the code. It is compounded even more with variable number of arguments. Just a thought. /*----------- Thanks in advance... --------------------------------------+ | Peter C. Bahrs | | The USL-NASA Project | | Center For Advanced Computer Studies INET: pcb@gator.cacs.usl.edu | | 2 Rex Street | | University of Southwestern Louisiana ...!uunet!dalsqnt!gator!pcb | | Lafayette, LA 70504 | +-----------------------------------------------------------------------*/