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 IAA31256; Sun, 18 May 2003 08:33:59 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id IAA29139 for ; Sun, 18 May 2003 08:33:58 +0200 (MET DST) Received: from relay.pair.com (relay.pair.com [209.68.1.20]) by nez-perce.inria.fr (8.11.1/8.11.1) with SMTP id h4I6XvT07922 for ; Sun, 18 May 2003 08:33:57 +0200 (MET DST) Received: (qmail 14938 invoked from network); 18 May 2003 06:33:55 -0000 Received: from arda.pair.com (HELO compaqreview.d6.com) (209.68.1.133) by relay.pair.com with SMTP; 18 May 2003 06:33:55 -0000 X-pair-Authenticated: 209.68.1.133 Message-Id: <4.3.2.7.2.20030517232318.033e19c0@localhost> X-Sender: checker@localhost X-Mailer: QUALCOMM Windows Eudora Version 4.3.2 Date: Sat, 17 May 2003 23:33:05 -0700 To: "Marcin 'Qrczak' Kowalczyk" , caml-list@inria.fr From: Chris Hecker Subject: Re: [Caml-list] Sumtypes of records In-Reply-To: <200305171526.39769.qrczak@knm.org.pl> References: <4.3.2.7.2.20030516182821.042f6dd0@localhost> <003e01c31645$2bfa3c00$e50e76d5@j> <4.3.2.7.2.20030516182821.042f6dd0@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Spam: no; 0.00; hecker:01 checker:01 caml-list:01 foo:01 shorthand:01 inference:01 compiler:01 chris:01 int:01 age:96 explicitly:03 let:04 somewhat:06 type:07 defined:07 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk >let foo x = x.bar >What is the type of foo if there is no named record in scope having field bar? It could have a type, it just doesn't have a programmer defined name. This has nothing to do with having the same field names in various records...field names would hide previous ones just like they [annoyingly] currently do. This is just about whether there's some way to do anonymous records. So for "Bar { age : int; }" the compiler would generate some internal name to use for the record type. It would be shorthand for: type bar_anonymous_record_type_name_123 = { age : int; } type foo = Bar bar_anonymous_record_type_name_123 The only difference is you wouldn't be able to use "bar_anon...123" explicitly, only via inference since it's generated. This isn't a big deal or a high priority to add, but I don't see why it wouldn't just work and be somewhat useful. Chris ------------------- 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