[wg-camlp4] Against the use of syntactically-valid OCaml code for syntax extension purposes

Leo White lpw25 at cam.ac.uk
Wed Jan 30 09:40:08 GMT 2013


>This was not my understanding.  You seem to imply that {: ... } here is 
>not really a (postfix) attribute on the expression "foo bar", but that 
>it is a stand-alone expression.  

Yes, that is the idea. It is also why they must be non-ignorable.

> So actually, it is not attached on 
>anything, it is not an attribute. 

Indeed, but for lack of a better word I'll stick with attribute.

> I'd rather write it:
>
>   foo bar ((@marker) e)

I would prefer it to have its own syntax, because I would like to encourage 
its use. I think that it is easier to read than a normal attribute because 
it clearly declares its scope, and since it cannot be ignored it is also 
safer. I would also like this syntax to be similar to <: ... > since they 
have similar uses.



More information about the wg-camlp4 mailing list