Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Julien Signoles <Julien.Signoles@lri.fr>
To: Andrej Bauer <Andrej.Bauer@andrej.com>
Cc: Jacques Le Normand <rathereasy@gmail.com>, caml-list@inria.fr
Subject: Re: [Caml-list] using functors in objects
Date: Fri, 11 Apr 2008 09:52:06 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.63.0804110947230.15825@serveur9-10.lri.fr> (raw)
In-Reply-To: <47FE02A3.2030503@andrej.com>


> Perhaps something like this with recursive modules. I have a feeling it
> can be simplified, though.
>
> Andrej
>
> --------------------
> module A (X: sig type t end) =
> struct
>  class c =
>  object
>    val b = (None : X.t option)
>  end
> end
>
> module rec D : sig
>  class d : object val b : D.d option end
> end =
> struct
>  class d =
>  object
>    inherit Y.c
>  end
> end
>
> and Y :
> sig
>  class c : object val b : D.d option end
> end =
>  A(struct type t = D.d end)
>
> class d = D.d
>
> ----------------

it doesn't work because the recursive modules cannot be safely 
initialized in such a case:

$ ocamlc -v
The Objective Caml compiler, version 3.10.1
Standard library directory: /home/jsignole/local/godi/lib/ocaml/std-lib
$ ocamlc -o modclass modclass.ml
$ ./modclass
Fatal error: exception Undefined_recursive_module("modclass.ml", 23, 2)

Yet I haven't a good solution for such a think :-(.

--
Julien


  reply	other threads:[~2008-04-11  7:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-10  0:52 Jacques Le Normand
2008-04-10 12:05 ` [Caml-list] " Andrej Bauer
2008-04-11  7:52   ` Julien Signoles [this message]
2008-04-11 11:59     ` Andrej Bauer

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.63.0804110947230.15825@serveur9-10.lri.fr \
    --to=julien.signoles@lri.fr \
    --cc=Andrej.Bauer@andrej.com \
    --cc=caml-list@inria.fr \
    --cc=rathereasy@gmail.com \
    /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