Closed NathanReb closed 2 years ago
Looking at the metaquot readme, it seems out of the 5 antiquotation expressions only [%e and [%p are used in ppx_yojson.
Searching for those + Ast_builder, you find some uses where there is a type before the antiquotation, like `String in:
[%expr `String [%e Ast_builder.Default.estring ~loc s]]
Does that matter? Since it's still explicitly building an ast, should those also be simplified? What is the purpose of specifying `String in such a case?
I'm an Outreachy applicant for this Oct 2021 contribution period. I started working on this issue and a first try pr is found here. I hope this is a good first step towards a contribution!
Sorry for the delay! I tried answering your question on the PR directly.
Hi @NathanReb This issue can be closed probably!
ppx_yojson makes quite an heavy use of metaquot as it simplifies the code quite a lot.
That's possible thanks to metaquot "anti-quotation" which allows injecting ast fragments into a metaquot payload.
When browsing through the source recently I stumbled to a few occurences of useless metaquot extensions where the payload simply was an antiquoted expression building the appropriate ast fragment, i.e. something of the form:
which can be simplified to
It would be nice to get rid of those.