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 MAA24299; Fri, 27 Feb 2004 12:17:54 +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 MAA24732 for ; Fri, 27 Feb 2004 12:17:53 +0100 (MET) Received: from KVIW12.KVI.nl (KVIW12.KVI.nl [129.125.15.42]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i1RBHpae030342 for ; Fri, 27 Feb 2004 12:17:52 +0100 Received: from KVIS10.KVI.nl ("port 52909"@KVIS10.KVI.nl [129.125.27.60]) by KVI.nl (PMDF V6.2-X17 #30869) with ESMTP id <01L73H12NWMCAT9AVY@KVI.nl> for caml-list@inria.fr; Fri, 27 Feb 2004 12:17:48 +0100 (MET) Received: from KVIW06.KVI.NL by KVIS10.KVI.nl (AvMailGate-2.0.1.16) id 13212-1CE3DC06; Fri, 27 Feb 2004 12:17:47 +0100 Received: from kvip88.kvi.nl ("port 50348"@KVIP88.KVI.nl [129.125.15.152]) by KVI.nl (PMDF V6.2-X17 #30869) with ESMTP id <01L73H0XWLFKASW4F4@KVI.nl>; Fri, 27 Feb 2004 12:17:41 +0100 (MET) Date: Fri, 27 Feb 2004 12:17:41 +0100 From: "Alexander S. Usov" Subject: Re: [Caml-list] extensible records? In-reply-to: <20040227004557.C85CE9BBA2@orchestra.cs.caltech.edu> To: Michael Vanier Cc: caml-list@inria.fr Message-id: <200402271136.37410.A.S.Usov@kvi.nl> Organization: KVI MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-transfer-encoding: 7BIT Content-disposition: inline User-Agent: KMail/1.6 X-AntiVirus: checked by AntiVir MailGate (version: 2.0.1.16; AVE: 6.24.0.5; VDF: 6.24.0.20; host: kvi.nl) References: <20040227004557.C85CE9BBA2@orchestra.cs.caltech.edu> 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; caml-list:01 extensible:01 2004:99 figuring:01 ocaml:01 ocaml:01 alexander:01 alexander:01 int:01 int:01 float:02 float:02 wrote:03 types:03 types:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Friday 27 February 2004 01:45, you wrote: > Hi everyone! > > I'm having a problem figuring out how to implement something in ocaml, and > I'd like to solicit advice. I'm writing a little dynamically-typed > language in ocaml, and I want to be able to add new types to the language > without having to add new primitive types to the system. So, for instance, > my basic type definition looks something like this: > > type data = > Int of int > > | Float of float > | ... > > Mike I am not hundred percent sure, but you can use parametrized definition. Like this: type 'a data = Int of int | Float of float | ..... | Extension of 'a ;; -- Best regards, Alexander. ------------------- 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