- 1.0+2.3;
val it = 3.3 : real
- 1+2*3;
val it = 7 : int
- (1+2)*3;
val it = 9 : int
- 2div3;
stdIn:15.2-15.6 Error: unbound variable or constructor:
div3
stdIn:15.1-15.6 Error: operator is not a function
[literal]
operator: int
in expression:
(2 : int) <ERRORvar>
- 2div 3;
val it = 0 : int
- 2 div 3;
val it = 0 : int
- "hello"^"world"
= ;
val it = "helloworld" : string
- "hello" ^ "world";
val it = "helloworld" : string
- "hello " ^ "world";
val it = "hello world" : string
- 3=2;
val it = false : bool
- 3>=2;
val it = true : bool
- 3<>2;
val it = true : bool
- 3><2;
stdIn:31.2-31.4 Error: unbound variable or constructor:
><
stdIn:31.1-31.5 Error: operator is not a function
[literal]
operator: int
in expression:
(3 : int) <ERRORvar>
- 2<3 andalso "hello" <= "world";
val it = true : bool
- 3<2 orelse 4.3 < 4.4;
val it = true : bool
- if 4<2 then 3+3 else 3*3;
val it = 9 : int
- if 2<4 then "hello" else "goodbye";
val it = "hello" : string
- if 3<=4 then 3 else "goodbye"
= ;
stdIn:48.1-48.30 Error: types of rules don't agree
[literal]
earlier rule(s): bool -> int
this rule: bool -> string
in rule:
false => "goodbye"
-