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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 3AA3BBBCA for ; Tue, 26 Feb 2008 15:59:55 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAABK4w0fAXQInh2dsb2JhbACQYwEBAQgKKZwP X-IronPort-AV: E=Sophos;i="4.25,407,1199660400"; d="scan'208";a="7724251" Received: from concorde.inria.fr ([192.93.2.39]) by mail2-smtp-roc.national.inria.fr with ESMTP; 26 Feb 2008 15:59:57 +0100 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id m1QExsNN032656 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Tue, 26 Feb 2008 15:59:54 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAJq3w0fBL1AZkmdsb2JhbACQYwEBAQEHBAYHIpwY X-IronPort-AV: E=Sophos;i="4.25,407,1199660400"; d="scan'208";a="9612832" Received: from gw.exalead.com (HELO exalead.com) ([193.47.80.25]) by mail3-smtp-sop.national.inria.fr with ESMTP; 26 Feb 2008 15:59:54 +0100 Received: from [192.168.204.148] (madpc064.exalead.com [192.168.204.148]) (authenticated bits=0) by exalead.com (8.14.0/8.14.0) with ESMTP id m1QExkTe001853; Tue, 26 Feb 2008 15:59:46 +0100 Message-ID: <47C42962.80009@exalead.com> Date: Tue, 26 Feb 2008 15:59:46 +0100 From: Berke Durak User-Agent: Thunderbird 1.5.0.10 (X11/20070221) MIME-Version: 1.0 To: Richard Jones Cc: Caml-list List Subject: Re: [Caml-list] Objects, dynamic cast, Obj.magic abuse and dragons References: <47C3F96E.4080901@exalead.com> <20080226121451.GA20860@annexia.org> <47C421F1.8000608@exalead.com> <20080226144828.GA27938@annexia.org> In-Reply-To: <20080226144828.GA27938@annexia.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Miltered: at concorde with ID 47C4296A.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; berke:01 durak:01 berke:01 durak:01 0100,:01 kludge:01 compiler:01 variants:01 compiler:01 subtyping:01 26,:98 lesson:98 wrote:01 extensible:01 caml-list:01 Richard Jones a écrit : > On Tue, Feb 26, 2008 at 03:28:01PM +0100, Berke Durak wrote: >> Your solution first seemed like a kludge but, given the alternatives, it >> appears to be the best solution. > [...] >> And it's reasonably efficient (after all, we're using objects here.) > > Yeah, I suspect the real lesson here is don't use objects at all. > They are rarely as useful as people make out, and most uses of them > seem to be because lesser languages lack good compiler checks on > variants. After all, there's no real problem at all spreading match > statements around the program if I can be sure that the compiler will > highlight everywhere which needs to change when I change my variant. > > Rich. > Subtyping is useful, however. I dont use objects much and I was wondering if I'm missing much. Toda I'd be willing to trade in the class system for an extensible record system. -- Berke DURAK