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.2 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 2EF63BC6B for ; Wed, 17 Oct 2007 17:03:43 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAJnBFUfLENaMnmdsb2JhbACOTgIBAQcEBhEY X-IronPort-AV: E=Sophos;i="4.21,289,1188770400"; d="scan'208";a="4647937" Received: from ipmail01.adl2.internode.on.net ([203.16.214.140]) by mail3-smtp-sop.national.inria.fr with ESMTP; 17 Oct 2007 17:03:38 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAD/BFUd5LCRs/2dsb2JhbAAM X-IronPort-AV: E=Sophos;i="4.21,289,1188743400"; d="scan'208";a="212608366" Received: from ppp121-44-36-108.lns10.syd7.internode.on.net (HELO [192.168.1.201]) ([121.44.36.108]) by ipmail01.adl2.internode.on.net with ESMTP; 18 Oct 2007 00:33:36 +0930 Subject: Re: [Caml-list] Smells like duck-typing From: skaller To: Daniel =?ISO-8859-1?Q?B=FCnzli?= Cc: Dario Teixeira , caml-list@yquem.inria.fr In-Reply-To: References: <932096.75090.qm@web54602.mail.re2.yahoo.com> Content-Type: text/plain; charset=utf-8 Date: Thu, 18 Oct 2007 01:03:34 +1000 Message-Id: <1192633414.10820.4.camel@rosella.wigram> Mime-Version: 1.0 X-Mailer: Evolution 2.12.0 Content-Transfer-Encoding: 8bit X-Spam: no; 0.00; 0200,:01 sourceforge:01 wrote:01 abstract:01 caml-list:01 data:02 essentially:02 string:02 string:02 objects:02 dynamic:03 dynamic:03 daniel:04 wed:06 phantom:07 On Wed, 2007-10-17 at 16:25 +0200, Daniel Bünzli wrote: > Use a record with a phantom type (the type must be abstract for this > to work). I would use something weaker, and I wouldn't use objects either. To me, this is essentially a dynamic scenario, so the data type should be dynamic. For example: type field_t = [ | `Title of string | `Intro of string | `Body of string | `Field of string * string ] type story_t = field_t list -- John Skaller Felix, successor to C++: http://felix.sf.net