caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Alain Frisch <alain@frisch.fr>
To: Francois Berenger <berenger@riken.jp>
Cc: caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] automatic extaction of the .mli (and a little more) from the .ml
Date: Tue, 04 Jun 2013 10:36:48 +0200	[thread overview]
Message-ID: <51ADA720.7070409@frisch.fr> (raw)
In-Reply-To: <51AD351E.9030005@riken.jp>

On 06/04/2013 02:30 AM, Francois Berenger wrote:
> - being able to assign priorities to things exported in the
>    .mli file (to re-order the .mli in some way that makes it easier to
>    grasp). I think floats should be used and the priority assigned
>    should be shown in the .mli so that users can quickly see what
>    priority they need to change in the .ml to obtain the order
>    they want in the .mli

Yes, it's quite easy to add some priority information as an extra 
argument to the [@mli] attribute.  (That said, since extension_points is 
not yet merged in the official version, I don't think it's worth 
spending time on the prototype right now.)

Showing the priority in the .mli (in the form of attributes) is 
straightforward (currently, the source syntax pretty-printer 
pprintast.ml does not support printing attributes, but this will be fixed).

> - can you also handle the transfer of ocamldoc comments in the .ml
>    to the .mli

In this form, this is very tricky, because the tool is based on the 
result of the OCaml parser which does not store the ocamldoc comments. 
The tool would need to steal from ocamldoc the (complex) logic required 
to re-parse the source code, extract the attributes, attach them to 
components of the parsetree/typedtree.

What is doable is to have the tool accept more attributes (or more 
arguments to the [@mli] attribute) representing text to be used as 
ocamldoc comments in the generated .mli.  Instead of producing an AST 
for the generated signatures (which is then pretty-printed), the tool 
would directly emit the content of the .mli (with ocamldoc attributes).


> (I read later that you also have a final solution
>    for ocamldoc too)?

Certainly not!  I'm only suggesting that a tool similar to ocamldoc 
could be based on attributes, and that it would be more robust and much 
easier to implement.  But designing and implementing this tool is still 
a serious engineering task, and unless someone puts the required 
manpower in this project, this is not going to happen.


Alain

      reply	other threads:[~2013-06-04  8:36 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 ` [Caml-list] " Alain Frisch
2013-06-04  0:30   ` Francois Berenger
2013-06-04  8:36     ` Alain Frisch [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=51ADA720.7070409@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;
as well as URLs for NNTP newsgroup(s).