Table of Contents

General considerations

类型匹配

命名空间

Operator types

类型映射 说明
, (a,b)→b
= (a,a)→a null是任意record type
|| and && (int,int)→{0,1} 短路逻辑
== and != (a,a)→{0,1} record/array的比较是比较地址而不是值
字符串比较的是值而不是地址
<, <=, > and >= (a,a)→{0,1} 不能比较record/array
字符串按字典序比较
+ 见加法类型表
-, *, / and % (int,int)→int 编译器不负责检查除数是否为零
! int→{0,1}
+ and - int→int 一元运算仅适合int类型
加法类型表 Right-hand side
int char string record/array
Left-hand side int int int string (error)
char int int string (error)
string string string string (error)
record/array (error) (error) (error) (error)

Native function semantics

char chr(int i) 只取参数的低8位
int ord(char c)