Xref: utzoo comp.object:477 comp.lang.c++:5635 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!usc!henry.jpl.nasa.gov!elroy.jpl.nasa.gov!aero!abbott From: abbott@aerospace.aero.org (Russell J. Abbott) Newsgroups: comp.object,comp.lang.c++ Subject: Dumb question Message-ID: <61737@aerospace.AERO.ORG> Date: 22 Nov 89 15:30:25 GMT Reply-To: abbott@itro3.org (Russell J. Abbott) Organization: The Aerospace Corporation, El Segundo, CA Lines: 21 As a non-C++ programmer but as someone who has programmed in Smalltalk I beg your indulgence for a dumb question. To what extent can one dynamically bind code in C++? For example, in Smalltalk one can send a message to an object which has been passed as a parameter. Since Smalltalk does not have static typing, there is no way of knowing ahead of time which piece of code will be executed, or even which of several pieces of code as would be the case, I gather, with virtual functions. One does not even know ahead of time whether the object to which the message is sent will have a method defined that matches the call, in which case an exception is raised. More concretely, can one write a sort routine that will sort a list of any type (perhaps not yet even defined) that responds to "<"? I would assume that one could, but it wasn't clear to me from the C++ material that I have how to do it. Thanks. -- -- Russ abbott@itro3.aero.org