I'm using my own package, partly based on Ted Ersek's RootSearch package, partly based on some posts on this portal. It has a lot of debug prints coded like this:
If[debug>n, Print[...]];
where n
is an integer number (0, 1, 2, ...), controlling how many prints should be activated, and debug
is a value passed to the package as the value of XRootDebug
option. By default, debug
is zero, so the debugging information is suppressed. However I am afraid that lot of If
's slow down computation even if they evaluated to False
.
Is there a way to automatically remove all such If
s?
In the early days of the Internet, I knew how to write scripts for such tasks in Windows, but I forgot everything. I mean the script can be run either from Mathematica using its own tools or from Windows using e.g. JavaScript.