Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you disable all print statements in SML

Tags:

sml

smlnj

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.

like image 724
rasen58 Avatar asked Mar 12 '23 14:03

rasen58


1 Answers

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.

like image 50
John Coleman Avatar answered Apr 02 '23 01:04

John Coleman