caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Porting old-style ppx to driver-style?
@ 2018-05-04 22:20 Paul A. Steckler
  2018-05-10  7:00 ` Rudi Grinberg
  0 siblings, 1 reply; 3+ messages in thread
From: Paul A. Steckler @ 2018-05-04 22:20 UTC (permalink / raw)
  To: Ocaml Mailing List

There's a nice OCaml library, available via OPAM as "lens", which
allows deriving lenses for record types.

By adding the following clause in a jbuild file, the ppx works fine:

  (preprocess (action (run ppxfind -legacy
lens.ppx_deriving,ppx_deriving.std --as-pp ${<})))

But adding "ppx_inline_test" to this clause doesn't allow an
"(inline_tests)" clause to work, and when building a library, only one
"preprocess" clause appears to have an effect.

Using the ppx within a "(preprocess (pps ...))" clause does not
succeed. So I can have lenses, or inline tests, but not both.

I believe the solution is to turn the ppx into a new-style "driver".
What's the best way to do that? Is it as simple as changing the build
to use a jbuild as described in the section "Creating a new Ppx_driver
based rewriter"?:

  https://github.com/janestreet/ppx_driver

Do I need to make any other code changes?

-- Paul

-- 
Caml-list mailing list.  Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-11  1:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-04 22:20 [Caml-list] Porting old-style ppx to driver-style? Paul A. Steckler
2018-05-10  7:00 ` Rudi Grinberg
2018-05-11  1:18   ` Paul A. Steckler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).