caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Nicolas Cannasse" <warplayer@free.fr>
To: "Yang Shouxun" <yangsx@fltrp.com>, <caml-list@inria.fr>
Subject: Re: [Caml-list] automatic extraction of mli file?
Date: Sat, 12 Oct 2002 13:33:30 +0200	[thread overview]
Message-ID: <005701c271e3$30eb3130$55203151@warp> (raw)
In-Reply-To: <3DA8021B.3050102@fltrp.com>

> What I'm wondering is "wouldn't it be preferrable to automatically
> produce the interface file from the implementation file?", so that we
> can program in the literate programming style, do prototyping, and save
> the drudgery of writing the interface (though a little manual editing
> may be necessary, or some kind of markup in the source code).
>
> Maybe such utility already exists. Only I'm not aware of. If so, I'd
> like to know how to get it.

The "-i" ocamlc compiler flag is what you need.
It prints all the types found in the ML file.
But since there is no rule for interface exclusion, you have to maintain
separatly both ML & MLI files.

For example, if you start working on a new module, you can start writing it
without any interface ( then all members are "public" ) and after some
testing you write the interface and that way ensure that your implemenation
match exactly what's in your mind ( not always obvious :)

Nicolas Cannasse

-------------------
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-12 11:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-12 11:06 Yang Shouxun
2002-10-12 11:33 ` Nicolas Cannasse [this message]
2002-10-12 11:50   ` Yang Shouxun
2002-10-12 12:52     ` Sven LUTHER
2002-10-16 13:03     ` Claude Marche
2002-10-12 11:55 ` Remi VANICAT
2002-10-13 10:20 ` Xavier Leroy

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='005701c271e3$30eb3130$55203151@warp' \
    --to=warplayer@free.fr \
    --cc=caml-list@inria.fr \
    --cc=yangsx@fltrp.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;
as well as URLs for NNTP newsgroup(s).