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 SAA19320 for caml-red; Mon, 11 Dec 2000 18:22:15 +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 TAA04732 for ; Fri, 8 Dec 2000 19:42:19 +0100 (MET) Received: from localhost.localdomain (ppp166.dyn147.pacific.net.au [210.23.147.166]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id eB8IgFb23866; Fri, 8 Dec 2000 19:42:16 +0100 (MET) Received: from ozemail.com.au (IDENT:root@localhost [127.0.0.1]) by localhost.localdomain (8.9.3/8.8.7) with ESMTP id FAA29727; Sat, 9 Dec 2000 05:41:28 +1100 Message-ID: <3A312B58.42A9C070@ozemail.com.au> Date: Sat, 09 Dec 2000 05:41:28 +1100 From: John Max Skaller X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.2.12-20 i686) X-Accept-Language: en MIME-Version: 1.0 To: Pierre Weis CC: Sven LUTHER , caml-list@inria.fr Subject: Re: Same label in different types, how do people solve this? References: <200012080936.KAA10930@pauillac.inria.fr> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: weis@pauillac.inria.fr Pierre Weis wrote: > 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 This is logical .. but do we really need another operator? The syntax is bloating beyond C++ :-) If some kind of overloading is being considered, couldn't it apply to record labels too? I guess you'd have to use a let/type .. and construction: let f x = x + x and f x = x +. x in f 1, f 1.0 type p2 = { x : int; y : int } and p3 = { x : int; y : int; z : int };; { x=1; y = 2 };; It seems unprincipled that the first case reports an error, but in the second, the second 'x' hides the first. -- John (Max) Skaller, mailto:skaller@maxtal.com.au 10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850 checkout Vyper http://Vyper.sourceforge.net download Interscript http://Interscript.sourceforge.net