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 JAA32673; Sun, 18 May 2003 09:46:14 +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 JAA32559 for ; Sun, 18 May 2003 09:46:13 +0200 (MET DST) Received: from qrnik.knm.org.pl (paf87.warszawa.sdi.tpnet.pl [217.96.225.87]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h4I7kDT09215 for ; Sun, 18 May 2003 09:46:13 +0200 (MET DST) Received: from localhost ([127.0.0.1] ident=qrczak) by qrnik.knm.org.pl with esmtp (Exim 3.36 #1) id 19HIs0-00012R-00 for caml-list@inria.fr; Sun, 18 May 2003 09:46:12 +0200 From: "Marcin 'Qrczak' Kowalczyk" To: caml-list@inria.fr Subject: Re: [Caml-list] Sumtypes of records Date: Sun, 18 May 2003 09:46:11 +0200 User-Agent: KMail/1.5.1 References: <4.3.2.7.2.20030516182821.042f6dd0@localhost> <4.3.2.7.2.20030517232318.033e19c0@localhost> In-Reply-To: <4.3.2.7.2.20030517232318.033e19c0@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: 8bit Content-Disposition: inline Message-Id: <200305180946.12006.qrczak@knm.org.pl> X-Spam: no; 0.00; marcin:01 'qrczak':01 kowalczyk:01 qrczak:01 caml-list:01 nie:99 hecker:01 shorthand:01 foo:01 pointers:01 structs:01 unions:01 arrays:01 compiler:01 chris:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Dnia nie 18. maja 2003 08:33, Chris Hecker napisał: > 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 Ah, I see. Like in Turbo Pascal (I don't know about Pascal in theory) where it applies to arrays and pointers too. And like structs and unions in C and C++. I don't like it because it's confusing. The syntax suggests that record types are built on the fly like tuples (like in SML) but the semantics is that they are explicitly defined somewhere like algebraic types. And this would be the only such case. When you would write: type foo = Foo of {x : int} type bar = Bar of {x : int} then this is a type error: let f (Foo y) = Bar y -- __("< Marcin Kowalczyk \__/ qrczak@knm.org.pl ^^ http://qrnik.knm.org.pl/~qrczak/ ------------------- 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