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

Xavier Clerc xavier.clerc at inria.fr
Wed Mar 6 15:17:46 GMT 2013


----- Mail original -----
> I've started a document to describe the current state of the branch:
> 
> http://caml.inria.fr/cgi-bin/viewvc.cgi/ocaml/branches/extension_points/experimental/frisch/extension_points.txt?view=markup
> 
> A copy of the current version is attached.
> 
> Recent additions:
> 
> 
>   - Attributes on labels in record declarations.
>   - Attributes as standalone signature/structure items.
>   - An alternative syntax for attributes on some kinds of expressions
>     starting with a keyword, e.g.  "let[@id] p = e in e" is parsed
>     as "(let p = e in e)[@id]" and as "[^id](let p = e in e)".
>     Do people think this is useful?
> 
>     (I'm considering recognizing also "let[%id] p = e in e"
>     as "(%id (let p = e in e))" and "let[%id e0] p = e in e"
>     e.g. as "(%id (%id e0) (let p = e in e))".  Opinion?)
> 
> 
> Don't hesitate to comment on the choice of syntaxes and
> representation
> in the Parsetree, etc!

I will not discuss the syntax per se, but I wonder whether
having both prefix and suffix attributes is not error-prone.
Could you elaborate on the need of having both?

Another, unrelated question: as an extension developer, it
seems that I will have to deal with full-fledged expressions
as attributes values. Do you plan some mechanism to allow
easy access to an identifier used in such an expression.
I mean, it can even refer to another module. This also implies
that you could create dependencies between modules solely
through attributes; is that correct?


Sorry if those questions have already been answered, I did
not follow the previous thread about extension points.


Xavier Clerc


More information about the wg-camlp4 mailing list