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 mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 2F983BBCA for ; Tue, 26 Feb 2008 15:48:31 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAMC0w0dQRFuwh2dsb2JhbACQYwEBAQgKKZwK X-IronPort-AV: E=Sophos;i="4.25,407,1199660400"; d="scan'208";a="23065323" Received: from concorde.inria.fr ([192.93.2.39]) by mail4-smtp-sop.national.inria.fr with ESMTP; 26 Feb 2008 15:48:30 +0100 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id m1QEmQxO031972 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Tue, 26 Feb 2008 15:48:30 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAMC0w0dQRFuwh2dsb2JhbACQYwEBAQgKKZwK X-IronPort-AV: E=Sophos;i="4.25,407,1199660400"; d="scan'208";a="23065322" Received: from furbychan.cocan.org ([80.68.91.176]) by mail4-smtp-sop.national.inria.fr with ESMTP; 26 Feb 2008 15:48:30 +0100 Received: from rich by furbychan.cocan.org with local (Exim 4.63) (envelope-from ) id 1JU16b-0007Kg-4j; Tue, 26 Feb 2008 14:48:29 +0000 Date: Tue, 26 Feb 2008 14:48:29 +0000 To: Berke Durak Cc: Caml-list List Subject: Re: [Caml-list] Objects, dynamic cast, Obj.magic abuse and dragons Message-ID: <20080226144828.GA27938@annexia.org> References: <47C3F96E.4080901@exalead.com> <20080226121451.GA20860@annexia.org> <47C421F1.8000608@exalead.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <47C421F1.8000608@exalead.com> User-Agent: Mutt/1.5.13 (2006-08-11) From: Richard Jones X-Miltered: at concorde with ID 47C426BA.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; 0100,:01 berke:01 durak:01 kludge:01 compiler:01 variants:01 compiler:01 26,:98 lesson:98 wrote:01 caml-list:01 variant:02 match:02 rarely:02 objects:02 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. -- Richard Jones Red Hat