Question

 datatype expr = constant of int 
               |pow of expr * int
               | variable of string
               | product of expr *expr ;
 val x = variable("x");
 fun integ(x,pow(y,a))= if (x=y) then pow(x,a+1) else product(x,pow(y,a));
 integ(x,variable("y"),2);

Gives me output product (variable "x",pow (variable #,2)); I want y instead of # there ?

Was it helpful?

Solution

These variables control SML/NJ printing. Set them higher if you want to see more.

Control.Print.printLength := 1000
Control.Print.printDepth := 1000
Control.Print.stringDepth := 1000
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top