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 BAA32712; Fri, 4 Oct 2002 01:58:16 +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 BAA32690 for ; Fri, 4 Oct 2002 01:58:15 +0200 (MET DST) Received: from grace.speakeasy.org (grace.speakeasy.org [216.254.0.2]) by concorde.inria.fr (8.11.1/8.11.1) with SMTP id g93NwE512319 for ; Fri, 4 Oct 2002 01:58:15 +0200 (MET DST) Received: (qmail 27691 invoked by uid 36130); 3 Oct 2002 23:58:13 -0000 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 3 Oct 2002 23:58:13 -0000 Date: Thu, 3 Oct 2002 16:58:13 -0700 (PDT) From: brogoff@speakeasy.net To: caml-list@inria.fr Subject: [Caml-list] Forward references Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, I was browsing the mailing list archives when I reread the article http://caml.inria.fr/archives/199902/msg00020.html where it was mentioned that there was once some kind of experimental forward declaration feature in an earlier Caml. This was used to get full polymorphic recursion in the language (it served as a mandatory type constraint) and it was also discussed as a way to get some cross module recursion without the ugly "ref to function" hack mentioned in the manual. I'm curious as to whether types could also be forward declared, or deferred, as well, and if this forward ref machinery could deal with the problem of instantiating a functor which is in a recursive relationship with a type, as in the following faux-Caml forward type composite = { data : string ; children : CompositeSet.t } and cmp x y = Pervasives.compare x.data y.data and module CompositeSet = Set.Make(module type t = composite let compare = cmp end) This is a lighter approach than the one involving MoscowML recursive modules, since there is no extra module wrapper, but can probably be transformed into the mosml style mechanically. Is there some showstopper that prevents this (admittedly half baked) approach from being feasible? I'd really like to see some solution to the above mentioned problems in OCaml sooner rather than later. -- Brian ------------------- 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