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 UAA05680 for caml-red; Thu, 8 Feb 2001 20:15:57 +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 UAA12684 for ; Thu, 8 Feb 2001 20:15:38 +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 f18JFYX11431; Thu, 8 Feb 2001 20:15:34 +0100 (MET) Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id UAA14918; Thu, 8 Feb 2001 20:15:34 +0100 (MET) From: Pierre Weis Message-Id: <200102081915.UAA14918@pauillac.inria.fr> Subject: Re: compilation of lablgl examples. In-Reply-To: <3A82CA43.797E84C@ozemail.com.au> from John Max Skaller at "Feb 9, 101 03:33:07 am" To: skaller@ozemail.com.au (John Max Skaller) Date: Thu, 8 Feb 2001 20:15:33 +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 > Pierre Weis wrote: [...] > > Sometimes you can use polymorphism to > > help for instance defining > > > > | Function of 'parameter list * typecode_t * 'b > > > > could be used to modelize both > > | DCL_function of parameter_t list * typecode_t * asm_t list > > | BDCL_function of bparameter_t list * btypecode_t * int list * > > exe_t list * name_map_t > > I'm not sure how: these two declarations are for variant > components of _distinct_ types. [...] > 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 Right. I meant you define only one type type ('parameter, 'b) ast = | Function of 'parameter list * typecode_t * 'b;; Then you define two abbreviations instances of ast to define the types to which DCL_function and BDCL_function belong: type dcl = (parameter_t, asm_t list) ast and bdcl = (bparameter_t, int list * exe_t list * name_map_t) ast;; That's only an idea: if types are too diffrent the number of type parameters rapidly becomes excessive. Regards, Pierre Weis INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://pauillac.inria.fr/~weis/