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 KAA26803; Sun, 7 Apr 2002 10:54:47 +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 KAA29727 for ; Sun, 7 Apr 2002 10:54:36 +0200 (MET DST) Received: from hirsch.in-berlin.de (hirsch.in-berlin.de [192.109.42.6]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g378sQX04444 for ; Sun, 7 Apr 2002 10:54:35 +0200 (MET DST) Received: from hirsch.in-berlin.de (localhost [127.0.0.1]) by hirsch.in-berlin.de (8.12.1/8.12.1/Debian -2) with ESMTP id g36Ht8w2017586 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NOT) for ; Sat, 6 Apr 2002 19:55:12 +0200 Received: (from uucp@localhost) by hirsch.in-berlin.de (8.12.1/8.12.1/Debian -2) with UUCP id g36Ht48R017527 for caml-list@inria.fr; Sat, 6 Apr 2002 19:55:04 +0200 X-Envelope-From: oliver@first.in-berlin.de X-Envelope-To: caml-list@inria.fr Received: from localhost (oliver@localhost) by first.in-berlin.de (8.7.6/8.7.3) with SMTP id TAA03991 for ; Sat, 6 Apr 2002 19:52:34 +0200 Date: Sat, 6 Apr 2002 19:52:34 +0200 (MET DST) From: Oliver Bandel To: caml-list@inria.fr Subject: [Caml-list] Records with same structure in OCaml Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hello, when I use two records with the same structure, how can they be distinguished? And how can the correct type be choosed? Example: type complex = { re: float; im: float }; type foo = { re: float; im: float }; let x = { re =2.0; im = 55.0 }; The x here has type foo. How can I choose type complex? Doesn't that yield a mess, when calling functions with that values? I tried some things on the toplevel, and it seems messy to me. How will that be handled in Ocaml? Is it not good to have two types with same structure? Ciao, Oliver ------------------- 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