I have the following:
val it = DATAX ("hello",DATAX ("world",DATAX #,DATAX #),...
Is there a way to make the SMLNJ interpreter expand "#" so that I can see what the exact data is? Thanks!
Ok. I found an answer:
http://www.cs.cmu.edu/~me/212/environment.html
When SML/NJ prints a data structure, it prints that data structure only to a certain depth. Beneath that depth it prints a # instead. This is generally a good thing, since data structures can be very large (and even cyclic). However, the default depth to which SML/NJ prints data structures is 5, which is usually not enough. You can adjust the depth to which it prints data structures by entering, for example,
Control.Print.printDepth := 10;
to set the depth to 10. SML/NJ also abbreviates lists and strings over a certain length. You can set the length at which this happens by setting Control.Print.printLength and Control.Print.stringDepth, in a manner analogous to the above.
来源:https://stackoverflow.com/questions/3756460/smlnj-expand-in-output