This
- fun dist (x:real, y:real):real*real = (Math.sqrt (x*x+y*y), Math.abs(x-y));
produces an error
Error: unbound variable or constructor: abs in path Math.abs
So even with a self-made version of abs I get
- fun abs (n : real) = if n <0.0 then ~n else n;
val abs = fn : real -> real
- fun dist (x:real, y:real) = (Math.sqrt (x*x + y*y), abs (x-y));
val dist = fn : real * real -> real * real
- dist (2.0, 3.0);
Error: Compiler bug: PPObj: ppFields in ppval.sml
I was following along in Programming in Standard ML, page 49. Not sure how to proceed.