Standard ML of New Jersey v110.81 [built: Mon Oct 2 10:01:15 2017] - 2+2; val it = 4 : int - it; val it = 4 : int - val x = 2 + 3 - 10 ; val x = ~5 : int - (1, "banana") = ; val it = (1,"banana") : int * string - (1, "banana", false, 2) ; val it = (1,"banana",false,2) : int * string * bool * int - val p = (1, "banana", false, 2) ; val p = (1,"banana",false,2) : int * string * bool * int - p ; val it = (1,"banana",false,2) : int * string * bool * int - #1 p; val it = 1 : int - #2 p; val it = "banana" : string - (1, false); val it = (1,false) : int * bool - (1,23,4,5,6,false,"foo","bar",(1,2,3),true) ; val it = (1,23,4,5,6,false,"foo","bar",(1,2,3),true) : int * int * int * int * int * bool * string * string * (int * int * int) * bool - (2018, 3, 21, 9, 43, 17, 512) ; val it = (2018,3,21,9,43,17,512) : int * int * int * int * int * int * int - #5 (2018, 3, 21, 9, 43, 17, 512) ; val it = 43 : int - #5 (2018, 3, 21, 9, 43, 17, 512) ; val it = 43 : int - ("Neža", "Cankar") ; val it = ("Ne\197\190a","Cankar") : string * string - val mati = { ime = "Neža", priimek = "Cankar"} ; val mati = {ime="Ne\197\190a",priimek="Cankar"} : {ime:string, priimek:string} - val itam = { priimek = "Cankar", ime = "Neža" } ; val itam = {ime="Ne\197\190a",priimek="Cankar"} : {ime:string, priimek:string} - mati = itam ; val it = true : bool - #ime mati ; val it = "Ne\197\190a" : string - #priimek mati ; val it = "Cankar" : string - {1=42, 2="banana", 3=false} ; val it = (42,"banana",false) : int * string * bool - {1=42, 3=false} ; val it = {1=42,3=false} : {1:int, 3:bool} - {0="foo", 1=42, 2="bar", 3=false} ; stdIn:24.1-24.4 Error: syntax error: deleting LBRACE INT0 EQUALOP stdIn:24.9-24.12 Error: syntax error: deleting COMMA INT stdIn:24.15-24.18 Error: syntax error: deleting COMMA INT stdIn:24.24-24.27 Error: syntax error: deleting COMMA INT - {0="foo", 1=42, 2="bar", 3=false} ; stdIn:1.2-1.5 Error: syntax error: deleting LBRACE INT0 EQUALOP stdIn:2.4-3.3 Error: syntax error: deleting COMMA INT stdIn:3.6-3.9 Error: syntax error: deleting COMMA INT stdIn:3.15-3.18 Error: syntax error: deleting COMMA INT - {1="foo", 1=42, 2="bar", 3=false} ; stdIn:1.2-4.4 Error: duplicate label in record: 1 - {4="foo", 1=42, 2="bar", 3=false} ; val it = (42,"bar",false,"foo") : int * string * bool * string - (1,2) ; val it = (1,2) : int * int - (1,2,3) ; val it = (1,2,3) : int * int * int - ("foo") ; val it = "foo" : string - {1="foo"} ; val it = {1="foo"} : {1:string} - () ; val it = () : unit - 1.2 ; val it = 1.2 : real - 1.0 / 3.0 ; val it = 0.333333333333 : real - (1.0 / 3.0) * 3.0 ; val it = 1.0 : real - (1.0 / 17.0) * 17.0 ; val it = 1.0 : real - case z of Cevelj (b, v) => if v < 35 then 15 else 25 | Posoda y => 7 ; = = stdIn:34.7 Error: unbound variable or constructor: z stdIn:36.6-36.14 Error: non-constructor applied to argument in pattern: Posoda stdIn:35.6-35.19 Error: non-constructor applied to argument in pattern: Cevelj stdIn:35.26 Error: unbound variable or constructor: v - val z = Palica 7 ; stdIn:2.4-3.6 Error: unbound variable or constructor: Palica - val z = Palica 7 ; stdIn:2.4-3.6 Error: unbound variable or constructor: Palica - datatype izdelek = Cevelj of {blue:real, green:real, red:real} * int | Palica of int | Posoda of int ; = = = = datatype izdelek = Cevelj of {blue:real, green:real, red:real} * int | Palica of int | Posoda of int - val z = Palica 7 ; val z = Palica 7 : izdelek - case z of Cevelj (b, v) => if v < 35 then 15 else 25 | Posoda y => 7 ; = = stdIn:42.2-44.19 Warning: match nonexhaustive Cevelj (b,v) => ... Posoda y => ... uncaught exception Match [nonexhaustive match failure] raised at: stdIn:44.19 - datatype bool = false | true ; datatype bool = false | true - if false then 7 else 5 ; stdIn:45.1-45.23 Error: test expression in if is not of type bool [tycon mismatch] test expression: bool in expression: if false then 7 else 5 - val (Posoda p) = Posoda 10 ; val p = 10 : int - val Cevelj (barva, velikost) = Cevelj ({r=1;g=0.5;b=0.0}, 43) ; stdIn:46.44-46.46 Error: syntax error: deleting SEMICOLON IDA stdIn:46.50 Error: syntax error found at SEMICOLON - val Cevelj (barva, velikost) = Cevelj ({r=1,g=0.5,b=0.0}, 43) ; stdIn:1.6-46.33 Error: operator and operand don't agree [tycon mismatch] operator domain: {blue:real, green:real, red:real} * int operand: {b:real, g:real, r:[int ty]} * [int ty] in expression: Cevelj ({r=1,g=0.5,b=0.0},43) - val Cevelj (barva, velikost) = Cevelj ({r=1.0,g=0.5,b=0.0}, 43) ; stdIn:1.6-46.35 Error: operator and operand don't agree [tycon mismatch] operator domain: {blue:real, green:real, red:real} * int operand: {b:real, g:real, r:real} * [int ty] in expression: Cevelj ({r=1.0,g=0.5,b=0.0},43) - Cevelj ({r=1.0,g=0.5,b=0.0}, 43) ; stdIn:1.2-46.4 Error: operator and operand don't agree [tycon mismatch] operator domain: {blue:real, green:real, red:real} * int operand: {b:real, g:real, r:real} * [int ty] in expression: Cevelj ({r=1.0,g=0.5,b=0.0},43) - Cevelj {r=1.0,g=0.5,b=0.0} 43 ; stdIn:1.2-46.1 Error: operator and operand don't agree [tycon mismatch] operator domain: {blue:real, green:real, red:real} * int operand: {b:real, g:real, r:real} in expression: Cevelj {r=1.0,g=0.5,b=0.0} - Cevelj ({red=1.0,green=0.5,blue=0.0}, 43) ; val it = Cevelj ({blue=0.0,green=0.5,red=1.0},43) : izdelek - val Cevelj (x, y) = Cevelj ({red=1.0,green=0.5,blue=0.0}, 43) ; val x = {blue=0.0,green=0.5,red=1.0} : {blue:real, green:real, red:real} val y = 43 : int - val Cevelj ({red=r;green=g;blue=b},v) = Cevelj ({red=1.0,green=0.5,blue=0.0}, 43) ; stdIn:48.19-48.26 Error: syntax error: deleting SEMICOLON IDA EQUALOP stdIn:48.27 Error: syntax error found at SEMICOLON - val Cevelj ({red=r,green=g,blue=b},v) = Cevelj ({red=1.0,green=0.5,blue=0.0}, 43) ; val b = 0.0 : real val g = 0.5 : real val r = 1.0 : real val v = 43 : int - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - val z = Palica 7 ; val z = Palica 7 : izdelek - case z of = Cevelj (b, v) -> if v < 25 then 10 else 15 stdIn:82.17-82.22 Error: syntax error: deleting ARROW IF - case z of = Cevelj (b, v) => if v < 25 then 10 else 15 = | Palica x => 2 * x + 1 = | Posoda v => 7 ; stdIn:84.12 Error: syntax error found at DARROW - case z of Cevelj (b, v) => if v < 25 then 15 else 25 | Palica x => 1 + 2 * x | Posoda y => 7 ; = = = = val it = 15 : int - case z of Cevelj (b, v) => if v < 25 then 15 else 25 | Palica x => 1 + 2 * x ; = = = stdIn:90.5-92.29 Warning: match nonexhaustive Cevelj (b,v) => ... Palica x => ... val it = 15 : int - case z of Cevelj (b, v) => if v < 25 then 15 else 25 | Posoda y => 7 ; = = = stdIn:94.5-96.21 Warning: match nonexhaustive Cevelj (b,v) => ... Posoda y => ... uncaught exception Match [nonexhaustive match failure] raised at: stdIn:96.21 - case z of Cevelj (b, v) => if v < 25 then 15 else 25 | Posoda y => 7 ; = = = stdIn:1.6-99.21 Warning: match nonexhaustive Cevelj (b,v) => ... Posoda y => ... uncaught exception Match [nonexhaustive match failure] raised at: stdIn:99.21 - case z of Cevelj (b, v) => if v < 25 then 15 else 25 | Posoda y => 7 = = = | _ => 0 ; val it = 0 : int - datatype smer_neba = sever | jug | vzhod | zahod ; datatype smer_neba = jug | sever | vzhod | zahod - - - - - - - - - - - - - - - - - datatype bool = false | true ; datatype bool = false | true - datatype my_bool = resnica | laz | politicna_izjava ; datatype my_bool = laz | politicna_izjava | resnica - if true then 2 + 3 else 3 + 4 ; stdIn:123.1-123.30 Error: test expression in if is not of type bool [tycon mismatch] test expression: bool in expression: if true then 2 + 3 else 3 + 4 - fn f => f 0 + f 1 + f 2 + f 3 ; val it = fn : (int -> int) -> int - val h = fn f => f 0 + f 1 + f 2 + f 3 ; val h = fn : (int -> int) -> int - h (fun k => k * k) ; stdIn:125.4 Error: syntax error found at FUN - h (fn k => k * k) ; val it = 14 : int - fn f => fn g => (fn x => f (g x)) ; val it = fn : ('a -> 'b) -> ('c -> 'a) -> 'c -> 'b - fn x => x ; val it = fn : 'a -> 'a - fn (x,y) => (y,x) ; val it = fn : 'a * 'b -> 'b * 'a -