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 QAA05062; Mon, 10 Dec 2001 16:26:54 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id QAA05279 for caml-list@pauillac.inria.fr; Mon, 10 Dec 2001 16:26:54 +0100 (MET) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA31995 for ; Mon, 10 Dec 2001 11:50:09 +0100 (MET) Received: from smtp1.9tel.net (smtp1.9tel.net [212.30.96.108]) by nez-perce.inria.fr (8.11.1/8.11.1) with SMTP id fBAAo7H05366 for ; Mon, 10 Dec 2001 11:50:08 +0100 (MET) Received: (qmail 30564 invoked from network); 10 Dec 2001 10:50:06 -0000 Received: from unknown (HELO univ-savoie.fr) (213.203.64.127) by 0 with SMTP; 10 Dec 2001 10:50:06 -0000 Message-ID: <3C149697.676DAD6E@univ-savoie.fr> Date: Mon, 10 Dec 2001 12:03:51 +0100 From: Christophe Raffalli Organization: =?iso-8859-1?Q?Universit=E9?= de Savoie X-Mailer: Mozilla 4.78 [fr] (X11; U; Linux 2.4.8-26mdk i686) X-Accept-Language: en MIME-Version: 1.0 CC: caml-list@inria.fr Subject: [Caml-list] Module and structure ... References: <29757.1007837428@nova.botz.org> <20011209070929.A15616@verdot.inria.fr> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk I am using module in a very extensive way in a program ... and I do not see anything you can do with structure taht you can not do with structure. The only problems are syntactic (and I hope they will be fixed soon): M(A).fied has to be written let module X = M(A) in X.field functor (x:type) -> struct . . . end has to be written functor (X:sig x:type end) -> struct open X... end (with extra modifications to call the functor) But then you can "open" a structure, share labels, use subtyping, and so on ... Actually the "open M in" feature is missing but can be simulated by creating a module: open M in P := let module Result = struct open M let result = P end in Result.result So why not adding this open M in feature and the two others above has they are only (almost) syntactic sugar ? --- And then, why not replace structures by modules ? It would simplify the compiler ? would it be less efficient ? If yes, isn't it just a matter of optimisation ? --- And then the next step is to merge module and object ... It may no be so difficult but this looks like research topic ... -- Christophe Raffalli Université de Savoie Batiment Le Chablais, bureau 21 73376 Le Bourget-du-Lac Cedex tél: (33) 4 79 75 81 03 fax: (33) 4 79 75 87 42 mail: Christophe.Raffalli@univ-savoie.fr www: http://www.lama.univ-savoie.fr/~RAFFALLI ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr