From: John Max Skaller <skaller@ozemail.com.au>
To: caml-list@inria.fr
Subject: Re: [Caml-list] mutually referencing compilation units
Date: Thu, 19 Sep 2002 13:09:36 +1000 [thread overview]
Message-ID: <3D893FF0.7070708@ozemail.com.au> (raw)
In-Reply-To: <20020917143228.A28138@pauillac.inria.fr>
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
next prev parent reply other threads:[~2002-09-19 3:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-15 20:15 Henri Dubois-Ferriere
2002-09-16 3:44 ` [Caml-list] function polymorphic in number of arguments? Quetzalcoatl Bradley
2002-09-16 12:19 ` Francois Thomasset
2002-09-16 12:24 ` Francois Thomasset
2002-09-17 12:32 ` [Caml-list] mutually referencing compilation units Xavier Leroy
2002-09-19 3:09 ` John Max Skaller [this message]
2002-09-19 5:09 ` [Caml-list] ocamlmktop linking on Darwin Lex Stein
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3D893FF0.7070708@ozemail.com.au \
--to=skaller@ozemail.com.au \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox