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 IAA14447; Fri, 16 Jul 2004 08:57:20 +0200 (MET DST) 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 IAA03054 for ; Fri, 16 Jul 2004 08:57:19 +0200 (MET DST) From: sjah@land.ru Received: from www3.pochta.ru (www3.pochta.ru [81.211.64.23]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i6G6vISH017554 for ; Fri, 16 Jul 2004 08:57:19 +0200 Received: by HotBOX.Ru WebMail v2.1 id i6G724f0023964; Fri, 16 Jul 2004 11:02:04 +0400 (MSD) Date: Fri, 16 Jul 2004 11:02:04 +0400 (MSD) Message-Id: <200407160702.i6G724f0023964@www3.pochta.ru> To: caml-list@inria.fr Cc: sjah@land.ru MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 8bit X-Mailer: Free WebMail HotBOX.ru X-Proxy-IP: [81.1.200.134] X-Originating-IP: [192.10.100.81] Subject: [Caml-list] Why redefinition of modules is forbidden? X-Miltered: at concorde with ID 40F77C4E.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; submodule:01 subj:99 struct:01 struct:01 val:01 val:01 sig:01 modules:02 module:03 module:03 let:04 let:04 functions:05 structure:06 definition:06 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hello! How to do following thing the best way? I have to extend old module and its submodule with some new functions. Old module is big enouth. This method doesn't work due to %subj%: module X = struct let f1 = ... let f2 = ... ... let f99 = ... module Y = struct let f1 = .. let f2 = .. ... let f99 = ... end end module ExtX = struct include X let f100 = ... ... let f199 = ... module Y = struct include Y let f100 = ... ... let f199 = ... end end Multiple definition of the module name Y. Names must be unique in a given structure or signature. Following approach works, but it is hard to maintain big module type signature to reflect changes in X and Y. module X = struct let f1 = ... let f2 = ... ... let f99 = ... module Y = struct let f1 = .. let f2 = .. ... let f99 = ... end end module type X_without_Y = sig val f1 ; ... val f2 : ... ... val f99 : ... end module ExtX = struct include (X : X_without_Y) let f100 = ... ... let f199 = ... module Y = struct include X.Y let f100 = ... ... let f199 = ... end end ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners