Xref: utzoo comp.object:570 comp.lang.c++:5762 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!usc!aero!abbott From: abbott@aerospace.aero.org (Russell J. Abbott) Newsgroups: comp.object,comp.lang.c++ Subject: (Very) Dymanic Typing (Was: Dumb question) Message-ID: <62298@aerospace.AERO.ORG> Date: 1 Dec 89 16:30:44 GMT References: <61737@aerospace.AERO.ORG> <9938@june.cs.washington.edu> <2122@tukki.jyu.fi> <2159@tukki.jyu.fi> <9191@microsoft.UUCP> <32106@watmath.waterloo.edu> Reply-To: abbott@aero.UUCP (Russell J. Abbott) Organization: The Aerospace Corporation, El Segundo, CA Lines: 22 In article <32106@watmath.waterloo.edu> gjditchfield@watmsg.waterloo.edu (Glen Ditchfield) writes: > ... In practice, in C++, wouldn't it be simpler to pass a comparison >function as an argument to the sort() function? Can you really do that in C++? What would the declarations look like? That would be even more flexible than the generic sort that I asked about originally. In Smalltalk one can ask an object to "perform" a "message." (I gather that in C++ terminology a "message" is a call, along with its argument(s), to a "member" function. Again, pardon my lack of familiarity with C++.) Smalltalk's "perform" is similar to "eval" in Lisp in that the thing to be perform'ed or eval'ed is unknown at program entry/compilation time. In such a situation there is *no* type information at all available to the compiler/language processor. So how does a statically typed language like C++ deal with that? And if it does deal with it: (a) is the static type checking that it does worth bothing with since there seems to be nothing that can be statically checked and (b) doesn't there have to be dynamic type checking of the same order of complexity as goes on in Smalltalk anyway? -- -- Russ abbott@itro3.aero.org Brought to you by Super Global Mega Corp .com