[wg-camlp4] Request for feedback

Alain Frisch alain.frisch at lexifi.com
Fri Mar 22 11:36:42 GMT 2013

On 03/21/2013 02:22 PM, Gabriel Scherer wrote:
> The translation of
>     KW%id[@id expr]..[@id expr] REST
> into
>    [%id KW REST] [@id expr]..[@id expr]
> is surprising to me. I would instead have expected it to translate into
>    [%id (KW REST)[@id expr]..[@id expr] ]
> (the extensions would have precedence over attributes, so that
> localized extension handlers only rewriting what is inside the [%id
> EXPR] can see the attributes and react to them)

I don't think it will make a big difference in practice if the 
attributes are stored in the pexp_attributes of the record whose 
pexp_desc is Pexp_extension(_, e) instead of e.pexp_attributes.

But I've changed the code to match the behavior you describe.

> Among the options you highlight, my own current preference goes for (3).

Since Leo and me are also ok with that, and nobody else commented, let's 
go with (3) for now.  I've removed support for the alternative syntax 
for expression constructions not starting with a keyword or a combinator 
of keywords (let module, let open).  I've considered "(module ...)" as 
not starting with a keyword.

-- Alain

More information about the wg-camlp4 mailing list