Skip to content

中英对照表

中英对照表 ​

以下为 meta-lisp 英文语法与中文语法的完整对照。

语法关键词 ​

英文中文
define定义
lambda函
if若
cond若则
when当
unless除非
and且
or或
begin循序
let令
letrec递归令
match匹配
claim声明
admit承认
exempt免检
the型例
all泛型
module模块
import导入
import-as导入为
import-all全导入
private私有
define-test定义测试
define-algebraic-type定义代数类型
define-struct-type定义结构类型
define-enum定义枚举
define-struct定义结构
define-type定义类型
define-opaque-type定义黑盒类型
declare-primitive-function声明基本函数
declare-primitive-variable声明基本变量

字面值与特殊值 ​

英文中文
true真
false假
void空值
else否则

@ 特殊语法 ​

英文中文
@list@列表
@set@集合
@hash@散列
@text@文本
@quote@引用
@quasiquote@半引用
@unquote@去引用
@square-bracket@方括号
@curly-bracket@花括号
@sexp@符号算式
@comment@注释

类型构造器 ​

英文中文
->->
int-t整数型
float-t浮点型
text-t文本型
symbol-t符号型
bool-t真假型
void-t空值型
file-t文件型
list-t列表型
set-t集合型
hash-t散列型
pair-t序对型
maybe-t或有型
box-t匣子型
json-t结森型
sexp-t符号算式型
source-location-t源码位置型
source-span-t源码区间型
source-position-t源码坐标型
type-t类型型

命名约定 ​

英文中文说明
is- (prefix)为 (前缀)类型谓词前缀:如 is-atom / 为原子
-is- (infix)为 (中缀)属性谓词中缀:如 int-is-positive / 整数为正
make-作构造器前缀

模块名 ​

英文中文
builtin内置

通用字段名 ​

英文中文
value值

通用函数 (value) ​

英文中文
is-atom为原子
same相同
equal相等
format呈现
hash-code散列码
total-compare全序比较

真假值 (bool) ​

英文中文
is-bool为真假
not非

整数 (int) ​

英文中文
is-int为整数
ineg整数负
iadd整数加
isub整数减
imul整数乘
idiv整数除
imod整数模
int-is-positive整数为正
int-is-non-negative整数非负
int-is-non-zero整数非零
int-less整数小于
int-greater整数大于
int-less-or-equal整数小于等于
int-greater-or-equal整数大于等于
int-compare-ascending整数升序比较
int-compare-descending整数降序比较
int-min整数最小
int-max整数最大
int-sum整数求和
int-product整数求积
int-align整数对齐

浮点数 (float) ​

英文中文
is-float为浮点
fneg浮点负
fadd浮点加
fsub浮点减
fmul浮点乘
fdiv浮点除
fmod浮点模
float-is-positive浮点为正
float-is-non-negative浮点非负
float-is-non-zero浮点非零
float-less浮点小于
float-greater浮点大于
float-less-or-equal浮点小于等于
float-greater-or-equal浮点大于等于
float-compare-ascending浮点升序比较
float-compare-descending浮点降序比较
float-min浮点最小
float-max浮点最大
float-sum浮点求和
float-product浮点求积

文本 (text) ​

英文中文
is-text为文本
text-is-int文本为整数
text-is-float文本为浮点
text-length文本长度
text-is-empty文本为空
text-is-blank文本为空白
text-append文本追加
text-concat文本拼接
text-slice文本截取
text-split文本分割
text-join文本连接
text-has-prefix文本有前缀
text-has-suffix文本有后缀
text-include文本包含
text-find-index文本查找索引
text-replace文本替换
text-trim文本修剪
text-trim-start文本修剪首端
text-trim-end文本修剪尾端
text-trim-left文本修剪左端
text-trim-right文本修剪右端
text-to-lower-case文本转小写
text-to-upper-case文本转大写
text-to-int文本转整数
text-to-float文本转浮点
text-to-symbol文本转符号
text-chars文本字符
text-get-code-point文本取码点
text-lines文本行
text-repeat文本重复
text-compare-lexical文本字典序比较

符号 (symbol) ​

英文中文
is-symbol为符号
symbol-length符号长度
symbol-append符号追加
symbol-concat符号拼接
symbol-to-text符号转文本

空值 (void) ​

英文中文
is-void为空值

数组 (array) ​

英文中文
array-t数组型
make-array作数组
is-array为数组
array-get数组取
array-put数组存
array-length数组长度
array-is-empty数组为空
array-push数组末入
array-pop数组末出
array-push-front数组首入
array-pop-front数组首出
array-copy数组复制
array-reverse数组反转
array-sort数组排序
array-each数组逐项
array-each-index数组逐项索引
array-to-list数组转列表
list-to-array列表转数组

列表 (list) ​

英文中文
list-t列表型
null空列表
is-list为列表
cons添
car首
cdr余
list-head列表首项
list-rest列表去首
list-first列表第一
list-second列表第二
list-third列表第三
list-last列表末项
list-but-last列表去末
list-get列表取
list-length列表长度
list-is-empty列表为空
list-has列表有
list-copy-put列表复制存
list-copy-reverse列表复制反转
list-to-set列表转集合
list-range列表区间
list-enumerate列表编号
list-each列表逐项
list-each-index列表逐项索引
list-map-concat列表映射拼接
list-map-index-concat列表映射索引拼接
list-map列表映射
list-map-index列表映射索引
list-zip-map列表拉链映射
list-zip列表拉链
list-unzip列表解拉链
list-filter列表筛选
list-fold-left列表左折叠
list-fold-left-index列表左折叠索引
list-fold-right列表右折叠
list-fold-right-index列表右折叠索引
list-every列表全部
list-some列表有些
list-take列表取前
list-drop列表去前
list-append列表追加
list-concat列表拼接
list-product列表直积
list-group列表分组
list-find列表查找
list-find-index列表查找索引

集合 (set) ​

英文中文
set-t集合型
make-set作集合
set-size集合大小
set-is-empty集合为空
set-has集合有
set-include集合包含
set-copy集合复制
set-add集合添加
set-copy-add集合复制添加
set-delete集合删除
set-copy-delete集合复制删除
set-clear集合清空
set-union集合并
set-inter集合交
set-difference集合差
set-disjoint集合不交
set-each集合逐项
set-every集合全部
set-some集合有些
set-map集合映射
set-select集合选取
set-reject集合剔除
set-to-list集合转列表

散列 (hash) ​

英文中文
hash-t散列型
make-hash作散列
make-hash-from-entries作散列自条目
hash-is-empty散列为空
hash-length散列长度
hash-has散列有
hash-get散列取
hash-get-maybe散列取或有
hash-keys散列键
hash-values散列值
hash-entries散列条目
hash-put散列存
hash-copy-put散列复制存
hash-put-entries散列存条目
hash-copy-put-entries散列复制存条目
hash-delete散列删除
hash-copy散列复制
hash-each散列逐项
hash-each-key散列逐键
hash-each-value散列逐值
hash-each-entry散列逐条目
hash-map散列映射
hash-map-key散列映射键
hash-map-value散列映射值
hash-map-entry散列映射条目
hash-select散列选取
hash-select-key散列选取键
hash-select-value散列选取值
hash-reject散列剔除
hash-reject-key散列剔除键
hash-reject-value散列剔除值
hash-append散列追加
hash-invert散列反转
hash-invert-group散列反转分组

序对 (pair) ​

英文中文
pair-t序对型
make-pair作序对
pair-first序对前项
pair-second序对后项
pair-put-first序对存前项
pair-put-second序对存后项

或有 (maybe) ​

英文中文
maybe-t或有型
just有
nothing无
is-just为有
is-nothing为无
just-value有值
just-put-value有存值

匣子 (box) ​

英文中文
box-t匣子型
make-box作匣子
box-is-empty匣子为空
box-put匣子存
box-get-maybe匣子取或有
box-get匣子取

函数操作 (function) ​

英文中文
constant常值函数
identity恒等函数
swap交换参数
drop丢弃参数
dup复制参数

文件 I/O (file) ​

英文中文
file-t文件型
open-input-file打开输入文件
open-output-file打开输出文件
file-close文件关闭
file-read文件读
file-write文件写
file-writeln文件写行
use-input-file使用输入文件
use-output-file使用输出文件
print打印
println打印行

文件系统 (path) ​

英文中文
path-exists路径存在
path-is-file路径为文件
path-is-directory路径为目录
path-read路径读
path-write路径写
path-list路径列表
path-list-recursive路径递归列表
path-ensure-file路径确保文件
path-ensure-directory路径确保目录
path-delete-file路径删除文件
path-delete-directory路径删除目录
path-delete路径删除
path-rename路径重命名

路径操作 (path) ​

英文中文
path-file-name路径文件名
path-directory-name路径目录名
path-extension路径扩展名
path-stem路径主干
path-is-absolute路径为绝对
path-is-relative路径为相对
path-join路径连接
path-normalize路径规范化
path-relative路径相对
path-relative-to-cwd路径相对于当前目录
path-resolve路径解析

断言 (assert) ​

英文中文
assert断言
assert-not断言非
assert-equal断言相等
assert-not-equal断言不等
assert-with-location定位断言
assert-not-with-location定位断言非
assert-equal-with-location定位断言相等
assert-not-equal-with-location定位断言不等

错误处理 (error) ​

英文中文
error报错
error-with-location定位报错

进程 (process) ​

英文中文
exit退出
current-directory当前目录
current-command-line当前命令行
current-full-command-line当前完整命令行
current-stdout-file当前标准输出文件
current-stderr-file当前标准错误文件

随机数 (random) ​

英文中文
random-int随机整数
random-float随机浮点

呈现 (format) ​

英文中文
format-as-sexp呈现为符号算式
format-int呈现整数
format-float呈现浮点
format-symbol呈现符号
format-bool呈现真假
format-text呈现文本
format-void呈现空值
format-message-with-location呈现定位消息

符号算式 (sexp) ​

英文中文
sexp-t符号算式型
source-location-t源码位置型
source-span-t源码区间型
source-position-t源码坐标型
parse-sexps解析符号算式
format-sexp呈现符号算式

结森 (json) ​

英文中文
json-t结森型
parse-json解析结森
format-json呈现结森