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 MAA15289; Thu, 22 Mar 2001 12:16:53 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 MAA15203 for ; Thu, 22 Mar 2001 12:16:52 +0100 (MET) Received: from shiva.jussieu.fr (shiva.jussieu.fr [134.157.0.129]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f2MBGpb17258 for ; Thu, 22 Mar 2001 12:16:51 +0100 (MET) Received: from akasha.ijm.jussieu.fr (akasha.ijm.jussieu.fr [134.157.173.57]) by shiva.jussieu.fr (8.11.3/jtpda-5.3.3) with ESMTP id f2MBGpL11090 for ; Thu, 22 Mar 2001 12:16:51 +0100 (CET) Received: (from andrieu@localhost) by akasha.ijm.jussieu.fr (8.9.3/8.9.3) id MAA26871; Thu, 22 Mar 2001 12:16:43 +0100 From: Olivier Andrieu MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <15033.57114.663134.990967@akasha.ijm.jussieu.fr> Date: Thu, 22 Mar 2001 12:16:42 +0100 To: caml-list@inria.fr Subject: Re: [Caml-list] about typedefs... (was: duplication implementation/interface) In-Reply-To: <3AB9D372.A359B1F3@lri.fr> References: <3AB9D372.A359B1F3@lri.fr> X-Mailer: VM 6.92 under Emacs 20.7.1 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Judicael Courant [Thursday 22 March 2001] : > Brian Rogoff a écrit : > > > [...] > > What's the problem with the hack I suggested earlier: put the > > huge variant (and other duplicated types) in a "pure" .mli file > > (I hate using .ml for that) and "open"ing it where you need it, > > once in the .mli file and once in the .ml file? This way you > > reduce the duplication to two lines. > > > > I know some people are open-phobes, but I find this use of open > > to be acceptable. > > > > As for open-phobes, somebody gave me a good solution a few days > ago: you can locally define a module with a very short name. There's something I've been wondering about type definitions : In type definitions, you can specify type equation and representation. - when none is specified, the defined type is abstract ; - when an equation is given, you get an alias of an already existing type ; - with a representation, a new variant or record is defined. But it is possible to use both, so that you get an alias of an already defined variant and record but with the fields or constructors attached to the new type. It don't really see the point of such a definition : now the type representation is in 4 different places, and the only gain I see is that you don't have to prefix the fields names with a module path. That's no big deal since you can redefine the module with a short name (one letter). So, is this form of type definitions actually used, does it have another purpose besides this namespace issue ? Olivier ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr