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 FAA14175; Thu, 19 Sep 2002 05:09:44 +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 FAA14898 for ; Thu, 19 Sep 2002 05:09:43 +0200 (MET DST) Received: from mail3.tpgi.com.au (mail.tpgi.com.au [203.12.160.59]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g8J39f129893 for ; Thu, 19 Sep 2002 05:09:42 +0200 (MET DST) Received: from ozemail.com.au (syd-ts15-2600-185.tpgi.com.au [203.213.83.185]) (authenticated (0 bits)) by mail3.tpgi.com.au (8.11.6/8.11.6) with ESMTP id g8J35Yv01377 for ; Thu, 19 Sep 2002 13:05:35 +1000 Message-ID: <3D893FF0.7070708@ozemail.com.au> Date: Thu, 19 Sep 2002 13:09:36 +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: caml-list@inria.fr Subject: Re: [Caml-list] mutually referencing compilation units References: <20020917143228.A28138@pauillac.inria.fr> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Xavier Leroy wrote: >>Is the fact that two mutually referencing units can't be compiled >>supposed to be a Good Thing? >> > > No, it is acknowledged as an unfortunate limitation and an annoyance > to the programmer. However, there are deep semantical and > type-theoretical reasons that make it hard to allow cross-module > recursion in ML. This is actually a research area that is still > largely open. I'm curious if there is a "lay" explanation of what these restrictions are. Felix supports intermodule recursion (with some constraints). Indeed, there is no explicit construction for sequential module definitions (you can do it using nesting). One of the key distinctions which might make this possible in Felix is that function declarations: fun f(i:int):int { return i; } do NOT declare values. Thus, the above (which maps semantically to a C++ class) is quite distinct from val g = f; where g is a function closure (which maps to C++ object of class f). The recursion allowed includes type recursion too. The constraint only applies to open directives and is related to name lookup, not typing. Since opening a module may lift a name into the current scope, there is a constraint on the names of modules being opened .. since it has to be independent of the order of opening other modules. -- 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