caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: John Max Skaller <skaller@ozemail.com.au>
To: Warp <warplayer@free.fr>
Cc: Tom Hirschowitz <Tom.Hirschowitz@inria.fr>, OCaml <caml-list@inria.fr>
Subject: Re: [Caml-list] Modules Order
Date: Fri, 19 Apr 2002 06:55:40 +1000	[thread overview]
Message-ID: <3CBF32CC.3030806@ozemail.com.au> (raw)
In-Reply-To: <004201c1e6e7$2300e6a0$3900a8c0@warp>

Warp wrote:

>
>The problem here is that we don't know if we're using either only types or
>functions from the other module.
>

One solution to that is to build interfaces containing types
with no corresponding implementation file. Then if you use
a name X for which there is an X.mli but no X.ml,
you're only using types.

This seems like a good policy in general, it is more robust,
since there is no need to keep a duplicated ml and mli file.

Ocaml's ability to process a .mli file with no corresponding
.ml file doesn't appear to be documented... it works for
the native code compiler, don't know about the bytecode
compiler.

If a type is only used locally, the requirement can be relaxed:
in such cases, by specification, some functions must be used
too, so the type can be included in the .ml and mli files.

BTW: the big pain here is functors: using ocamlc -i
to generate an expanded interface for a fuctor application
is really horrible and rarely works properly (you have to edit
the output to replace expanded definitions with aliases
to have any hope of reading it).

Is there a better way?

-- 
John Max Skaller, mailto:skaller@ozemail.com.au
snail:10/1 Toxteth Rd, Glebe, NSW 2037, Australia.
voice:61-2-9660-0850




-------------------
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-04-18 20:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-18 14:01 Warp
2002-04-18 14:24 ` Christian Lindig
2002-04-18 14:31   ` Michal Moskal
2002-04-18 14:40     ` Christian Lindig
2002-04-18 14:45       ` Michal Moskal
     [not found] ` <15550.55633.886446.494339@paille.inria.fr>
2002-04-18 14:41   ` Warp
2002-04-18 20:55     ` John Max Skaller [this message]

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=3CBF32CC.3030806@ozemail.com.au \
    --to=skaller@ozemail.com.au \
    --cc=Tom.Hirschowitz@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=warplayer@free.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).