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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id B7A0EBC69 for ; Wed, 17 Oct 2007 18:57:53 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAADLcFUfLENaMnmdsb2JhbACOTgIBAQcEBhEY X-IronPort-AV: E=Sophos;i="4.21,290,1188770400"; d="scan'208";a="3158861" Received: from ipmail01.adl2.internode.on.net ([203.16.214.140]) by mail2-smtp-roc.national.inria.fr with ESMTP; 17 Oct 2007 18:57:52 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAANrZFUd5LCRs/2dsb2JhbAAM X-IronPort-AV: E=Sophos;i="4.21,290,1188743400"; d="scan'208";a="212663299" 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 02:27:50 +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: <81AE55C4-1CDA-4299-8F40-273BDC46613C@epfl.ch> References: <788147.33893.qm@web54602.mail.re2.yahoo.com> <81AE55C4-1CDA-4299-8F40-273BDC46613C@epfl.ch> Content-Type: text/plain; charset=utf-8 Date: Thu, 18 Oct 2007 02:57:49 +1000 Message-Id: <1192640269.10798.9.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 typing:01 caml-list:01 functions:01 data:02 data:02 string:02 string:02 typed:04 daniel:04 hint:04 perhaps:05 weak:06 On Wed, 2007-10-17 at 17:32 +0200, Daniel Bünzli wrote: > Le 17 oct. 07 à 17:13, Dario Teixeira a écrit : > > >> type field_t = [ > >> | `Title of string > >> | `Intro of string > >> | `Body of string > >> | `Field of string * string > >> ] > >> > >> type story_t = field_t list > >> > > Interesting idea, > > If this is right for you then what you want is property lists and > these two solutions [1,2] may be of interest to you. Yes, my 'solution' is just a hint. Felix actually uses something similar to the above structure to record properties of functions, eg 'pure', 'inline', etc. This kind of data structure is weakly typed, but that's part of the idea. Someone probably has an actual representation of BibTeX data, which is similar in spirit. Perhaps this weak typing is too weak and can be beefed up, for example if the title is mandatory, a record PLUS a property list. -- John Skaller Felix, successor to C++: http://felix.sf.net