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 CAA32158; Thu, 22 Aug 2002 02:01:55 +0200 (MET DST) 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 CAA32243 for ; Thu, 22 Aug 2002 02:01:53 +0200 (MET DST) Received: from gianther.hypbus.com (h209-139-221-5.gtconnect.net [209.139.221.5]) by concorde.inria.fr (8.11.1/8.11.1) with SMTP id g7M01p925019 for ; Thu, 22 Aug 2002 02:01:52 +0200 (MET DST) Received: (qmail 17640 invoked by uid 71); 22 Aug 2002 00:04:25 -0000 Received: from unknown (HELO mail.gx.ca) (127.0.0.1) by localhost with SMTP; 22 Aug 2002 00:04:25 -0000 Received: from 209.139.221.124 (SquirrelMail authenticated user nalexand) by mail.gx.ca with HTTP; Wed, 21 Aug 2002 17:04:25 -0700 (PDT) Message-ID: <61954.209.139.221.124.1029974665.squirrel@mail.gx.ca> Date: Wed, 21 Aug 2002 17:04:25 -0700 (PDT) Subject: Re: [Caml-list] Naming polymorphic variant types From: "Nick Alexander" To: X-Priority: 3 Importance: Normal X-MSMail-Priority: Normal Reply-To: nalexander@amavi.com X-Mailer: SquirrelMail (version 1.2.6) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > From: "Nick Alexander" >> Now, can anyone point me at docs about polymorphic records? I can't >> find a thing :( They were mentioned in the 3.05 release notes as'- >> Support for polymorphic methods and record fields.' >> which could be an extension of the object-based polymorphic records or >> a really useful extension like the polymorphic variants. > > Oops, you didn't parser the above sentence correctly. > What 3.05 adds is "polymorphic methods" and "polymorphic record > fields", but not "polymorphic records" (you still have to simulate them > with objects). Polymorphic record fields are shortly described in the > core language part of the tutorial; they provide explicit > polymorhism at the record field level, which may be light than going > through objects and methods. Heh, that's what I thought. Oh well... maybe there is a way to do what I want anyway. Let's say I have a record, say {a:int; b:int; c:int}. I wish to have a function that returns sub-records, say {a:int; b:int} or {b:int; c:int}. However, I don't want to (and can't, if I recall, due to name clashes) declare all the sub record types. So I was hoping for something pretty such as the polymorphic variants. I don't see how this situation can be faked with objects -- objects (and classes) are even more heavy than record types! By heavy, I mean that I cannot create a new object type with just the right methods on the fly, I must first declare the class type, etc. It seems like polymorphic row variables are _so_ close, but I certainly don't understand enough type/category theory to extend the system myself. Am I out of luck? Nick ------------------- 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