Version française
Home     About     Download     Resources     Contact us    
Browse thread
strange behavior with record type definition
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Christophe TROESTLER <Christophe.Troestler@u...>
Subject: Re: [Caml-list] strange behavior with record type definition
On Sat, 12 Nov 2005, Michael Wohlwend <micha-1@fantasymail.de> wrote:
> 
> On Saturday 12 November 2005 13:51, skaller wrote:
> > > > So that the type of an expression:
> > > >
> > > > 	{ x = 1; y = 2 }
> > > >
> > > > can be determined.
> 
> I would have no problem to write in these situations Type1.{ x = 1 } or  
> Type2.{x = 2} , I think there exists  camlp4 program for this.

You can do almost the same with modules:

module T1 = struct type t = { x : int; y : int } end
module T2 = struct type t = { x : int; y : int } end

{ T1.x = 1; y = 2 } (* No need to repeat the module name *)
{ T2.x = 2; y = 3 }

ChriS