Reputation: 5081
I currently have a lot of print statements in SML code, and I'm traversing a very large tree, so it takes a while for all the print statements to be printed, but right now I don't want to see any print statements and just want to see it run as fast as possible. But I don't want to comment all the prints because I later need them again to debug something else. So I just want to be able to temporarily disable them for this run of the code.
I'm using the SML/NJ compiler.
Upvotes: 4
Views: 110
Reputation: 51998
As the first line in your code put the definition
fun print x = ();
Then -- your code will still work but the prints will do nothing.
Delete that line when you want to re-enable print
.
Upvotes: 7