[wg-camlp4] On domain-specific foreign syntaxes

Leo White lpw25 at cam.ac.uk
Thu Jan 31 16:27:28 GMT 2013


>  - Against the idea that the syntactic aspect of quotations has 
>anything to do with the notion of extension node to be expanded to AST 
>fragments by some code.  They are just independent notions:

Just because quotations do not need to be part of an extension and 
extensions do not need to use quotations does not change the fact that they 
are frequently used together, so a convenient syntax would be appreciated.

I really don't understand your objection to including all of the following:

* A quotation syntax: {x{ string }x}
* A template syntax: {:lid expr}
* A convenient quotation template syntax: {:lid x| |x}

The quotation template is more lightweight than combining the other two, 
and adds flexibility/clarity for quotations that contain many "}"s. Its 
simply a case of providing a simple syntax for a common use case. Just 
because you don't like that use case doesn't make it not common.

>    begin(:sedlex) match lexbuf with
>    | ... -> e1
>    end

I think that this was better as a template:

{:sedlex 
  match lexbuf with
    | ... -> e1
}


More information about the wg-camlp4 mailing list