caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Daniel Bünzli" <daniel.buenzli@erratique.ch>
To: caml-list caml-list <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] Working on dependent projects with ocamlbuild
Date: Thu, 1 Nov 2007 11:53:44 +0100	[thread overview]
Message-ID: <12B29D95-87FB-43F1-A26F-6128EB41FDF5@erratique.ch> (raw)
In-Reply-To: <7BE597C9-3EF8-4DF4-946F-826FF312A256@erratique.ch>

Hello,

I'm now trying to do something a little bit more complex but fail to  
solve it in the simple way I mentionned (maybe it is not possible). I  
still have the same setup of two independent projects each depending  
on a base project.

base/src
p1/src
p2/src

The base project is structured as follows :

base/src/a.ml
base/src/b.ml
base/src/base.ml
base/src/base.mli

with base.ml as follows

module A = A
module B = B
val ...

The idea is that b.ml can access things in a.ml that users of the  
base project should not access. What I used to do is to  
appropriatlely constrain the signatures of A and B in base.mli and  
then create in a directory :

dest/base.cma (containing a.cmo b.cmo base.cmo)
dest/base.cmi
dest/base.mli

Thus forcing access to A and B via the constrained signature Base.A  
and Base.B.

But if I use the approach mentionned in my initial posting users of  
base will see the unconstrained a.cmi and b.cmi. Is there a way that  
allows me to use this approach while maintaining the abstraction I  
get with cma's ? Even if it means plugins in p1 and p2 ? I have the  
impression that the response is negative because even if I try to  
build a .cma with a mllib the build directory with have all .cmi and  
the compilers will look at them.

Thanks for your answers,

Daniel


  parent reply	other threads:[~2007-11-01 10:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-24 11:07 Daniel Bünzli
2007-10-24 12:10 ` [Caml-list] " Matthieu Dubuget
2007-10-24 13:09 ` Nicolas Pouillard
2007-11-01 10:53 ` Daniel Bünzli [this message]
2007-11-01 12:51   ` Daniel Bünzli
2007-11-02 15:32   ` Nicolas Pouillard
2007-11-04 21:08     ` Daniel Bünzli
2007-11-05 10:02       ` Nicolas Pouillard

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=12B29D95-87FB-43F1-A26F-6128EB41FDF5@erratique.ch \
    --to=daniel.buenzli@erratique.ch \
    --cc=caml-list@yquem.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).