From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,b87849933931bc93 X-Google-Attributes: gidfac41,public X-Google-Thread: 103376,b87849933931bc93 X-Google-Attributes: gid103376,public From: fjh@mundook.cs.mu.OZ.AU (Fergus Henderson) Subject: Re: What is wrong with OO ? Date: 1997/01/13 Message-ID: <5bdd9m$os3@mulga.cs.mu.OZ.AU>#1/1 X-Deja-AN: 209669714 references: <5acjtn$5uj@news3.digex.net> <32D11FD3.41C6@wi.leidenuniv.nl> <5b2pmn$ntc@mulga.cs.mu.OZ.AU> <32D4FFF2.5D1E@calfp.com> <5b4f6l$aeq@mulga.cs.mu.OZ.AU> <5bbcom$gc7@mulga.cs.mu.OZ.AU> organization: Comp Sci, University of Melbourne newsgroups: comp.lang.eiffel,comp.lang.ada Date: 1997-01-13T00:00:00+00:00 List-Id: tiggr@es.ele.tue.nl (Pieter Schoenmakers) writes: >fjh@mundook.cs.mu.OZ.AU (Fergus Henderson) writes: > > If you allow new classes to be dynamically loaded, then the compiler > can't statically bind features of objects whose dynamic type is unknown, > but it can still statically bind features of objects whose dynamic type > is known. > >If a class B can be dynamically loaded, and B is a subclass of the >statically loaded (i.e. known to the compiler) class A, then every feature >invocation of an object accessed through a variable of type A, where the >actual object could just as well be a B, can not be statically bound or >inlined. Yes, but often the compiler can prove that the actual object type must be A, not B. Some languages, e.g. Ada, allow the programmer to distinguish between something of type A (meaning just type A, nothing else) and something of type A'class (meaning something of type A or some type that inherits from A). Even if the language doesn't distinguish, the compiler can often see the type used when an object is created. (All I'm trying to say is that you _can_ do useful inter-module optimization even in the presence of dynamic loading. Sheesh!) -- Fergus Henderson | "I have always known that the pursuit WWW: | of excellence is a lethal habit" PGP: finger fjh@128.250.37.3 | -- the last words of T. S. Garp.