On Sat, Jan 17, 2009 at 09:07:19AM -0500, Kuba Ober wrote: >> I thought he was talking about the effects of runtime polymorphism on >> static code analysis. You can't tell which method is invoked if the >> method is virtual. > That's fine, because if your code is written well it doesn't matter at > all which one it is. All you care about is the interface and not the > particular implementation -- assuming that all implementations adhere
It seems to me that you are implicitly assuming that the interface is expressive enough to encode all the good properties you want your code to obey to, while it is not the case, especially for mainstream OO languages whose type systems are waaaaaaay too lightweight. Hence, the reference to static analysis above was, AFAICT, specifically meant to prove properties which are not encoded by the method interfaces, and hence depend on the method implementations. And precisely that you are screwed, because you need to know which method is actually called, which is harder with ad-hoc polymorphism. Somebody mentioned in this thread that the same problem has to be faced with functors. That is true for the casual look at the code, but at least in OCaml the functor language can be completely expanded at compile time (or at least it was at the time of ocamldefun [1], unless I'm mistaken). Cheers. [1] http://www.lri.fr/~signoles/ocamldefun/index.en.html -- Stefano Zacchiroli -o- PhD in Computer Science \ PostDoc @ Univ. Paris 7 z...@{upsilon.cc,pps.jussieu.fr,debian.org} -<>- http://upsilon.cc/zack/ Dietro un grande uomo c'è ..| . |. Et ne m'en veux pas si je te tutoie sempre uno zaino ...........| ..: |.... Je dis tu à tous ceux que j'aime _______________________________________________ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs