I would be willing to submit PRs for this, but want to discuss first.
Since 4.04 has Ppat_open, and 4.03 and 4.02 do not, would it be reasonable to add two functions to Ast_convenience:
Some kind of higher-order pattern deconstructor, that hides the pattern matching on Parsetree.pattern_desc inside it. The implemention for < 4.04 would simply never call the closure corresponding to Ppat_open.
A wrapper around Ast_helper.Pat.open_. The implementation for < 4.04 would fail at run time. Perhaps we could mark that version with @@ocaml.deprecated to warn about using it.
This kind of thing would help with https://github.com/aantron/bisect_ppx/pull/113, which concerns, in part, pattern matching on patter_desc in 4.04 while preserving compatibility with 4.03 and 4.02.
I would be willing to submit PRs for this, but want to discuss first.
Since 4.04 has
Ppat_open
, and 4.03 and 4.02 do not, would it be reasonable to add two functions toAst_convenience
:Parsetree.pattern_desc
inside it. The implemention for < 4.04 would simply never call the closure corresponding toPpat_open
.Ast_helper.Pat.open_
. The implementation for < 4.04 would fail at run time. Perhaps we could mark that version with@@ocaml.deprecated
to warn about using it.This kind of thing would help with https://github.com/aantron/bisect_ppx/pull/113, which concerns, in part, pattern matching on
patter_desc
in 4.04 while preserving compatibility with 4.03 and 4.02.cc @rleonid