From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA11609 for caml-red; Fri, 8 Dec 2000 10:37:47 +0100 (MET) 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 KAA12794 for ; Fri, 8 Dec 2000 10:36:46 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id eB89ajr01140; Fri, 8 Dec 2000 10:36:45 +0100 (MET) Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA10930; Fri, 8 Dec 2000 10:36:44 +0100 (MET) From: Pierre Weis Message-Id: <200012080936.KAA10930@pauillac.inria.fr> Subject: Re: Same label in different types, how do people solve this? In-Reply-To: <20001208103125.A556@lambda.u-strasbg.fr> from Sven LUTHER at "Dec 8, 100 10:31:25 am" To: luther@dpt-info.u-strasbg.fr (Sven LUTHER) Date: Fri, 8 Dec 2000 10:36:44 +0100 (MET) Cc: caml-list@inria.fr X-Mailer: ELM [version 2.4ME+ PL28 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: weis@pauillac.inria.fr > Another idea would be to add some construct to use something like : > > type p3d = { x:float;y:float;z:float } > type p2d = { x:float;y:float } > > and then be able to do : > > {p3d.x=10.;p3d.y=20.;p3d.z=30.} > > and > > {p2d.x=0; p2d.y=5} > > Would this be difficult to do ? You will have ambiguities in accessing records: what means r.y.z ? Is it access to field z of type y of r, or access to field z of access to field y of r ? I would suggest another syntactic notation to specify the type to which a label belongs: label@@type. {x@@p2d = 0; y = 5} r.x@@p2d Best regards, Pierre Weis INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://cristal.inria.fr/~weis/