From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA28671; Fri, 19 Jul 2002 10:50:40 +0200 (MET DST) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id KAA28667 for ; Fri, 19 Jul 2002 10:50:39 +0200 (MET DST) Received: from indyio.rz.uni-sb.de (indyio.rz.uni-sb.de [134.96.7.3]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g6J8oc102448 for ; Fri, 19 Jul 2002 10:50:38 +0200 (MET DST) Received: from mars.rz.uni-sb.de (IDENT:TdbcW+3kdPRKCsOtQLWJOcFuu6kIjvdB@mars.rz.uni-sb.de [134.96.7.4]) by indyio.rz.uni-sb.de (8.9.3/8.9.3) with ESMTP id KAA10952009 for ; Fri, 19 Jul 2002 10:50:38 +0200 (CEST) Received: from uni-sb.de (uni-sb.de [134.96.7.230]) by mars.rz.uni-sb.de (8.8.8/8.8.4/8.8.2) with ESMTP id KAA162061423 for ; Fri, 19 Jul 2002 10:50:38 +0200 (CEST) Received: from cs.uni-sb.de (cs.uni-sb.de [134.96.252.31]) by uni-sb.de (8.12.4/2002060500) with ESMTP id g6J8obl29225 for ; Fri, 19 Jul 2002 10:50:37 +0200 (CEST) Received: from mail.cs.uni-sb.de (IDENT:q+wZKgJrwHLfXcZ45JFXY+JtYmfh3qHs@mail.cs.uni-sb.de [134.96.254.200]) by cs.uni-sb.de (8.12.1/2002050600) with ESMTP id g6J8oaZ27177 for ; Fri, 19 Jul 2002 10:50:36 +0200 (CEST) Received: from ps.uni-sb.de (grizzly.ps.uni-sb.de [134.96.186.68]) by mail.cs.uni-sb.de (8.12.4/2002060500) with ESMTP id g6J8oZa03735 for ; Fri, 19 Jul 2002 10:50:35 +0200 (CEST) X-Authentication-Warning: email: Host grizzly.ps.uni-sb.de [134.96.186.68] claimed to be ps.uni-sb.de Received: from ps.uni-sb.de (zoidberg.ps.uni-sb.de [134.96.186.121]) by ps.uni-sb.de (8.11.6/8.11.0) with ESMTP id g6J8oce17724; Fri, 19 Jul 2002 10:50:38 +0200 Message-ID: <3D37D474.2551F19E@ps.uni-sb.de> Date: Fri, 19 Jul 2002 10:57:24 +0200 From: Andreas Rossberg Organization: =?iso-8859-1?Q?Universit=E4t?= des Saarlandes X-Mailer: Mozilla 4.78 [en] (X11; U; Linux 2.4.9-21 i686) X-Accept-Language: de, en MIME-Version: 1.0 CC: caml-list Subject: Re: [Caml-list] productivity improvement References: <20020716172916.4903.qmail@web10702.mail.yahoo.com> <200207190358.XAA11620@dewberry.cc.columbia.edu> <20020719010318.B3631@boson.den.co.bbnow.net> <200207190821.EAA09974@hickory.cc.columbia.edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Oleg wrote: > > On Friday 19 July 2002 03:03 am, Issac Trotts wrote: > > Right, so how is your C++ compiler going to remind you when you forget to > > include a needed case in the switch statement (assuming there is something > > in the typeinfo to switch on; you can't switch on a string in C++.) OCaml > > will remind you, but I don't see how a C++ compiler could. > > Correct. Since C++ compiler can not possibly know of all existent sub-types, > there is no way it can warn you. This is why virtual member functions are > still preferred. And how would you do more complex case analysis, corresponding to nested patterns? This is more than cumbersome and error-prone in C++ - with RTTI, and even more so with method dispatch, where your single algorithm will have to be scattered over tons of distant functions. A maintenance nightmare. BTW, as Issac noted, you cannot even use switch statements to perform RTTI in C++. You have to program if cascades. -- Andreas Rossberg, rossberg@ps.uni-sb.de "Computer games don't affect kids; I mean if Pac Man affected us as kids, we would all be running around in darkened rooms, munching magic pills, and listening to repetitive electronic music." - Kristian Wilson, Nintendo Inc. ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners