[wg-camlp4] My uses of syntax extension

Wojciech Meyer wojciech.meyer at gmail.com
Tue Jan 29 14:17:40 GMT 2013


On Tue, Jan 29, 2013 at 2:00 PM, Jeremy Yallop <yallop at gmail.com> wrote:
> Here the aim is quite different: we don't want to prevent immediate
> evaluation; instead, we want to transform the syntax *for* immediate
> evaluation.  We don't want g to be bound to some user-manipulable
> representation of the code.  Instead, we want the *implementation* to
> consume the desugared notation, type check it and bind the result of
> evaluating it to g.  The distinction between user-consumable and
> implementation-consumable code is obscured if we use quotations for
> both in the source language.  Both quotations and syntax extensions
> are useful, but let's use different notations for them.  For example,
> using Alain's proposal, we might write the following for the arrow
> notation fragment:
>
>       let g = (@proc) x => (y <= f =< x + 1;
>                             return =< y + 2)
>

I tend to head our general perception, that we should have different
syntax for introducing lightweight extensions to the language (list
comprehensions, monads, arrows etc.) but as well full blown quotes
that have separate parser or even lexer. As implicitly mentioned by
Jeremy, the line that distinguish these two should be:
- if we treat the code inside the delimiters as first class value or not?
- if the quasi-quotes are needed?

These two give an indication which machinery too choose, but it might
be not clear in the begining for the users however?

-Wojciech


More information about the wg-camlp4 mailing list