[wg-camlp4] A new branch to experiment with extension points

Leo White lpw25 at cam.ac.uk
Mon Mar 4 15:55:46 GMT 2013

>I've removed the notion of extension as structure item at the same time 
>I removed the notion of attribute on structure item.  I believe 
>extensions as structure items will not be frequently useful, and they 
>required a specific syntax (or created opportunities of conflicts with 
>other categories).  It is always possible to write, for instance:
>   include (:foo bar)
>where (:foo bar) is as a (module expression) extension.

I don't think these are really a problem, since they should simply bind to 
the include statement. For ambiguous cases, inserting a ";;" should be 
sufficient to indicate that a following extension is a structure item.

The more difficult problem is the fact that ordinary expressions are often 
allowed as structure items. I had thought that my previous patch managed to 
sufficiently avoid this problem, but I now think that there will always be 
awkward conflicts between an expression extension and a structure item 
extension (especially in the toplevel).

So, in conclusion, I now agree that we should provide a separate syntax for 
structure item extensions.

More information about the wg-camlp4 mailing list