From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 7C85DBC29 for ; Tue, 29 Aug 2006 07:53:37 +0200 (CEST) Received: from smtp3.adl2.internode.on.net (smtp3.adl2.internode.on.net [203.16.214.203]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id k7T5rZfn002885 for ; Tue, 29 Aug 2006 07:53:36 +0200 Received: from rosella (ppp14-47.lns2.syd7.internode.on.net [59.167.14.47]) by smtp3.adl2.internode.on.net (8.13.6/8.13.5) with ESMTP id k7T5rBFE063737; Tue, 29 Aug 2006 15:23:12 +0930 (CST) (envelope-from skaller@users.sourceforge.net) Subject: Re: [Caml-list] Class/prototype-based OO From: skaller To: Ted Kremenek Cc: david.baelde@ens-lyon.org, Ocaml In-Reply-To: References: <53c655920608250051x48d81cbagabf8039f0269beee@mail.gmail.com> <1156505490.20759.354.camel@rosella.wigram> Content-Type: text/plain Date: Tue, 29 Aug 2006 15:53:11 +1000 Message-Id: <1156830791.5147.144.camel@rosella.wigram> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 44F3D65F.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ocaml:01 ocaml:01 lacks:01 downcasts:01 run-time:01 rtti:01 run-time:01 variants:01 2006:98 sourceforge:01 wrote:01 typing:01 typing:01 signatures:01 signatures:01 On Mon, 2006-08-28 at 20:11 -0700, Ted Kremenek wrote: > While the structural typing in Ocaml is wonderful (I really love it), > there are missing features of the OO system in OCaml that can be > particularly bothersome, and are worth considering when comparing the > OO features of Ocaml with other languages (including those that use > nominal typing). > > For example, from what I can tell it appears that Ocaml lacks real > support for "downcasts" in the language, which require run-time type > information (RTTI) and run-time checks. Yes, indeed, this is wonderful! For the first time programmers learn the truth. Ocaml does not pander to the false god of Object Orientation. > In the context of structural > typing, I am talking about "casting" an object with a type with a > given set of method signatures to another type with an extended set > of method signatures. There is no need. Use the proper technology: variants. They provide run time type information on which you can dispatch. -- John Skaller Felix, successor to C++: http://felix.sf.net