You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems strange to me that to call synterp part of creating notations (Metasyntax.add_notation_syntax), I need to pass notation body as the part of notation_declaration structure (ntn_decl_interp field — it even has interp in its name :) ). Inspecting the code, I came to conclusion that the only place where the body is actually used is changing the term in case of infix notations. I suppose that infix flag can be remembered for interp code, and interp code can change the term however it likes.
Additional context
The context here is that I want to add to coq-elpi (cc @gares) builtins for creating notations (it currently has API for abbreviations, but we need full-blown notations with custom scopes, levels, etc). For our elpi fork, we just use placeholder Constrexpr.CHole (None) in synterp code and then call add_notation_syntax again in interp code, this time with the actual body. It works (as we don't use infix notations), but I want a prettier solution before submitting PR to public elpi.
The text was updated successfully, but these errors were encountered:
trilis
changed the title
Synterp code of
Synterp code of creating notations unnecessarily uses its body
Apr 17, 2024
trilis
changed the title
Synterp code of creating notations unnecessarily uses its body
Synterp code of creating notations unnecessarily uses notation's body
Apr 17, 2024
Sure, I can try in the next couple of days. I will need some help with adapting external plugins and libs to this change though, as I have no idea how adapting process works in the coq community
Refactoring request
It seems strange to me that to call synterp part of creating notations (
Metasyntax.add_notation_syntax
), I need to pass notation body as the part ofnotation_declaration
structure (ntn_decl_interp
field — it even hasinterp
in its name :) ). Inspecting the code, I came to conclusion that the only place where the body is actually used is changing the term in case of infix notations. I suppose that infix flag can be remembered for interp code, and interp code can change the term however it likes.Additional context
The context here is that I want to add to coq-elpi (cc @gares) builtins for creating notations (it currently has API for abbreviations, but we need full-blown notations with custom scopes, levels, etc). For our elpi fork, we just use placeholder
Constrexpr.CHole (None)
in synterp code and then calladd_notation_syntax
again in interp code, this time with the actual body. It works (as we don't use infix notations), but I want a prettier solution before submitting PR to public elpi.The text was updated successfully, but these errors were encountered: