oso[0][cs171] > sml Standard ML of New Jersey, Version 109.27, April 20, 1997 - - val str1 = "hello"; val str1 = "hello" : string - - str1; val it = "hello" : string - - fun phrase (str1:string) = = str1^" there"; val phrase = fn : string -> string - - phrase ("whose"); val it = "whose there" : string - - phrase (str1); val it = "hello there" : string - - fun phrase2(str1:string) = = str1 ^ " and same to you"; val phrase2 = fn : string -> string - - phrase2 ("goobye"); val it = "goobye and same to you" : string - - phrase2(phrase(str1)); val it = "hello there and same to you" : string - - str1; val it = "hello" : string - ========================= Standard ML of New Jersey, Version 109.27, April 20, 1997 - - val y = 4; val y = 4 : int - - fun f1 (x:int) = x+y; val f1 = fn : int -> int - - f1 (2); val it = 6 : int - - f1 (y); val it = 8 : int - - f1 (x); stdIn:16.5 Error: unbound variable or constructor: x - - val y = 6; val y = 6 : int - GC #0.0.0.0.1.9: (10 ms) - f1 (2); val it = 6 : int - - f1 (y); val it = 10 : int - - fun f2 (x:int) = f1(x)+3; val f2 = fn : int -> int - - f2 (2); val it = 9 : int - - f2 (y); val it = 13 : int - - fun f3 (x:int) = f2(x)+y; val f3 = fn : int -> int - - f3(2); val it = 15 : int - - f3(y); val it = 19 : int - - val y=8; val y = 8 : int - - f3(y); val it = 21 : int - - fun f1 (y:int) = f3(y)+2; val f1 = fn : int -> int - - f1(2); val it = 17 : int - - f1(y); val it = 23 : int - - val y=10; val y = 10 : int - - f1(y); val it = 25 : int - - f1(x); stdIn:49.4 Error: unbound variable or constructor: x - - - x; stdIn:50.1 Error: unbound variable or constructor: x -