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 SAA16531; Sun, 21 Mar 2004 18:01:39 +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 SAA17179 for ; Sun, 21 Mar 2004 18:01:38 +0100 (MET) Received: from smtp3.adl2.internode.on.net (smtp3.adl2.internode.on.net [203.16.214.203]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i2LH1ZHd003248 for ; Sun, 21 Mar 2004 18:01:36 +0100 Received: from [192.168.1.200] (ppp114-118.lns1.syd3.internode.on.net [150.101.114.118]) by smtp3.adl2.internode.on.net (8.12.9/8.12.9) with ESMTP id i2LH1NUK095384; Mon, 22 Mar 2004 03:31:28 +1030 (CST) Subject: Re: [Caml-list] extensible records again From: skaller Reply-To: skaller@users.sourceforge.net To: Oleg Trott Cc: Michael Vanier , caml-list In-Reply-To: <405DBE78.5020609@columbia.edu> References: <20040321062143.BE7D29BBA2@orchestra.cs.caltech.edu> <405D4D77.2030403@columbia.edu> <20040321084008.429279BBA2@orchestra.cs.caltech.edu> <405DBE78.5020609@columbia.edu> Content-Type: text/plain Message-Id: <1079888775.3165.11.camel@pelican.wigram> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 22 Mar 2004 04:06:18 +1100 Content-Transfer-Encoding: 7bit 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 sourceforge:01 2004:99 oleg:01 vanier:01 refactor:01 vyper:01 python:01 9660:01 glebe:01 ocaml:01 variants:01 int:01 int:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Status: X-Keywords: X-UID: 284 On Mon, 2004-03-22 at 03:10, Oleg Trott wrote: > Michael Vanier wrote: > > In fact, in your case, I believe it's more convenient > not to create an artificial distinction between the "core types" and > "other types": suppose someone extended your language with "files", and > you later decide to add "file" to your "core types". You'll have to > redefine "data" and refactor a lot of your base code to do it, unless > you just use polymorphic variants, as suggested (in which case there is > no special distinction between "core types" and "other types"). However there IS a reason for making the distinction sometimes, namely performance. My Vyper interpreter (a Python interpreter written in Ocaml) used a type like type PyObject = Int of int | Float of float | String of string | PyClass of pyclass which deliberately distinguished simple types so that a fast match could be used to perform common calculations: match o1, o2 with | Int i, Int j -> Int (i + j) .... -- John Skaller, mailto:skaller@users.sf.net voice: 061-2-9660-0850, snail: PO BOX 401 Glebe NSW 2037 Australia Checkout the Felix programming language http://felix.sf.net ------------------- 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