From: Alain Frisch <alain@frisch.fr>
To: Francois Berenger <berenger@riken.jp>, caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] automatic extaction of the .mli (and a little more) from the .ml
Date: Mon, 03 Jun 2013 19:12:10 +0200 [thread overview]
Message-ID: <51ACCE6A.7050704@frisch.fr> (raw)
In-Reply-To: <51A81C67.50902@riken.jp>
I've created a proof-of-concept implementation of such a tool as part of
the "extension_points" branch, which introduces a syntax for attributes
on various syntactic items (including type declarations and value bindings).
Note that I *don't* endorse the idea of generating .mli files
automatically :-)
Here is the code:
http://caml.inria.fr/cgi-bin/viewvc.cgi/ocaml/branches/extension_points/experimental/frisch/nomli.ml?revision=HEAD&view=markup
and an example:
http://caml.inria.fr/cgi-bin/viewvc.cgi/ocaml/branches/extension_points/experimental/frisch/test_nomli.ml?revision=HEAD&view=markup
On 05/31/2013 05:43 AM, Francois Berenger wrote:
> - I think there should be tags in the .ml file as comments
> that say "export this" to the .mli.
Encoding annotations in comments is very fragile, because they are not
kept by the parser in the generated Parsetree, and it is not
well-defined to which component each component refers to. ocamldoc uses
comments, and as a consequence, it does not combine well with
preprocessors (Camlp4/Camlp5/Fan/ppx extensions cannot generate
documentation fragments, and it is likely that they break existing
ones). A version of ocamldoc based on attributes of the
extension_points branch would be much more robust (and simple). I've
written another toy POC implementation of a mini-ocamldoc based on
attributes:
http://caml.inria.fr/cgi-bin/viewvc.cgi/ocaml/branches/extension_points/experimental/frisch/minidoc.ml?revision=HEAD&view=markup
http://caml.inria.fr/cgi-bin/viewvc.cgi/ocaml/branches/extension_points/experimental/frisch/testdoc.mli?revision=HEAD&view=markup
(experimental/frisch/Makefile in the extenstion_point branch contains
everything to compile and run these little demos.)
-- Alain
next prev parent reply other threads:[~2013-06-03 17:12 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-31 3:43 Francois Berenger
2013-05-31 5:31 ` Malcolm Matalka
2013-05-31 6:26 ` Francois Berenger
2013-05-31 9:10 ` Romain Bardou
2013-06-03 1:33 ` Francois Berenger
2013-06-04 7:53 ` David Allsopp
2013-06-04 8:22 ` Alain Frisch
2013-06-04 8:54 ` David Allsopp
2013-06-04 8:22 ` Romain Bardou
2013-06-04 9:05 ` David Allsopp
2013-05-31 23:13 ` oliver
2013-06-03 1:28 ` Francois Berenger
2013-06-03 12:01 ` Malcolm Matalka
2013-05-31 15:21 ` [Caml-list] " Hongbo Zhang
2013-05-31 15:42 ` Yaron Minsky
2013-05-31 23:20 ` Jacques Le Normand
2013-06-01 9:12 ` Florent Monnier
2013-06-03 17:12 ` Alain Frisch [this message]
2013-06-04 0:30 ` [Caml-list] " Francois Berenger
2013-06-04 8:36 ` Alain Frisch
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=51ACCE6A.7050704@frisch.fr \
--to=alain@frisch.fr \
--cc=berenger@riken.jp \
--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