(* Clausal Function Definitions *) val dist : real * real -> real = fn (x:real, y:real) => sqrt (x*x + y*y) fun dist (x:real, y:real):real = sqrt (x*x + y*y) fun dist' {x=x:real, y=y:real} = sqrt (x*x + y*y) fun dist2 (x:real, y:real):real*real = (sqrt (x*x+y*y), abs(x-y)) fun dist (p:real*real):real = sqrt((#1 p)*(#1 p)+(#2 p)*(#2 p)) val 0 = 1-1 val (0,x) = (1-1, 34) val (0, #"0") = (2-1, #"0") val recip : int -> int = fn 0 => 0 | n:int => 1 div n fun recip 0 = 0 | recip (n:int) = 1 div n fun not true = false | not false = true fun is_alpha c:char = (#"a" <= c andalso c <= #"z") orelse (#"A" <= c andalso c <= #"Z") fun recip (n:int) = 1 div n | recip 0 = 0 fun is_numeric #"0" = true | is_numeric #"1" = true | is_numeric #"2" = true | is_numeric #"3" = true | is_numeric #"4" = true | is_numeric #"5" = true | is_numeric #"6" = true | is_numeric #"7" = true | is_numeric #"8" = true | is_numeric #"9" = true