[wg-camlp4] Structure/signature attributes suggestion

Leo White lpw25 at cam.ac.uk
Sat Oct 12 18:41:56 BST 2013


> I think the major benefits of extension-points for documentation, compared to ocamldoc comments, is that they are
> unambiguously attached to an AST node. We get in trouble for section headers because they don't fit that framework very
> well; they're not semantically attached to a precise node, and even if you would consider them as attached to a set of
> nods (the ones in the section), this set apparently has no reason to respect the AST structure. So we get an impedance
> mismatch here.

To be clear, I don't think writing documentation directly as
extension-points is a good idea. However, I do think that it is a good
idea to store the documentation (taken from ocamldoc comments) as
extension-points within the AST.

As a side note, this part of the AST would also need to be rewritten if
we wanted to support mutually recursive definitions of different
sorts. For example:

    type t = #foo list
    and class type foo = object method x : t end

which I know has been previously requested.


More information about the wg-camlp4 mailing list