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 AAA05174; Wed, 31 Jul 2002 00:15:10 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id AAA05848 for caml-list@pauillac.inria.fr; Wed, 31 Jul 2002 00:15:09 +0200 (MET DST) 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 JAA19588 for ; Tue, 30 Jul 2002 09:49:32 +0200 (MET DST) Received: from julie.univ-savoie.fr (univax.univ-savoie.fr [193.48.120.32]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g6U7nRb28220 for ; Tue, 30 Jul 2002 09:49:28 +0200 (MET DST) Received: from post.bourget.univ-savoie.fr (post.bourget.univ-savoie.fr [193.48.120.73]) by julie.univ-savoie.fr (8.9.3/jtpda-5.3.3) with ESMTP id JAA79294 for ; Tue, 30 Jul 2002 09:49:27 +0200 (CEST) Received: from [192.168.4.22] ([192.168.4.22]) by post.bourget.univ-savoie.fr (8.12.1/jtpda-5.4) with ESMTP id g6U7nMEH014686 for ; Tue, 30 Jul 2002 09:49:23 +0200 Subject: [Caml-list] Record with one non mutable filed From: Christophe Raffalli To: caml-list@inria.fr In-Reply-To: <20020729144527.A30919@pauillac.inria.fr> References: <20020729144527.A30919@pauillac.inria.fr> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable X-Mailer: Evolution/1.0.2-5mdk Date: 30 Jul 2002 09:48:07 +0200 Message-Id: <1028015288.2026.5.camel@boris.univ-savoie.fr> Mime-Version: 1.0 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk How are compiled record with only one non mutable field ? are they removed ? In Ocaml 3.05, record with only one non mutable field may be used in the following way: type 'a foo =3D=20 A of int | B of 'a type bar =3D { value : 'a.'a foo } this means that type bar is somehow a subtype of type foo (constructor B being removed. then I think (but may be wrong) that an expression as let b =3D { value =3D A 3 } could be compiled as=20 let b =3D A 3 Is this optimization performed ? (I know this is not very important for efficiency ... but I am just curious) --=20 Christophe Raffalli Universit=E9 de Savoie Batiment Le Chablais, bureau 21 73376 Le Bourget-du-Lac Cedex t=E9l: (33) 4 79 75 81 03 fax: (33) 4 79 75 87 42 mail: Christophe.Raffalli@univ-savoie.fr www: http://www.lama.univ-savoie.fr/~RAFFALLI ------------------- 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