Xref: utzoo comp.lang.misc:1097 comp.lang.pascal:635 Path: utzoo!mnetor!uunet!mcvax!inria!crin!tombre From: tombre@crin.crin.fr (Karl Tombre) Newsgroups: comp.lang.misc,comp.lang.pascal Subject: Object Pascal and dynamic binding Message-ID: <416@crin.crin.fr> Date: 25 Feb 88 11:38:25 GMT Reply-To: tombre@crin.crin.fr (Karl Tombre) Organization: CRIN - INRIA Lorraine, Nancy, France Lines: 40 I have a question about Object Pascal, the object extension to Pascal written by Apple for the MAcintosh. I have read Kurt Schmucker's book (Object-Oriented Programming for the Macintosh) without finding an answer. Many object languages (Smalltalk, Objective-C for instance) use dynamic typing. On the contrary, Simula-67, C++, Eiffel and some others use static typing, and achieve dynamic binding by means of the virtual function mechanism. Schmucker says several times that Object Pascal also uses static typing (more precisely compile-time type checking), but does not explain how dynamic binding is obtained. Some excerpts from his book (I don't copy the integral text, as americans seem to be crazy about copyrights ;-) : p. 67 : he speaks of examples of what Object Pascal cannot determine until run-time and says that this gives the impression that a great deal of decisions must be delayed until then. But according to him, Object Pascal makes very few decisions at run-time... and so on. But no word on how dynamic binding is made possible. p. 323 : in the chapter on Clascal, he notes that Object Pascal has no ABSTRACT and DEFAULT keywords and that Apple found a "better method"... My question : is this method a trade secret, or is it the good old virtual mechanism of Simula ? Said in another way : does Object Pascal detect which functions must be dynamically bound (as they are overriden in several classes) and implement this by a pointer to a function associated with the instance, or something like that ? Or is there another mechanism for achieving this ? Or is there really a method lookup function searching at run-time for the right procedure to call ? Can somebody give an answer to this ? Thanks in advance, --- Karl Tombre @ CRIN (Centre de Recherche en Informatique de Nancy) EMAIL : tombre@crin.crin.fr -- tombre@crin.UUCP POST : Karl Tombre, CRIN, B.P. 239, 54506 VANDOEUVRE CEDEX, France PHONE : +33 83.91.21.25