[wg-camlp4] [Caml-list] Working Group: the future of syntax extensions in OCaml, after camlp4
Hongbo Zhang
bobzhang1988 at gmail.com
Thu Feb 7 20:17:13 GMT 2013
On 1/29/13 2:44 AM, Alain Frisch wrote:
>
> Let me throw a crazy idea: maybe we could merge the grammar for
> patterns and expressions, and let the type checker reject bad patterns
> and bad expressions from this more admissible class. This would give
> plenty of space for extensions.
>
This is not a crazy idea, it's a beautiful idea, In Fan, we make expr
and patt symmetric, and defined a new type
expr_patt which is a subtype of both expr and patt(thanks to polymorphic
variants), it seems that the Ast lifting only need expr_patt, so the
part [meta_expr] and [meta_patt] can be shared, which gives much more
precise type information than the normal sum types, it's so beautiful, XD
>
>
>>>
>>
>>
>
> _______________________________________________
> wg-camlp4 mailing list
> wg-camlp4 at lists.ocaml.org
> http://lists.ocaml.org/listinfo/wg-camlp4
More information about the wg-camlp4
mailing list