From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA16193; Fri, 27 Feb 2004 09:40:44 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id JAA15414 for ; Fri, 27 Feb 2004 09:40:43 +0100 (MET) Received: from postfix4-1.free.fr (postfix4-1.free.fr [213.228.0.62]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i1R8egae010400 for ; Fri, 27 Feb 2004 09:40:42 +0100 Received: from warp (lns-th2-5f-81-56-197-80.adsl.proxad.net [81.56.197.80]) by postfix4-1.free.fr (Postfix) with SMTP id 30BE6CBAF1; Fri, 27 Feb 2004 09:40:42 +0100 (CET) Message-ID: <002e01c3fd0d$4979b120$ef01a8c0@warp> From: "Nicolas Cannasse" To: "Michael Vanier" , References: <20040227004557.C85CE9BBA2@orchestra.cs.caltech.edu> Subject: Re: [Caml-list] extensible records? Date: Fri, 27 Feb 2004 09:39:59 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Miltered: at concorde by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; cannasse:01 warplayer:01 caml-list:01 extensible:01 mli:01 infer:01 mli:01 jacques:01 reuse:01 wwwfun:01 cannasse:01 compiler:01 nicolas:01 nicolas:01 variants:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk [...] > I thought of using polymorphic variant types, but my (limited) understanding > is that you either declare all possible variants straight up in the .mli file > (which totally defeats my purpose) or you don't declare anything and let the > compiler infer the type (which I don't know how to write into a .mli file). > If this can be done with polymorphic variants, how would I do it? > Alternatively, if this can be done with objects, how would I do it? Or > should I just stick with abusing exceptions? There is a nice paper from Jacques Garrigue about extensions using polymorphic variants. "Code reuse through polymorphic variants. " http://wwwfun.kurims.kyoto-u.ac.jp/~garrigue/papers/ That might be what you're loooking for. Regards, Nicolas Cannasse ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners