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 OAA01073; Mon, 5 May 2003 14:20:16 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 OAA00883 for ; Mon, 5 May 2003 14:20:14 +0200 (MET DST) Received: from mail2.tpgi.com.au (mail.tpgi.com.au [203.12.160.58]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h45CKBT03596; Mon, 5 May 2003 14:20:12 +0200 (MET DST) Received: from ozemail.com.au (syd-ts22-2600-037.tpgi.com.au [203.26.30.37]) (authenticated bits=0) by mail2.tpgi.com.au (8.12.9/8.12.9) with ESMTP id h45CK6kP000933; Mon, 5 May 2003 22:20:08 +1000 Message-ID: <3EB656F6.2010006@ozemail.com.au> Date: Mon, 05 May 2003 22:20:06 +1000 From: John Max Skaller User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2.1) Gecko/20010901 X-Accept-Language: en-us MIME-Version: 1.0 To: Xavier Leroy CC: caml-list@inria.fr Subject: Re: [Caml-list] recursive modules References: <20030505102121.B23988@pauillac.inria.fr> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Kaspersky-Antivirus: Passed X-Spam: no; 0.00; ozemail:01 caml-list:01 recursion:01 ocamlc:01 struct:01 implicitly:01 toxteth:01 glebe:01 2037,:01 9660:01 0850:01 anyhow:01 ocaml:01 command:98 rec:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Xavier Leroy wrote: > Since the issue of recursive modules has (again) popped up on this > list, it seems that now is a good time to announce an experimental > design and implementation for recursive modules in OCaml that I've > been working on lately. > What this extension provides is a "module rec ... and ..." binding > that allows the definition of mutually-recursive modules within the > same compilation units. Recursion between compilation units is a > different problem that is not adressed yet. > Comments and feedback are most welcome, as long as they are of the > constructive kind. An interim hack may give the appearance of "almost" separate compilation: require mutually recursive modules in separate files be compiled together on the one command line: ocamlc -bb file1.ml file2.ml -eb [where -bb and -eb mean begin and end brackets] and, well, simply concatenate them after adding wrapper code: // file: file12.ml generated module file1 = struct #include file1.ml end and module file2 = struct #include file2.ml end where file12 is implicitly opened. This isn't separate compilation, but it does allow something almost more important (since ocaml is so fast, who cares about separate compilation anyhow?): it allows breaking up long files into several smaller ones. -- John Max Skaller, mailto:skaller@ozemail.com.au snail:10/1 Toxteth Rd, Glebe, NSW 2037, Australia. voice:61-2-9660-0850 ------------------- 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