4

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.

rasen58
  • 4,672
  • 8
  • 39
  • 74

1 Answers1

7

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.

John Coleman
  • 51,337
  • 7
  • 54
  • 119