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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id A7DC6BBCA for ; Tue, 26 Feb 2008 17:25:07 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAACvMw0fAXQImh2dsb2JhbACQYwEBAQgKKZwu X-IronPort-AV: E=Sophos;i="4.25,408,1199660400"; d="scan'208";a="8613642" Received: from discorde.inria.fr ([192.93.2.38]) by mail1-smtp-roc.national.inria.fr with ESMTP; 26 Feb 2008 17:25:07 +0100 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id m1QGP7kn004971 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Tue, 26 Feb 2008 17:25:07 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAACvMw0fBL1AZkmdsb2JhbACQYwEBAQEHBAYHIpwu X-IronPort-AV: E=Sophos;i="4.25,408,1199660400"; d="scan'208";a="7727759" Received: from gw.exalead.com (HELO exalead.com) ([193.47.80.25]) by mail2-smtp-roc.national.inria.fr with ESMTP; 26 Feb 2008 17:25:07 +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 m1QGP585007279; Tue, 26 Feb 2008 17:25:06 +0100 Message-ID: <47C43D61.7070905@exalead.com> Date: Tue, 26 Feb 2008 17:25:05 +0100 From: Berke Durak User-Agent: Thunderbird 1.5.0.10 (X11/20070221) MIME-Version: 1.0 To: Dirk Thierbach , Caml-list List Subject: Re: [Caml-list] Objects, dynamic cast, Obj.magic abuse and dragons References: <47C3F96E.4080901@exalead.com> <20080226150711.GB6521@feanor> In-Reply-To: <20080226150711.GB6521@feanor> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 47C43D63.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; berke:01 durak:01 berke:01 durak:01 model:01 variants:01 nodes:01 gerd:01 stolpmann:01 wrote:01 caml-list:01 tree:02 tree:02 objects:02 objects:02 Dirk Thierbach wrote : > I think I wouldn't use objects at all in this situation. You're trying > to model the location-tree of "physical" things. A tree must be uniform > in its contents, but you want to put different things into it. That > means you must use an algebraic type, or variants. I'd probably either > use a zipper, or connect the tree nodes with "refs" for the non-pure > version. You are preaching to the choir. I'm not Gerd Stolpmann and I don't use objects very much because every time I try I get seven-page-long errors. However it seems that objects could be actually useful in situations where you have a hierarchy of objects with behaviours, such as a graphical user interface made of widgets, or, say, a text adventure. -- Berke DURAK