caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Hendrik Tews <tews@tcs.inf.tu-dresden.de>
To: caml-list@inria.fr
Subject: Re: circular types?
Date: Thu, 26 Oct 2000 11:12:36 +0200 (MET DST)	[thread overview]
Message-ID: <200010260912.LAA21537@ithif20.inf.tu-dresden.de> (raw)
In-Reply-To: <39F6E831.621B85E3@ozemail.com.au>

Hi,

John Max Skaller writes:
   From: John Max Skaller <skaller@ozemail.com.au>
   Date: Thu, 26 Oct 2000 01:03:29 +1100
   Subject: Re: circular types?
   
   I think this can be done now. Here is the method: to have a type t
   and a class c mutually dependent, for example:
   
   	class type c = object x : t end
   	and type  t = C c | Null
   
   write
   
   	class type c' ['t] = object x : 't end
   	type t = C t c' | Null
   	class type c = t c'
   

Yes, this is the theoretical answer. But this just doesn't work
out in anything bigger than a tutorial example. I am involved in
programming a logic compiler. We have about 40 variant types and
at least 10 classes. If my design were not constraint by the
abilities of the ocaml compiler some of the classes were in
mutual recursion with the bigger halve of the variant types. So
you are not telling me seriously I should write classes with 10
type variables!

Just for curiosity: Does somebody use the above workaround in a
project with more than 10.000 lines of ocaml code? (We do, but
every typing error is a nightmare.)

Bye,

Hendrik



  parent reply	other threads:[~2000-10-26 14:48 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-10-23  7:43 Tom Hirschowitz
2000-10-23 15:35 ` Brian Rogoff
2000-10-25 14:03   ` John Max Skaller
2000-10-25 19:47     ` Brian Rogoff
2000-10-26  9:12     ` Hendrik Tews [this message]
2000-10-26 16:37       ` John Max Skaller
2000-10-24  8:37 ` Hendrik Tews
2000-10-25 14:31   ` John Max Skaller
2000-10-26  8:51     ` Hendrik Tews
  -- strict thread matches above, loose matches on Subject: below --
2000-10-24  8:48 Tom Hirschowitz
2000-10-26  8:39 ` Hendrik Tews
2000-10-26  9:11   ` Tom Hirschowitz
2000-10-20  2:35 Chris Hecker
2000-10-20 12:24 ` Pierre Weis
2000-10-20 21:34   ` Chris Hecker
2000-10-21  8:02     ` Pierre Weis
2000-10-21 18:37       ` Chris Hecker
2000-10-21 12:22     ` Vitaly Lugovsky
2000-10-21 18:29       ` Chris Hecker
2000-10-21 22:36     ` Brian Rogoff
2000-10-23 18:43     ` Anton Moscal

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=200010260912.LAA21537@ithif20.inf.tu-dresden.de \
    --to=tews@tcs.inf.tu-dresden.de \
    --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).