I am generating OCaml code in OCaml. This code includes several Dune files which may be updated and have specific parts change. I am reaching the limit of what I can do with some clever printf
, and would like to know if there is an easy way to use Dune as a library to programatically create Dune files?
Asked
Active
Viewed 59 times
1

user3078439
- 305
- 1
- 10
-
Is something like: https://jbuilder.readthedocs.io/en/latest/advanced-topics.html#ocaml-syntax able to solve your problem? – Lhooq Apr 01 '22 at 13:57
-
what do you mean by "clever printf" ? – Butanium Apr 01 '22 at 14:19
-
Maybe "clever" was too much, I just meant: writing the dune file using printf. The problem is sometimes I would need to add a library to an existing dune file, so I need to be able to parse it as well as print it. – user3078439 Apr 25 '22 at 12:13