I am developing a program in Ocaml for my Programming class.This idea is to provide the students with various versions of the program, using more and more complex techniques.
I would like to design a common master, and then derive the various versions automatically using some conditional compilation facility.
I considered camlp4 IFDEF but it applies to complete expressions, only. Instead, I would like to add or remove cases in long lists of if ... then ... else if ....
Also, I am using ocamlbuild and I cannot find how to define IFDEF compilation tags in the compilation chain.
If you do conditional compilation via ppx, as ppx_optcomp does, then ocamlformat has a chance. With other approaches where the source file does not parse using the standard compiler, ocamlformat will not work.