caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: brogoff@speakeasy.net
To: caml-list@inria.fr
Subject: [Caml-list] Forward references
Date: Thu, 3 Oct 2002 16:58:13 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.44.0210031623590.15994-100000@grace.speakeasy.net> (raw)

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


             reply	other threads:[~2002-10-03 23:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-03 23:58 brogoff [this message]
2002-10-04  8:46 Tom Hirschowitz
2002-10-06 16:34 ` brogoff

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=Pine.LNX.4.44.0210031623590.15994-100000@grace.speakeasy.net \
    --to=brogoff@speakeasy.net \
    --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;
as well as URLs for NNTP newsgroup(s).