diff --git a/appendix.html b/appendix.html new file mode 100644 index 0000000..6d9cea5 --- /dev/null +++ b/appendix.html @@ -0,0 +1,2 @@ + +
6.1 terminology |
+“字”(characters)就是通常所谓的“字符”。
(require ming/racket/base) | package: ming |
composition
composition
字化数 : 字 + 化 + 数 = char->integer
composition
数化字 : 数 + 化 + 字 = integer->char
composition
字度/utf-8 : 字度 + / + utf-8 = char-utf-8-length
composition
composition
composition
composition
composition
composition
composition
composition
字<=?/ci : 字<=? + / + ci = char-ci<=?
composition
composition
字>=?/ci : 字>=? + / + ci = char-ci>=?
composition
字?/英 : 字? + / + 英 = char-alphabetic?
composition
字?/小写 : 字? + / + 小写 = char-lower-case?
composition
字?/大写 : 字? + / + 大写 = char-upper-case?
composition
字?/标题 : 字? + / + 标题 = char-title-case?
composition
数字? : 数 + 字 + ? = char-numeric?
composition
字?/符号 : 字? + / + 符号 = char-symbolic?
composition
字?/标点 : 字? + / + 标点 = char-punctuation?
composition
字?/象形 : 字? + / + 象形 = char-graphic?
composition
字?/whitespace : 字? + / + whitespace = char-whitespace?
composition
字?/blank : 字? + / + blank = char-blank?
composition
字?/iso-control : 字? + / + iso-control = char-iso-control?
composition
汉字? : 汉 + 字 + ? = char-extended-pictographic?
composition
字类 : 字 + 类 = char-general-category
composition
字属 : 字 + 属 = char-grapheme-break-property
composition
: a + k + e + - + k + n + o + w + n + - + c + h + a + r + - + r + a + n + g + e + - + l + i + s + t = make-known-char-range-list
composition
字大写化 : 字 + 大 + 写 + 化 = char-upcase
composition
字小写化 : 字 + 小 + 写 + 化 = char-downcase
composition
字标题化 : 字 + 标 + 题 + 化 = char-titlecase
composition
字标题化* : 字 + 标 + 题 + 化 + * = char-foldcase
composition
: h + a + r + - + g + r + a + p + h + e + m + e + - + s + t + e + p = char-grapheme-step
🐘
> (当 [(? 0) (displayln "positive number")] [(? 0) (displayln "negative number")] [夬 (displayln "neither positive or negative number")]) neither positive or negative number
> (肖 (+ 1 1) [(1) (displayln "result is 1")] [(2) (displayln "result is 2")] [夬 (displayln "result is neither 1 or 2")]) result is 2
🐘 𥟍
(require ming/racket/base) | package: ming |
5.3.1 例程命名规则 |
5.3.2 、、、、 |
5.3.3 ^、^、^、^,^、^、^、^,^、^、^、^,^、^、^、^,化 |
5.3.4 ?,?、?、?、?,?、?、?,? |
5.3.5 、,日? |
5.3.6 弔、𫼛,,、 |
5.3.7 攸、攸+ ,、+ ,攸/ 入、/ 入 |
5.3.8 𠛮、,𠛮 |
5.3.9 各、、佫 |
5.3.10 仔? |
5.3.11 巨 |
5.3.12 化 |
5.3.13 基础例程 |
|
|
|
|
? |
? |
? |
? |
? |
? |
? |
? |
^ |
^ |
^ |
^ |
^ |
^ |
^ |
^ |
^ |
^ |
^ |
^ |
^ |
^ |
^ |
^ |
攸 |
攸+ |
攸/ 入 |
|
+ |
/ 入 |
弔 |
|
𫼛 |
日? |
|
|
𠛮 |
|
𠛮 |
|
佫 |
|
|
化 |
仔? |
各 |
巨 |
? |
?引 |
?继引 |
?引日 |
?引月 |
?引明 |
?引日月 |
化 |
5.3.14 额外例程 |
并 |
并! |
交! |
另见名扩展库:
规则 | 指示 | 含义 | 举例 |
囗/古/舌/亻 + | “”中“键值对”唯一性的确立方式 | 是通过与之对应的同?/?/?/侗?中的任一者所确立的 | |
山/氵 + | “”中“键值对”是否可变 | 是不可或可被增加、删除或修改的 | |
⺮/艹 + | “”中“键值对”之“键”的存储方式 | 是刚性或柔性的 | |
亻 | 相似集(类型相同且元素相似) | 出参数据与进参数据相比,类型相同且内容类似 | |
阝 | 连续集(类型相同且元素连续相同) | 出参数据与进参数据相比,类型相同且前者是后者的一部分 | |
刂 | 缺失集(删除、移走、去掉部分元素之后的集合) | 出参数据与进参数据相比,类型相同且前者是后者的子集 | |
扌/!结尾 | 修改警示 | 会直接修改原始数据而非另造新数据作输出 | |
^结尾 | 入参 | 入参数据是类数据 | |
+结尾 | 入参 | 入参数据以相同方式多次出现 |
为新造字 +、、、为新造字 +
囗:同的简写,见同?;
古:的简写,见?;
舌:的简写,见?;
亻:侗的简写,见侗?。
、、、、为新造字 +为新造字 +
穴:简写,通空。
另见:
:内容不可改变的“”,也称“固”;
:内容可改变的“”,也称“易”(扌偏旁相关的例程或以!结尾的例程只能作用在“易”上)。
:刚性的;
:柔性的;
:类的。
> (^ '((1 . 2) (3 . 4))) '#hash((1 . 2) (3 . 4))
> (? (^ '((1 . 2) (3 . 4)))) #t
> (^ '((1 . 2) (3 . 4))) '#hash((1 . 2) (3 . 4))
> (? (^ '((1 . 2) (3 . 4)))) #f
> (^ '((1 . 2) (3 . 4))) '#hashalw((1 . 2) (3 . 4))
> (? (^ '((1 . 2) (3 . 4)))) #t
> (化 ( 1 2 3 4)) '((1 . 2) (3 . 4))
> (化 ( 1 2 3 4)) '((1 . 2) (3 . 4))
> (化 ( 1 2 3 4)) '((1 . 2) (3 . 4))
> (? ( 1 2 3 4)) #t
> (? ( 1 2 3 4)) #t
> (? ( 1 2 3 4)) #t
> (? ( 1 2 3 4)) #t
> (? ( 1 2 3 4)) #t
> (^ '((1 . 2) (3 . 4))) '#hash((1 . 2) (3 . 4))
> (? (^ '((1 . 2) (3 . 4)))) #t
> (? (^ '((1 . 2) (3 . 4)))) #t
> (? (^ '((1 . 2) (3 . 4)))) #t
> (? (^ '((1 . 2) (3 . 4)))) #t
> (? (^ '((1 . 2) (3 . 4)))) #f
> (? (^ '((1 . 2) (3 . 4)))) #t
> (? ( 'a "aa" 'b "bb")) #f
> (? ()) #t
> (弔 ( 'a "apple" 'b "banana") 'b) "banana"
> (弔 ( 'a "apple" 'b "banana") 'b "cat") "banana"
> (弔 ( 'a "apple" 'b "banana") 'c "cat") "cat"
> ( ( 'a "apple" 'b "banana") 'b) 'b
> ( ( 'a "apple" 'b "banana") 'b "cat") 'b
> ( ( 'a "apple" 'b "banana") 'c "cat") "cat"
> ( ( 'a "apple" 'b "banana") 'a) '#hash((b . "banana"))
> (名 h ( 'a "apple" 'b "banana")) > (𫼛 h 'b "cat") "banana"
> h '#hash((a . "apple") (b . "banana"))
> (𫼛 h 'c "cat") "cat"
> h '#hash((a . "apple") (b . "banana") (c . "cat"))
> ( h 'a) > h '#hash((b . "banana") (c . "cat"))
参见:攸
> (攸 ( 'a "apple" 'b "banana") 'b "ba") '#hash((a . "apple") (b . "ba"))
> (攸+ ( 'a "apple" 'b "banana") 'a "ap" 'b "ba") '#hash((a . "ap") (b . "ba"))
> (攸/入 ( 'a "apple" 'b "banana" 'c 1) 'c ) '#hash((a . "apple") (b . "banana") (c . 2))
> (名 h ( 'a "apple" 'b "banana")) > (+ h 'a "ap" 'b "ba") > h '#hash((a . "ap") (b . "ba"))
𠛮为古活字 +
刂:删除;
为新造字 +
又:的缩写;
参见:佫
参见:、仔?
参见:巨、空?
(require ming/racket/base) | package: ming |
composition
composition
composition
composition
composition
: elem + 是否是 + needtofix + 、 + needtofix + 、 + needtofix + 、 + needtofix + 的任一种 = hash?
composition
? : elem + 是否是 + needtofix = hash-equal?
composition
? : elem + 是否是 + needtofix = hash-equal-always?
composition
composition
composition
? : elem + 类上,键是否是被刚性存储的 = hash-strong?
composition
? : elem + 类上,键是否是被柔性存储的 = hash-weak?
composition
? : elem + 类上,键的存储是否是采用 + needtofix = hash-ephemeron?
composition
composition
^ : elem + needtofix + 转换成 + needtofix = make-hashalw
composition
^ : elem + needtofix + 转换成 + needtofix = make-hasheqv
composition
^ : elem + needtofix + 转换成 + needtofix = make-hasheq
composition
^ : elem + 如上类推 = make-immutable-hash
composition
^ : elem + 如上类推 = make-immutable-hashalw
composition
^ : elem + 如上类推 = make-immutable-hasheqv
composition
^ : elem + 如上类推 = make-immutable-hasheq
composition
^ : elem + 如上类推 = make-weak-hash
composition
^ : elem + 如上类推 = make-weak-hashalw
composition
^ : elem + 如上类推 = make-weak-hasheqv
composition
^ : elem + 如上类推 = make-weak-hasheq
composition
^ : elem + 如上类推 = make-ephemeron-hash
composition
^ : elem + 如上类推 = make-ephemeron-hashalw
composition
^ : elem + 如上类推 = make-ephemeron-hasheqv
composition
^ : elem + 如上类推 = make-ephemeron-hasheq
composition
composition
composition
攸/入 : = hash-update
composition
composition
+ : elem + 直接修改某些“键”所对应的“值” = hash-set*!
composition
/入 : = hash-update!
composition
弔 : elem + 以“键值对”中“阳”位数据为基准,来索引查询“键值对”并返回“阴”位数据(未找到数据则返回默认设置值);
= hash-ref
composition
: elem + 以“键值对”中“阳”位数据为基准,来索引查询“键值对”并返回“阳”位数据; = hash-ref-key
composition
: elem + 以“键值对”中“阳”位数据为基准,来索引查询“键值对”并返回“阴”位数据(未找到数据则直接修改原数据增加新“键值对”); = hash-ref!
composition
日? : elem + 是否存在某“键” = hash-has-key?
composition
: elem + 以新造数据的方式来删除某“键”和其对应的“值” = hash-remove
composition
: elem + 直接删除某“键”和其对应的“值” = hash-remove!
composition
𠛮 : elem + 以新造数据的方式来删除全部“键”和其对应的“值” = hash-clear
composition
: elem + 直接删除全部“键”和其对应的“值” = hash-clear!
composition
𠛮 : elem + 以删除全部“键”和其对应的“值”的方式新造空数据 = hash-copy-clear
composition
composition
佫 : elem + 把某一个例程依次作用在各个明(键值对)上 = hash-map/copy
composition
composition
: elem + 返回中所有键值对的“值”组成的 + needtofix = hash-values
composition
化 : + 化 + = hash->list
composition
仔? : elem + 前者是否是后者的 + needtofix + 的子集 = hash-keys-subset?
composition
各 : + 各 = hash-for-each
composition
巨 : + 巨 = hash-count
composition
? : + ? = hash-empty?
composition
?引 : ? + + 引 = hash-iterate-first
composition
?继引 : ? + + 继 + 引 = hash-iterate-next
composition
?引日 : ? + + 引 + 日 = hash-iterate-key
composition
?引月 : ? + + 引 + 月 = hash-iterate-value
composition
?引明 : ? + + 引 + 明 = hash-iterate-pair
composition
composition
(require ming/racket/hash) | package: ming |
Ming Language |
“勾”(keywords)是与勺类似的数据结构,特别地被用于例程的参数中使用。
见Naming Rules中关于化的条目。
勾为活用字 +
勹:工厂、容器、外壳;
厶:参数(通参);
勾:在古代通句,在此借用为表示勾是和句相近的一种数据结构;
(require ming/racket/base) | package: ming |
composition
composition
勾化句 : = keyword->string
composition
句化勾 : = string->keyword
composition
(require ming/racket/keywords) | package: ming |
composition
勾化 : = keyword->immutable-string
本页所列之例程的实现代码是名语言,因此源代码有参照意义。
procedure
(? V) → boolean?
V : any?
procedure
(? V) → boolean?
V : any?
procedure
(? V) → boolean?
V : any?
procedure
(? V) → boolean?
V : any?
、、、是新造字 +
十:艹的简写;
丿一丶:⺮的简写;
丷:氵的简写。
procedure
(? V) → boolean?
V : any?
procedure
(? V) → boolean?
V : any?
procedure
(? V) → boolean?
V : any?
procedure
(? V) → boolean?
V : any?
procedure
(? V) → boolean?
V : any?
procedure
(? V) → boolean?
V : any?
procedure
(? V) → boolean?
V : any?
procedure
(? V) → boolean?
V : any?
procedure
(? V) → boolean?
V : any?
procedure
(? V) → boolean?
V : any?
procedure
(? V) → boolean?
V : any?
procedure
(? V) → boolean?
V : any?
procedure
(? V) → boolean?
V : any?
procedure
(? V) → boolean?
V : any?
procedure
(? V) → boolean?
V : any?
procedure
(? V) → boolean?
V : any?
、、、是新造字
+、、、是新造字
+、、、是新造字
+、、、是新造字
(require ming/kernel) | package: ming |
syntax
( exprs ...)
syntax
( arg1 exprs ...)
syntax
( arg1 arg2 exprs ...)
syntax
( arg1 arg2 arg3 exprs ...)
🐘 入
> (( ( 1 2 3))) '(1 2 3)
> (( x ( 1 2 x)) 3) '(1 2 3)
> (( x y ( 1 2 x y)) 3 4) '(1 2 3 4)
> (( x y z ( 1 2 x y z)) 3 4 5) '(1 2 3 4 5)
> (( x #:arg y ( 1 2 x y)) 3 #:arg 4) '(1 2 3 4)
> (( 10)) 10
> (( x x) 10) 10
syntax
( a b c)
🐘 丫,、
All the procedures in this page are implemented in Ming, therefore, the source code can be seen as a demonstation of it.
> ( '(a b c d e f g) 1 3) '(b c d)
🐘 巨
> ( 'c '(a b c d e c f)) '(a b d e f)
🐘
procedure
(? V) → boolean?
V : any?
6.1 terminology |
+“字”(characters)就是通常所谓的“字符”。
(require ming/racket/base) | package: ming |
composition
composition
字化数 : 字 + 化 + 数 = char->integer
composition
数化字 : 数 + 化 + 字 = integer->char
composition
字度/utf-8 : 字度 + / + utf-8 = char-utf-8-length
composition
composition
composition
composition
composition
composition
composition
composition
字<=?/ci : 字<=? + / + ci = char-ci<=?
composition
composition
字>=?/ci : 字>=? + / + ci = char-ci>=?
composition
字?/英 : 字? + / + 英 = char-alphabetic?
composition
字?/小写 : 字? + / + 小写 = char-lower-case?
composition
字?/大写 : 字? + / + 大写 = char-upper-case?
composition
字?/标题 : 字? + / + 标题 = char-title-case?
composition
数字? : 数 + 字 + ? = char-numeric?
composition
字?/符号 : 字? + / + 符号 = char-symbolic?
composition
字?/标点 : 字? + / + 标点 = char-punctuation?
composition
字?/象形 : 字? + / + 象形 = char-graphic?
composition
字?/whitespace : 字? + / + whitespace = char-whitespace?
composition
字?/blank : 字? + / + blank = char-blank?
composition
字?/iso-control : 字? + / + iso-control = char-iso-control?
composition
汉字? : 汉 + 字 + ? = char-extended-pictographic?
composition
字类 : 字 + 类 = char-general-category
composition
字属 : 字 + 属 = char-grapheme-break-property
composition
: a + k + e + - + k + n + o + w + n + - + c + h + a + r + - + r + a + n + g + e + - + l + i + s + t = make-known-char-range-list
composition
字大写化 : 字 + 大 + 写 + 化 = char-upcase
composition
字小写化 : 字 + 小 + 写 + 化 = char-downcase
composition
字标题化 : 字 + 标 + 题 + 化 = char-titlecase
composition
字标题化* : 字 + 标 + 题 + 化 + * = char-foldcase
composition
: h + a + r + - + g + r + a + p + h + e + m + e + - + s + t + e + p = char-grapheme-step
🐘
> (当 [(? 0) (displayln "positive number")] [(? 0) (displayln "negative number")] [夬 (displayln "neither positive or negative number")]) neither positive or negative number
> (肖 (+ 1 1) [(1) (displayln "result is 1")] [(2) (displayln "result is 2")] [夬 (displayln "result is neither 1 or 2")]) result is 2
🐘 𥟍
(require ming/racket/base) | package: ming |
5.3.1 例程命名规则 |
5.3.2 、、、、 |
5.3.3 ^、^、^、^,^、^、^、^,^、^、^、^,^、^、^、^,化 |
5.3.4 ?,?、?、?、?,?、?、?,? |
5.3.5 、,日? |
5.3.6 弔、𫼛,,、 |
5.3.7 攸、攸+ ,、+ ,攸/ 入、/ 入 |
5.3.8 𠛮、,𠛮 |
5.3.9 各、、佫 |
5.3.10 仔? |
5.3.11 巨 |
5.3.12 化 |
5.3.13 基础例程 |
|
|
|
|
? |
? |
? |
? |
? |
? |
? |
? |
^ |
^ |
^ |
^ |
^ |
^ |
^ |
^ |
^ |
^ |
^ |
^ |
^ |
^ |
^ |
^ |
攸 |
攸+ |
攸/ 入 |
|
+ |
/ 入 |
弔 |
|
𫼛 |
日? |
|
|
𠛮 |
|
𠛮 |
|
佫 |
|
|
化 |
仔? |
各 |
巨 |
? |
?引 |
?继引 |
?引日 |
?引月 |
?引明 |
?引日月 |
化 |
5.3.14 额外例程 |
并 |
并! |
交! |
另见名扩展库:
规则 | 指示 | 含义 | 举例 |
囗/古/舌/亻 + | “”中“键值对”唯一性的确立方式 | 是通过与之对应的同?/?/?/侗?中的任一者所确立的 | |
山/氵 + | “”中“键值对”是否可变 | 是不可或可被增加、删除或修改的 | |
⺮/艹 + | “”中“键值对”之“键”的存储方式 | 是刚性或柔性的 | |
亻 | 相似集(类型相同且元素相似) | 出参数据与进参数据相比,类型相同且内容类似 | |
阝 | 连续集(类型相同且元素连续相同) | 出参数据与进参数据相比,类型相同且前者是后者的一部分 | |
刂 | 缺失集(删除、移走、去掉部分元素之后的集合) | 出参数据与进参数据相比,类型相同且前者是后者的子集 | |
扌/!结尾 | 修改警示 | 会直接修改原始数据而非另造新数据作输出 | |
^结尾 | 入参 | 入参数据是类数据 | |
+结尾 | 入参 | 入参数据以相同方式多次出现 |
为新造字 +、、、为新造字 +
囗:同的简写,见同?;
古:的简写,见?;
舌:的简写,见?;
亻:侗的简写,见侗?。
、、、、为新造字 +为新造字 +
穴:简写,通空。
另见:
:内容不可改变的“”,也称“固”;
:内容可改变的“”,也称“易”(扌偏旁相关的例程或以!结尾的例程只能作用在“易”上)。
:刚性的;
:柔性的;
:类的。
> (^ '((1 . 2) (3 . 4))) '#hash((1 . 2) (3 . 4))
> (? (^ '((1 . 2) (3 . 4)))) #t
> (^ '((1 . 2) (3 . 4))) '#hash((1 . 2) (3 . 4))
> (? (^ '((1 . 2) (3 . 4)))) #f
> (^ '((1 . 2) (3 . 4))) '#hashalw((1 . 2) (3 . 4))
> (? (^ '((1 . 2) (3 . 4)))) #t
> (化 ( 1 2 3 4)) '((1 . 2) (3 . 4))
> (化 ( 1 2 3 4)) '((1 . 2) (3 . 4))
> (化 ( 1 2 3 4)) '((1 . 2) (3 . 4))
> (? ( 1 2 3 4)) #t
> (? ( 1 2 3 4)) #t
> (? ( 1 2 3 4)) #t
> (? ( 1 2 3 4)) #t
> (? ( 1 2 3 4)) #t
> (^ '((1 . 2) (3 . 4))) '#hash((1 . 2) (3 . 4))
> (? (^ '((1 . 2) (3 . 4)))) #t
> (? (^ '((1 . 2) (3 . 4)))) #t
> (? (^ '((1 . 2) (3 . 4)))) #t
> (? (^ '((1 . 2) (3 . 4)))) #t
> (? (^ '((1 . 2) (3 . 4)))) #f
> (? (^ '((1 . 2) (3 . 4)))) #t
> (? ( 'a "aa" 'b "bb")) #f
> (? ()) #t
> (弔 ( 'a "apple" 'b "banana") 'b) "banana"
> (弔 ( 'a "apple" 'b "banana") 'b "cat") "banana"
> (弔 ( 'a "apple" 'b "banana") 'c "cat") "cat"
> ( ( 'a "apple" 'b "banana") 'b) 'b
> ( ( 'a "apple" 'b "banana") 'b "cat") 'b
> ( ( 'a "apple" 'b "banana") 'c "cat") "cat"
> ( ( 'a "apple" 'b "banana") 'a) '#hash((b . "banana"))
> (名 h ( 'a "apple" 'b "banana")) > (𫼛 h 'b "cat") "banana"
> h '#hash((a . "apple") (b . "banana"))
> (𫼛 h 'c "cat") "cat"
> h '#hash((a . "apple") (b . "banana") (c . "cat"))
> ( h 'a) > h '#hash((b . "banana") (c . "cat"))
参见:攸
> (攸 ( 'a "apple" 'b "banana") 'b "ba") '#hash((a . "apple") (b . "ba"))
> (攸+ ( 'a "apple" 'b "banana") 'a "ap" 'b "ba") '#hash((a . "ap") (b . "ba"))
> (攸/入 ( 'a "apple" 'b "banana" 'c 1) 'c ) '#hash((a . "apple") (b . "banana") (c . 2))
> (名 h ( 'a "apple" 'b "banana")) > (+ h 'a "ap" 'b "ba") > h '#hash((a . "ap") (b . "ba"))
𠛮为古活字 +
刂:删除;
为新造字 +
又:的缩写;
参见:佫
参见:、仔?
参见:巨、空?
(require ming/racket/base) | package: ming |
composition
composition
composition
composition
composition
: elem + 是否是 + needtofix + 、 + needtofix + 、 + needtofix + 、 + needtofix + 的任一种 = hash?
composition
? : elem + 是否是 + needtofix = hash-equal?
composition
? : elem + 是否是 + needtofix = hash-equal-always?
composition
composition
composition
? : elem + 类上,键是否是被刚性存储的 = hash-strong?
composition
? : elem + 类上,键是否是被柔性存储的 = hash-weak?
composition
? : elem + 类上,键的存储是否是采用 + needtofix = hash-ephemeron?
composition
composition
^ : elem + needtofix + 转换成 + needtofix = make-hashalw
composition
^ : elem + needtofix + 转换成 + needtofix = make-hasheqv
composition
^ : elem + needtofix + 转换成 + needtofix = make-hasheq
composition
^ : elem + 如上类推 = make-immutable-hash
composition
^ : elem + 如上类推 = make-immutable-hashalw
composition
^ : elem + 如上类推 = make-immutable-hasheqv
composition
^ : elem + 如上类推 = make-immutable-hasheq
composition
^ : elem + 如上类推 = make-weak-hash
composition
^ : elem + 如上类推 = make-weak-hashalw
composition
^ : elem + 如上类推 = make-weak-hasheqv
composition
^ : elem + 如上类推 = make-weak-hasheq
composition
^ : elem + 如上类推 = make-ephemeron-hash
composition
^ : elem + 如上类推 = make-ephemeron-hashalw
composition
^ : elem + 如上类推 = make-ephemeron-hasheqv
composition
^ : elem + 如上类推 = make-ephemeron-hasheq
composition
composition
composition
攸/入 : = hash-update
composition
composition
+ : elem + 直接修改某些“键”所对应的“值” = hash-set*!
composition
/入 : = hash-update!
composition
弔 : elem + 以“键值对”中“阳”位数据为基准,来索引查询“键值对”并返回“阴”位数据(未找到数据则返回默认设置值);
= hash-ref
composition
: elem + 以“键值对”中“阳”位数据为基准,来索引查询“键值对”并返回“阳”位数据; = hash-ref-key
composition
: elem + 以“键值对”中“阳”位数据为基准,来索引查询“键值对”并返回“阴”位数据(未找到数据则直接修改原数据增加新“键值对”); = hash-ref!
composition
日? : elem + 是否存在某“键” = hash-has-key?
composition
: elem + 以新造数据的方式来删除某“键”和其对应的“值” = hash-remove
composition
: elem + 直接删除某“键”和其对应的“值” = hash-remove!
composition
𠛮 : elem + 以新造数据的方式来删除全部“键”和其对应的“值” = hash-clear
composition
: elem + 直接删除全部“键”和其对应的“值” = hash-clear!
composition
𠛮 : elem + 以删除全部“键”和其对应的“值”的方式新造空数据 = hash-copy-clear
composition
composition
佫 : elem + 把某一个例程依次作用在各个明(键值对)上 = hash-map/copy
composition
composition
: elem + 返回中所有键值对的“值”组成的 + needtofix = hash-values
composition
化 : + 化 + = hash->list
composition
仔? : elem + 前者是否是后者的 + needtofix + 的子集 = hash-keys-subset?
composition
各 : + 各 = hash-for-each
composition
巨 : + 巨 = hash-count
composition
? : + ? = hash-empty?
composition
?引 : ? + + 引 = hash-iterate-first
composition
?继引 : ? + + 继 + 引 = hash-iterate-next
composition
?引日 : ? + + 引 + 日 = hash-iterate-key
composition
?引月 : ? + + 引 + 月 = hash-iterate-value
composition
?引明 : ? + + 引 + 明 = hash-iterate-pair
composition
composition
(require ming/racket/hash) | package: ming |
Ming Language |
“勾”(keywords)是与勺类似的数据结构,特别地被用于例程的参数中使用。
见Naming Rules中关于化的条目。
勾为活用字 +
勹:工厂、容器、外壳;
厶:参数(通参);
勾:在古代通句,在此借用为表示勾是和句相近的一种数据结构;
(require ming/racket/base) | package: ming |
composition
composition
勾化句 : = keyword->string
composition
句化勾 : = string->keyword
composition
(require ming/racket/keywords) | package: ming |
composition
勾化 : = keyword->immutable-string
本页所列之例程的实现代码是名语言,因此源代码有参照意义。
procedure
(? V) → boolean?
V : any?
procedure
(? V) → boolean?
V : any?
procedure
(? V) → boolean?
V : any?
procedure
(? V) → boolean?
V : any?
、、、是新造字 +
十:艹的简写;
丿一丶:⺮的简写;
丷:氵的简写。
procedure
(? V) → boolean?
V : any?
procedure
(? V) → boolean?
V : any?
procedure
(? V) → boolean?
V : any?
procedure
(? V) → boolean?
V : any?
procedure
(? V) → boolean?
V : any?
procedure
(? V) → boolean?
V : any?
procedure
(? V) → boolean?
V : any?
procedure
(? V) → boolean?
V : any?
procedure
(? V) → boolean?
V : any?
procedure
(? V) → boolean?
V : any?
procedure
(? V) → boolean?
V : any?
procedure
(? V) → boolean?
V : any?
procedure
(? V) → boolean?
V : any?
procedure
(? V) → boolean?
V : any?
procedure
(? V) → boolean?
V : any?
procedure
(? V) → boolean?
V : any?
、、、是新造字
+、、、是新造字
+、、、是新造字
+、、、是新造字
(require ming/kernel) | package: ming |
syntax
( exprs ...)
syntax
( arg1 exprs ...)
syntax
( arg1 arg2 exprs ...)
syntax
( arg1 arg2 arg3 exprs ...)
🐘 入
> (( ( 1 2 3))) '(1 2 3)
> (( x ( 1 2 x)) 3) '(1 2 3)
> (( x y ( 1 2 x y)) 3 4) '(1 2 3 4)
> (( x y z ( 1 2 x y z)) 3 4 5) '(1 2 3 4 5)
> (( x #:arg y ( 1 2 x y)) 3 #:arg 4) '(1 2 3 4)
> (( 10)) 10
> (( x x) 10) 10
syntax
( a b c)
🐘 丫,、
All the procedures in this page are implemented in Ming, therefore, the source code can be seen as a demonstation of it.
> ( '(a b c d e f g) 1 3) '(b c d)
🐘 巨
> ( 'c '(a b c d e c f)) '(a b d e f)
🐘
procedure
(? V) → boolean?
V : any?
3.1 Characters |
3.2 Punctuations |
3.3 Phrases |
3.4 Hybrids |
You may need to read Character implications first.
Part | Connotation | Elucidation | Example |
亻 | general subset | The type of output data is same as input, content is part of input. | |
阝 | serial subset | The type of output data is same as input, content is a serial part of input. | |
刂 | broken subset | The type of output data is same as input, content is almost same, except some elements are removed. | |
彐 | find | Simplifies from 寻, which means find. | |
戈 | substitute | Means substitute. | |
土 | produce | Means create, build, produce. | 垎 |
扌 | Same as usage of ! | Means directly modify the original data instead of creating new one, thus the output is void. | |
攵 | modify | Means modify value corresponding to specified index, thus inputs are index number and expected value. | |
三 | duplicated elements | Means three, especially means duplicated elments. | |
弓 | index | Means index(ref to 弓), especially means a range of numbers. | |
弔 | value of index | Means Returns corresponding vaule of index, thus the type of input data is ?. | |
毌 | append | Simplifies from 贯, which means append. | |
穴 | empty | Simplifies from 空, means empty. | |
非 | not | Means not. | |
巨 | length | Means return the length. | |
米 | number | Simplifies from 数, which means number. |
Rule | Connotation | Elucidation | Example |
suffix ? | boolean as output | Is or not is. the output is boolean. | 空? 𥥪? |
suffix ! | same as usage of 攵 | Means directly modify the original data instead of creating new one, thus the output is void. | ! 𠛮! |
suffix ~ | softly | Immediately returns result once meet the request. | |
suffix ^ | list as input | The type of input data is list | |
include / | Of | output is determinated by prefix of / | /组合 /分组 |
Rule | Connotation | Elucidation | Example |
suffix 分 | splits data | Splits input data, and output them in values type. | 分、𨚞分、䢼分、分、分 |
suffix 化 | attribute convert | Convert attributes of data, such as from mutable to immutable. | |
insert 化 | type convert | Convert types of data. |
Rule | Connotation | Elucidation | Example |
suffix 𰅡 | directly attribute convert | Directly convert attribute of data with modifying the orignal data. | |
include /入 | Function as input | Means Type of input data is procedure. |
另见名扩展库:米
数被简写为米偏旁,以便构造单字来表示跟其相关的概念 +
现代汉语中“数”有关的概念和词汇很多都来对英文的直接翻译,并且大都使用词组来构造;
但我认为仅单个汉字所能包含的意义很多时候就已经比英文中的单词多了,进而还构造使用词组进行表达就会显得“含意过剩”,反而显得啰唆,含意不清;
故此,本语言对关于“数”的例程做了简化:剔除多余无效的表意偏旁,代之以简洁有效的偏旁组合成单字进行表达。
见Naming Rules,有:
规则 | 含义 | 举例 |
下偏旁米 | 大类概念 | |
上偏旁米 | 常用概念 | |
整体性结构的米 | 常用概念 | |
偏旁石 | “准确”相关 | |
左偏旁米 | 内部实现、运算或转化例程(进参、出参都是数字) | |
偏旁 | 整数相关 | |
偏旁彡 | 近视值 | |
左偏旁立 | 精确位数 | |
化 | 类型转化 |
夈为古活字
+宩为古活字
+为新造字
+粊为古活字
+䉾为古活字
+
下偏旁米:数相关的大类概念;
夂:复的简写,更是冬的简写,冬通终,故也有所有的数终归都是复数之意;
宀:实的简写;
虍:虚的简写;
比:因为有理数是可以用两个整数之比表示的数;
北:背的简写,因为无理数是不能用两个整数之比表示的数(与之相违背);
为新造字
+𥥪为古活字
+
:米+束组成而成;
束:整的简写;
穴:空的简写。
为新造字
+为新造字
+为新造字
+为新造字
+
上偏旁米:数相关的常用概念;
正:正数的;
贝:负数的,负的简写;
日:奇数的,“奇数”在古代叫“阳数”(阴阳是贯穿于本语言的基本概念);
月:偶数的,“偶数”在古代叫“阴数”(阴阳是贯穿于本语言的基本概念)。
釆为古活字
+为新造字
+为新造字
+为新造字
+为新造字
+
釆:浮+米组成而成;
丿:浮的简写;
立:位的简写。
石:准确的简写;
非:非;
为新造字
+为新造字
+
:整数的简写;
石:准确的简写;
非:非;
丰:非的简写;
贝:负的简写;
为新造字
+为新造字
+为新造字
+为新造字
+
曾:增的简写,曾是一种多层的蒸屉;
员:损/陨的简写,陨本意是“球高从落下”;
彐:寻找,参见彐;
大:数值大的;
小:数值小的。
为新造字
+为新造字
+为新造字
+为新造字
+为新造字
+
:整数的简写;
丨丨:绝对值(源自数学上的符号);
彡:数值修约、简化、近似值的;
大:数值趋大的;
小:数值趋小的。
穴:数值趋零的,𥥪的简写,见𥥪?。
另见:
前者方法有:上取整()、下取整()、截尾取整()、无条件进位();后者方法则有:四舍五入、五舍六入、四舍六入五留双(奇进偶舍)()。
上述方法中,“四舍五入法”最广为人知:如遇0、1、2、3、4则退位,5、6、7、8、9则进位,进退位虽都各为五个数字。但是0其实是不处理值、准确无变化值,这样算来退位实为1、2、3、4这四个,所以从统计学角度讲平均值是偏大的。
而“四舍六入五留双”其实是更精确的规则,所以默认采用之。
> ( -1) 1
> ( 1) 1
> ( 0) 0
> ( 1.1) 1.0
> ( 1.5) 2.0
> ( 1.6) 2.0
> ( 2.1) 2.0
> ( 2.5) 2.0
> ( 2.6) 3.0
> ( 1.1) 2.0
> ( -1.1) -1.0
> ( 1.9) 1.0
> ( -1.9) -2.0
> ( 1.9) 1.0
> ( -1.9) -1.0
为新造字
+
彡:数值修约、简化、近似值的;
另见:
(require ming/racket/base) | package: ming |
composition
composition
: elem + 复数?(各取偏旁得造,复数=实数+虚数;另 + needtofix + 是 + needtofix + 的简写, + needtofix + 通 + needtofix + ,故也有所有的数终归都是复数之意) = complex?
composition
composition
: elem + 有理数?(可以用两个整数之比表示的实数称为有理数(无理数用 + needtofix + 表示(北是背的原形))) = rational?
composition
composition
? : = exact-integer?
composition
composition
composition
? : = inexact-real?
composition
composition
composition
? : elem + 双倍精度浮点数(仿 + needtofix + ,且占用64位内存而得造)
= double-flonum?
composition
: elem + 单倍精度浮点数( + needtofix + 是 + needtofix + 的简写,因其在实现上占用32位内存而得造) = single-flonum?
composition
可? : 可 + + ? = single-flonum-available?
composition
composition
composition
composition
composition
composition
composition
composition
化 : elem + needtofix + 转化为 + needtofix = inexact->exact
composition
化 : elem + needtofix + 转化为 + needtofix = exact->inexact
composition
化 : elem + needtofix + 转化为 + needtofix = real->single-flonum
composition
化 : elem + needtofix + 转化为 + needtofix = real->double-flonum
(require ming/racket/base) | package: ming |
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
?分母 : ? + 分 + 母 = denominator
composition
?粊化 : = rationalize
composition
composition
composition
composition
composition
composition
composition
?整数平方根 : ? + 整 + 数 + 平 + 方 + 根 = integer-sqrt
composition
= integer-sqrt/remainder
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
米化句 : 米 + 化 + 句 = number->string
composition
句化米 : 句 + 化 + 米 = string->number
composition
宩化句 : elem + 将 + needtofix + 转化成 + needtofix + needtofix
= real->decimal-string
Originates from Pairs and Lists and Extends to .
Character | Connotation | Elucidation | Example |
resembles | Has the similar function process as it resembling and the type of output is same as accordingly. | ||
resembles | Has the similar function process as it resembling and the type of output is same as () accordingly. | ||
general subset or cousion | Returns a new list with elements produced from the input list.(Implies the input data and output data are the same type.) | ||
serial subset | Returns a new list with elements serially produced from the input list.(Implies the input data and output data are the same type.) | ||
serial subset of lists | Returns a new list with elements serially produced from the input lists.(Implies the multiple input data and output data are the same type.) | ||
broken subset | Returns a new list with removing some elements from the input list. | ||
broken subset of lists | Returns a new list with removing some elements from the input lists.(Implies the multiple input data and output data are the same type.) | ||
split input list to values | Implies the type of output data is values(並). | ||
split input lists to values | Implies input data is lists and the type of output data is values(並). | ||
same as /入 | Implies the type of input data is function. | ||
product data | Manufactures data and product new one, implies the type of output data is not same as input. | ||
Phrase | - | - | - |
split data to values | |||
Punctuation | - | - | - |
strengthen | Strengthen the process, thus the data of output may become longer, and the type may be changed accordingly. | ||
soften | Soften the process, thus the output data shorter. | ||
list as input | Implies the type of input data is list. | ||
extend prefix | Suffix of / can be considered as an extending explanation of its prefix. | ||
boolean as output | Implies the type of output data is boolean. | ||
Hybrid | - | - | - |
function as input | Implies the type of input data is function. |
Abstractly, we can pair two data together. Integrally, it is called 双. Separately, the position where set the first data is call 阳, the second is call 阴.
Further more, if we put another 双 to 阴 position of the former 双, we get a linked data. Likewise, the linked data can be extended as long as you want. By this way, if we leave 阴 of the ending 双 to be empty(㐅), we get a data called ; if not, we call it .
> (双 1 2) '(1 . 2)
> (双 1 (双 2 (双 3 (双 4 㐅)))) '(1 2 3 4)
> ( 1 2 3 4) '(1 2 3 4)
> (双 1 (双 2 (双 3 4))) '(1 2 3 . 4)
> ( 1 2 3 4) '(1 2 3 . 4)
> ( 1 2 3 '(4)) '(1 2 3 4)
> (阳 '(1 . 2)) 1
> (阴 '(1 . 2)) 2
> (阳 '(1 2 3 4)) 1
> (阴 '(1 2 3 4)) '(2 3 4)
阳+/阴+/阳-/阴-: For the case of functions starting with 阴 or 阳 and following with + or -, + stands for 阳 and - stands for 阴.
+For example, (阴+-- lst) is short for (阴 (阴 (阳 (阴 lst)))).
/: 毌: simplified from 贯, which means append, going through a few objects and connect them together.
> ( 1 2 3 4) '(1 2 3 4)
> ( '(1) '(2) '(3) '(4)) '(1 2 3 4)
> ( '(1) '(2 3 4) '(5 6) '(7)) '(1 2 3 4 5 6 7)
> ( '(a b) 'c) '(a b . c)
> ( '(a b) '(c . d)) '(a b c . d)
> ( '() 'a) 'a
> ( 'a) 'a
> ( 1 2 3 4) '(1 2 3 . 4)
> ( '(1) '(2) '(3) '(4)) '(1 2 3 . 4)
> ( '(1) '(2 3 4) '(5 6) '(7)) '(1 2 3 4 5 6 . 7)
> ( 1 2 3 '(4)) '(1 2 3 4)
> ( '(1) '(2) '(3) '((4))) '(1 2 3 4)
> ( '(1) '(2 22) '(3 33) '((4 44))) '(1 2 22 3 33 4 44)
> ( '(1) '(2 22) '((3 33)) '((4 44))) '(1 2 22 (3 33) 4 44)
> ( '(a b) '(c)) '(a b . c)
> ( '(a b) '((c . d))) '(a b c . d)
> ( '() '(a)) 'a
> ( '(a)) 'a
🐘 𰁦 𢪛
> ( 10) '(0 1 2 3 4 5 6 7 8 9)
> ( 10 20) '(10 11 12 13 14 15 16 17 18 19)
> ( 10 20 2) '(10 12 14 16 18)
> (* 10 20) '(10 11 12 13 14 15 16 17 18 19 20)
> (* 10 20 2) '(10 12 14 16 18 20)
🐘
> (巨 '(a b c d e 3 f g)) 8
🐘
> ( '(a b c d e f g) 2) '(a b)
> (𨚞 '(a b c d e f g) 2) '(f g)
> ( '(a b c d e f g) 2) '(c d e f g)
> ( '(a b c d e f g) 2) '(a b c d e)
> ( '(a b c d e f g) 2)
'(a b)
'(c d e f g)
> ( '(a b c d e f g) 2)
'(a b c d e)
'(f g)
> (/入 '(8 4 a b 1 c d 2 e f g 3 5 9) 米?) '(8 4)
> (𨚞/入 '(8 4 a b 1 c d 2 e f g 3 5 9) 米?) '(3 5 9)
> (? '(a b) '(a b c d e f g)) #t
> (? '(a b z) '(a b c d e f g)) #f
//: 同.
🐘 偅
> (𰂋 '(a b c d) '和) '(a 和 b 和 c 和 d)
> (偏 '((a b) (c d) (e f))) '(a b c d e f)
> ( '(a b c d e d c b a)) '(d c b b a d e c a)
> (重 '(a b c d e d c b a)) 'd
> (𠝤 '(a b c d e d c b a)) '(a b c d e)
> ( '(21 3 888 666 55 77 1000)) '(1000 77 55 666 888 3 21)
> (𠆯 '(21 3 888 666 55 77 1000) <) '(3 21 55 77 666 888 1000)
> (𠆯 '(21 3 888 666 55 77 1000) >) '(1000 888 666 77 55 21 3)
> (𠆯 '("cat" "dog" "chicken" "duck" "fox") 句<?) '("cat" "chicken" "dog" "duck" "fox")
> (𠆯 '("cat" "dog" "chicken" "duck" "fox") 句>?) '("fox" "duck" "dog" "chicken" "cat")
> ( 'c '(a b c d e f)) '(c d e f)
> ( 'c '((a b) (c d) (e f))) '(c d)
> (~ 'c '(a b c d e c f)) '(a b d e c f)
> (^ '(c e) '(a b c d e c f)) '(a b d f)
> ( 米? '(a b 1 c d 3 e 9 f)) 1
> ( 米? '(a b 1 c d 3 e 9 f)) '(1 3 9)
> ( 米? '(a b 1 c d 3 e 9 f)) '(1 c d 3 e 9 f)
> ( 米? '((a b) (1 d) (j k) (8 f))) '(1 d)
> ( 米? '(a b 1 c d 3 e 9 f)) '(a b c d e f)
> (~ 米? '(a b 1 c d 3 e 9 f)) '(a b c d 3 e 9 f)
> ( 行示 ( 2 4 6 8))
2
4
6
8
> ( '(1 2 3 4)) '(2 3 4 5)
> ( + '(1 2 3 4) '(100 200 300 400)) '(101 202 303 404)
> ( ? '(1 2 -3 4)) #f
> ( + '(1 2 3 4) '(100 200 300 400)) 404
> ( ? '(1 2 -3 4)) #f
> ( + '(1 2 3 4) '(100 200 300 400)) 101
> ( + 0 '(1 2 -3 4)) 4
> ( 双 '() '(1 2 -3 4)) '(4 -3 2 1)
> (右 双 '() '(1 2 -3 4)) '(1 2 -3 4)
> ( (入 (x) (并 (? x) ( x))) '(-2 -1 0 1 2)) '(2 3)
> ( 化 '(#(1) #(2 3) #(4))) '(1 2 3 4)
> ( char->integer '(#\a #\y #\b #\k #\c #\j #\d)) #\y
> ( char->integer '(#\a #\y #\b #\k #\c #\j #\d)) #\a
> ( 阳 '((3 pears) (1 banana) (2 apples))) '(3 pears)
> ( 阳 '((3 pears) (1 banana) (2 apples))) '(1 banana)
(require ming/racket/base) | package: ming |
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
: 弓 + = build-list
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
(require ming/racket/list) | package: ming |
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
攸/入 : 攸 + / + 入 = list-update
composition
composition
: 弓 + 入 = index-where
composition
弓* : 弓 + * = indexes-of
composition
* : + * = indexes-where
composition
composition
𨚞 : 右 + 阝 = take-right
composition
composition
: 右 + 刂 = drop-right
composition
composition
𨚞/入 : 𨚞 + / + 入 = takef-right
composition
composition
/入 : + / + 入 = dropf-right
composition
composition
: 右 + 分 = split-at-right
composition
composition
/入 : + / + 入 = splitf-at-right
composition
? : + ? = list-prefix?
composition
左 : 左 + 同 + = take-common-prefix
composition
左 : 左 + 同 + = drop-common-prefix
composition
左 : 左 + 同 + = split-common-prefix
composition
composition
𰂋 : 亻 + 间 = add-between
composition
composition
composition
重 : 重 = check-duplicates
composition
𠝤 : 重 + 刂 = remove-duplicates
composition
: + 刂 = filter-not
composition
composition
composition
: + = filter-map
composition
: + = append-map
composition
composition
* : + * = inclusive-range
composition
/组合 : + / + 组合 = combinations
composition
/排列组合 : + / + 排列组合 = permutations
composition
序列/组合 : 序列 + / + 组合 = in-combinations
composition
序列/排列组合 : 序列 + / + 排列组合 = in-permutations
composition
composition
composition
composition
/笛卡尔积 : + / + 笛卡尔积 = cartesian-product
composition
Racket’s Procedures is especially called 禾 in ming-lang.
(require ming/racket/base) | package: ming |
composition
composition
: 入 + 肖 = case-lambda
composition
composition
composition
composition
禾? : 禾 + ? = procedure?
composition
composition
composition
: 禾 + 名 + 攵 = procedure-rename
(require ming/racket/function) | package: ming |
composition
composition
? : + ? = equal-always?
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
山? : 山 + ? = immutable?
composition
报参错 : 报 + 参 + 错 = raise-argument-error
1.1 Lisp and its parenthsis |
1.2 Chineseoid characters |
1.3 Character implications |
ref to: http://www.yanying.wang/SOICOL
Lisp, as an ancient programming language, when I was learning it with inherent ideas from modern programming languages such as Ruby, I noticed there are a few distinctions. Among them, The most prominent one is the form.
Operation | Ruby code | Racket code |
number addition | 1+2+3 | (+ 1 2 3) |
create array | (vector 1 2 3) | |
create hash | ||
create array of a range of numbers | Array(1..5) | (build-list 5 values) |
create array of duplication elements | Array.new(3, 1) | (make-list 3 1) |
By the examples above, we can see in Ruby, different operations are wrote in distinctive forms, but in Racket they are in same form: elements in one parenthesis. This each other resembled form of LISP impedes people differentiate them on a glimpse, therefore, the meaning of operations are more blamed on the function names(first word of elements in parenthesis).
In conclusion, the function names of LISP take more responsibilities to annotate various operations than modern PLs. The more informations that function names show to us, the better we can distinguish them and understand the purpose and usage of them.
Compare to English, of which the writing is based on the pronounciation of speaking, Chinese contrarily emphasize its writing more than speaking, which has actually developed a way to write related objects and concepts, we call it LiuShu(六书).
With the fact that chinese characters are just the implementation of using LiuShu for the communication of human, what I am doing here is using it to invent and design lots of chinese resembled characters, where we draw the phrase chineseoid characters, which especially is also called zi, means looking like chinese characters but can not be recognized by most Chinese people.
At last, we use those characters instead of common English words for the concepts of Lisp and even the whole programming language world to make human interact better with it.
Ming code | Racket code |
(build-list 10 values) | |
( 10) | (range 10) |
As chart shown above, the keywords of Ming are much short in length, and in forms the complex characters are usually constituted by other simpler characters, and those simpler characters are usually used for related function names as well.
Further more, the connotations behind the characters work the same way, they are related to each other and complex concepts are broke to simple concepts as well.
Most importantly, the chineseoid characters implemented here also have the ability to imply to human about the arguments and results of functions, check Naming Rules for more.
Since the chineseoid chracters are much complicated than general western characters, there are few terminologies we need to know in advance: radical, component, part(check the wiktionary page for details).
Simply put it, phrase is composed by more than one characters, character is composed by more than on parts. For the parts of an specific character, only one of them can be counted as radical, which usually is another standalone character that provides the basic meaning for the specific character, and the other one can be counted as component, which usually implies the difference(type of input, type of output, etc.) between the meaning of radical and the specific character.
Take example of the procedure 伄, this character is composed of two parts: 亻 as component and 弔 as radical. By composition, we can deduce that this procedure has a similar usage as 弔 since it is the radical. And the 亻 additionally means the type of output data is list(read Naming Rules for more).
2.1 Fonts and Input method |
2.2 Code highlight for Emacs editor |
2.3 GGFSM |
to show chineseoid characters, install cangjie font to your OS;
to input chineseoid characters, install rime input method and use asdfzma scheme;(check rime_custom for an out-of-the-box config)
(use-package racket-mode :load-path "your-cloned-code-dir/racket-mode-for-ming" )
As a demonstation, GGFSM is a website draw gua graph for stocks, most code of this project are wrote in the Ming-Lang flavor: +https://github.com/yanyingwang/ggfsm
另见名扩展库:句
见Naming Rules,有:
规则 | 指示 | 含义 | 举例 |
下偏旁句 | 指示出参 | 出参是句结构 | |
右偏旁句 | 指示出参 | 出参是句结构 | |
左偏旁句 | 指示入参 | 入参是句结构 |
句为活用字
+为新造字
+为新造字 +
为新造字
+为新造字
为新造字
+𰅡为古活字
+
扌:“!”的意思;
另见:
为新造字
+为新造字
+为新造字
+为新造字 +
> ( '("鹅" "鹅" "鹅" "," "曲" "项" "向" "天" "歌")) "鹅 鹅 鹅 , 曲 项 向 天 歌"
> ( '("鹅" "鹅" "鹅" "," "曲" "项" "向" "天" "歌") "") "鹅鹅鹅,曲项向天歌"
> ( '("鹅" "鹅" "鹅" "," "曲" "项" "向" "天" "歌") "-") "鹅-鹅-鹅-,-曲-项-向-天-歌"
> ( "鹅鹅鹅,曲项向天歌") '("鹅鹅鹅,曲项向天歌")
> ( "鹅鹅鹅,曲项向天歌" "") '("" "鹅" "鹅" "鹅" "," "曲" "项" "向" "天" "歌" "")
> ( "鹅鹅鹅,曲项向天歌" ",") '("鹅鹅鹅" "曲项向天歌")
> ( "鹅-鹅-鹅-曲-项-向-天-歌" "-") '("鹅" "鹅" "鹅" "曲" "项" "向" "天" "歌")
> ( '(#\鹅 #\鹅 #\鹅 #\, #\曲 #\项 #\向 #\天 #\歌 #\。)) "鹅鹅鹅,曲项向天歌。"
> ( "鹅鹅鹅,曲项向天歌。") '(#\鹅 #\鹅 #\鹅 #\, #\曲 #\项 #\向 #\天 #\歌 #\。)
为新造字
+为新造字
+为新造字 +
戈:本意是“兵器”,引申为“修改、替换”之意;
匕:本意是“匕首”,引申为“修剪、删除”之意;
穴:空的简写;
上下结构的丷+匕:修剪起始处和结尾处;
上下结构的穴+一:将相连的多个空格单一化成一个。
为新造字
+为新造字
+
本:本意是“树根”,在此引申为“起始、开头”之意;
末:本意是“树梢”,在此引申为“结尾、末尾”之意;
干:本意是“枝干”,在此引申为“中间、包含”之意;
为新造字
+为新造字
+为新造字 +
与:写的简写;
composition
composition
composition
: elem + 构造内容是若干个相同元素的 + needtofix = make-string
composition
化 : elem + 把 + needtofix + 转变为 + needtofix
= string->immutable-string
composition
: = string-length
composition
: = string-ref
composition
: elem + 直接修改原始数据第N处字(从0算起)为某字 = string-set!
composition
composition
化 : elem + 把 + needtofix + 转化为 + needtofix = string-copy
composition
/以 : elem + 从第N处字(从0算起)开始做覆盖(以另一个句的 + needtofix + 结果为内容)
= string-copy!
composition
𰅡 : = string-fill!
composition
: elem + 把很多句连成一个 + needtofix = string-append
composition
: elem + 把很多句连成一个 + needtofix = string-append-immutable
composition
: elem + 句化字:把 + needtofix + 转化为 + needtofix + (由 + needtofix + 组成) = string->list
composition
: elem + 字化句:把 + needtofix + (由 + needtofix + 组成)转化为 + needtofix = list->string
composition
: elem + 构造内容是一系列序数转化成 + needtofix + 所组成的 + needtofix
= build-string
composition
composition
composition
composition
composition
composition
句ci=? : 句 + c + i + = + ? = string-ci=?
composition
句ci<? : 句 + c + i + < + ? = string-ci<?
composition
句ci<=? : 句 + c + i + < + = + ? = string-ci<=?
composition
句ci>? : 句 + c + i + > + ? = string-ci>?
composition
句ci>=? : 句 + c + i + > + = + ? = string-ci>=?
composition
: elem + 将句大写化 = string-upcase
composition
: elem + 将句小写化 = string-downcase
composition
: elem + 将句中单词首字母大写化其余小写化 = string-titlecase
composition
* : elem + 将句中单词做CaseFolding处理 = string-foldcase
(require ming/racket/base) | package: ming |
(require ming/racket/string) | package: ming |
composition
: elem + 类 + needtofix + ,不过最后一个句是 + needtofix
= string-append*
composition
: = string-join
composition
: = string-split
composition
composition
: = string-replace
composition
: elem + 修剪句 = string-trim
composition
? : elem + 非空句? = non-empty-string?
composition
? : elem + 某句是否是某句中间的一部分 = string-contains?
composition
? : elem + 某句是否是某句起头的一部分 = string-prefix?
composition
? : elem + 某句是否是某句末尾的一部分 = string-suffix?
“勺”(symbols)是一种跟句类似的数据结构,但是它更广泛的在Racket语言的内部实现中被使用。
见Naming Rules中关于化和土的条目。
勺为古活字
+为新造字
+为新造字 +
勹:工厂、容器、外壳;
一:数据内容;
罒:目;
曰:不可读的(仿罒得造);
由:自由的;
勺:因为外形和勾、句相近,在此借用为表示勺是和它们相近的一种数据结构;
(require ming/racket/base) | package: ming |
composition
composition
? : = symbol-interned?
composition
? : = symbol-unreadable?
composition
勺化句 : = symbol->string
composition
句化勺 : = string->symbol
composition
composition
composition
(require ming/racket/symbol) | package: ming |
composition
勺化 : = symbol->immutable-string
“”(syntax object)是Racket编程语言构建其语言的基石。
+“”其实就是通俗意义上的“代码”,而“代码”究其本质而言是封装了“词法信息”和“位置信息”的“数据”。“卩”(identifier)可以看作是“”的极简单特例。
卩为古活字
+为新造字
+
卩:节的古字,本意是“瑞信,古代出使等用作凭证之物”,引申为“语法,包含了上下文信息的数据”;
厂:工厂,容器,内容。
为新造字
+为新造字
+为新造字
+为新造字
+为新造字
+
止:本意是“足”,在此为“地址”的意思;
:第几列,仿经字得造;
:第几行,仿纬字得造;
:第几位;
为新造字
+为新造字
+为新造字
+为新造字
+
:+解各取偏旁得造;
:+各取偏旁得造;
:+文各取偏旁得造;
:文+各取偏旁得造;
(require ming/racket/base) | package: ming |
composition
composition
composition
卩? : 卩 + ? = identifier?
composition
: elem + 地址,比如是文件路径 = syntax-source
composition
: elem + 所在文件的具体哪一行(纬是横向的,参见“纬线”一词) = syntax-line
composition
: elem + 所在文件的具体哪一列(经是竖向的,参见“经线”一词) = syntax-column
composition
: elem + 所在文件的第几位 = syntax-position
composition
: elem + 所占用的长度(从0算起) = syntax-span
composition
: ? + s + y + n + t + a + x + - + o + r + i + g + i + n + a + l + ? = syntax-original?
composition
?司 : ? + + 司 = syntax-source-module
composition
composition
: elem + 化 = syntax->list
composition
: elem + 化文(将转化成文(原料数据)) = syntax->datum
composition
: elem + 文化 = datum->syntax
composition
: ? + s + y + n + t + a + x + - + b + i + n + d + i + n + g + - + s + e + t + ? = syntax-binding-set?
composition
: ? + s + y + n + t + a + x + - + b + i + n + d + i + n + g + - + s + e + t = syntax-binding-set
composition
: ? + s + y + n + t + a + x + - + b + i + n + d + i + n + g + - + s + e + t + - + > + s + y + n + t + a + x = syntax-binding-set->syntax
composition
: ? + s + y + n + t + a + x + - + b + i + n + d + i + n + g + - + s + e + t + - + e + x + t + e + n + d = syntax-binding-set-extend
composition
: ? + d + a + t + u + m + - + i + n + t + e + r + n + - + l + i + t + e + r + a + l = datum-intern-literal
composition
: ? + s + y + n + t + a + x + - + s + h + i + f + t + - + p + h + a + s + e + - + l + e + v + e + l = syntax-shift-phase-level
composition
: ? + g + e + n + e + r + a + t + e + - + t + e + m + p + o + r + a + r + i + e + s = generate-temporaries
composition
: ? + i + d + e + n + t + i + f + i + e + r + - + p + r + u + n + e + - + l + e + x + i + c + a + l + - + c + o + n + t + e + x + t = identifier-prune-lexical-context
composition
: ? + i + d + e + n + t + i + f + i + e + r + - + p + r + u + n + e + - + t + o + - + s + o + u + r + c + e + - + m + o + d + u + l + e = identifier-prune-to-source-module
composition
: ? + s + y + n + t + a + x + - + r + e + c + e + r + t + i + f + y = syntax-recertify
composition
: ? + s + y + n + t + a + x + - + d + e + b + u + g + - + i + n + f + o = syntax-debug-info
Racket’s value is especially called 𰅰 in ming-lang.
Racket’s Multiple Values is especially called 並 in ming-lang.
(require ming/racket/base) | package: ming |
composition
composition
𡌶0 : 𡌶 + 0 = call-with-values
composition
: elem + needtofix + + + needtofix = define-values
composition
: elem + needtofix + + + needtofix = let-values
Originates from Vectors and Extends to .
To extend Naming Rules, specifically there are:
Character | Connotation | Elucidation | Example |
direct modification | directly modify the orignal data and return void | ||
Phrase | – | – | – |
as input | implies the type of input data is | ||
minor type convertion | implies slightly convert the type of input data, i.e. from mutable to immutable. | ||
type convertion |
> ( '#(a b c d e f) 2) '#(a b)
> ( '#(a b c d e f) 2) '#(c d e f)
> ( '#(a b c d e f) 2)
'#(a b)
'#(c d e f)
> ( '#(a b c d e f) 0 2) '#(a b)
🐘
(require ming/racket/base) | package: ming |
composition
composition
composition
: 三 + = make-vector
composition
: 山 + = vector-immutable
composition
巨 : + 巨 = vector-length
composition
弔 : + 弔 = vector-ref
composition
: + = vector-set!
composition
化 : + 化 + = vector->list
composition
化 : + 化 + = list->vector
composition
化 : + 化 = vector->immutable-vector
composition
𰅡 : + 𰅡 = vector-fill!
composition
𢪛/以 : 𢪛 + / + 以 = vector-copy!
composition
化並 : + 化 + 並 = vector->values
composition
: 弓 + = build-vector
(require ming/racket/vector) | package: ming |
composition
? : + ? = vector-empty?
composition
𢪛 : + 𢪛 = vector-set*!
composition
: + = vector-map
composition
: + = vector-map!
composition
: 毌 + = vector-append
composition
: + = vector-take
composition
𨚞 : + 𨚞 = vector-take-right
composition
: + = vector-drop
composition
: + = vector-drop-right
composition
: + = vector-split-at
composition
: + = vector-split-at-right
composition
: + = vector-copy
composition
: + = vector-filter
composition
: + = vector-filter-not
composition
巨 : + + 巨 = vector-count
composition
: + + = vector-argmin
composition
: + + = vector-argmax
composition
弓 : + 弓 = vector-member
composition
弓/ : 弓 + / + = vector-memv
composition
弓/ : 弓 + / + = vector-memq
composition
𠆯 : + 𠆯 = vector-sort
composition
: + = vector-sort!
3.1 Characters |
3.2 Punctuations |
3.3 Phrases |
3.4 Hybrids |
You may need to read Character implications first.
Part | Connotation | Elucidation | Example |
亻 | general subset | The type of output data is same as input, content is part of input. | |
阝 | serial subset | The type of output data is same as input, content is a serial part of input. | |
刂 | broken subset | The type of output data is same as input, content is almost same, except some elements are removed. | |
彐 | find | Simplifies from 寻, which means find. | |
戈 | substitute | Means substitute. | |
土 | produce | Means create, build, produce. | 垎 |
扌 | Same as usage of ! | Means directly modify the original data instead of creating new one, thus the output is void. | |
攵 | modify | Means modify value corresponding to specified index, thus inputs are index number and expected value. | |
三 | duplicated elements | Means three, especially means duplicated elments. | |
弓 | index | Means index(ref to 弓), especially means a range of numbers. | |
弔 | value of index | Means Returns corresponding vaule of index, thus the type of input data is ?. | |
毌 | append | Simplifies from 贯, which means append. | |
穴 | empty | Simplifies from 空, means empty. | |
非 | not | Means not. | |
巨 | length | Means return the length. | |
米 | number | Simplifies from 数, which means number. |
Rule | Connotation | Elucidation | Example |
suffix ? | boolean as output | Is or not is. the output is boolean. | 空? 𥥪? |
suffix ! | same as usage of 攵 | Means directly modify the original data instead of creating new one, thus the output is void. | ! 𠛮! |
suffix ~ | softly | Immediately returns result once meet the request. | |
suffix ^ | list as input | The type of input data is list | |
include / | Of | output is determinated by prefix of / | /组合 /分组 |
Rule | Connotation | Elucidation | Example |
suffix 分 | splits data | Splits input data, and output them in values type. | 分、𨚞分、䢼分、分、分 |
suffix 化 | attribute convert | Convert attributes of data, such as from mutable to immutable. | |
insert 化 | type convert | Convert types of data. |
Rule | Connotation | Elucidation | Example |
suffix 𰅡 | directly attribute convert | Directly convert attribute of data with modifying the orignal data. | |
include /入 | Function as input | Means Type of input data is procedure. |
另见名扩展库:米
数被简写为米偏旁,以便构造单字来表示跟其相关的概念 +
现代汉语中“数”有关的概念和词汇很多都来对英文的直接翻译,并且大都使用词组来构造;
但我认为仅单个汉字所能包含的意义很多时候就已经比英文中的单词多了,进而还构造使用词组进行表达就会显得“含意过剩”,反而显得啰唆,含意不清;
故此,本语言对关于“数”的例程做了简化:剔除多余无效的表意偏旁,代之以简洁有效的偏旁组合成单字进行表达。
见Naming Rules,有:
规则 | 含义 | 举例 |
下偏旁米 | 大类概念 | |
上偏旁米 | 常用概念 | |
整体性结构的米 | 常用概念 | |
偏旁石 | “准确”相关 | |
左偏旁米 | 内部实现、运算或转化例程(进参、出参都是数字) | |
偏旁 | 整数相关 | |
偏旁彡 | 近视值 | |
左偏旁立 | 精确位数 | |
化 | 类型转化 |
夈为古活字
+宩为古活字
+为新造字
+粊为古活字
+䉾为古活字
+
下偏旁米:数相关的大类概念;
夂:复的简写,更是冬的简写,冬通终,故也有所有的数终归都是复数之意;
宀:实的简写;
虍:虚的简写;
比:因为有理数是可以用两个整数之比表示的数;
北:背的简写,因为无理数是不能用两个整数之比表示的数(与之相违背);
为新造字
+𥥪为古活字
+
:米+束组成而成;
束:整的简写;
穴:空的简写。
为新造字
+为新造字
+为新造字
+为新造字
+
上偏旁米:数相关的常用概念;
正:正数的;
贝:负数的,负的简写;
日:奇数的,“奇数”在古代叫“阳数”(阴阳是贯穿于本语言的基本概念);
月:偶数的,“偶数”在古代叫“阴数”(阴阳是贯穿于本语言的基本概念)。
釆为古活字
+为新造字
+为新造字
+为新造字
+为新造字
+
釆:浮+米组成而成;
丿:浮的简写;
立:位的简写。
石:准确的简写;
非:非;
为新造字
+为新造字
+
:整数的简写;
石:准确的简写;
非:非;
丰:非的简写;
贝:负的简写;
为新造字
+为新造字
+为新造字
+为新造字
+
曾:增的简写,曾是一种多层的蒸屉;
员:损/陨的简写,陨本意是“球高从落下”;
彐:寻找,参见彐;
大:数值大的;
小:数值小的。
为新造字
+为新造字
+为新造字
+为新造字
+为新造字
+
:整数的简写;
丨丨:绝对值(源自数学上的符号);
彡:数值修约、简化、近似值的;
大:数值趋大的;
小:数值趋小的。
穴:数值趋零的,𥥪的简写,见𥥪?。
另见:
前者方法有:上取整()、下取整()、截尾取整()、无条件进位();后者方法则有:四舍五入、五舍六入、四舍六入五留双(奇进偶舍)()。
上述方法中,“四舍五入法”最广为人知:如遇0、1、2、3、4则退位,5、6、7、8、9则进位,进退位虽都各为五个数字。但是0其实是不处理值、准确无变化值,这样算来退位实为1、2、3、4这四个,所以从统计学角度讲平均值是偏大的。
而“四舍六入五留双”其实是更精确的规则,所以默认采用之。
> ( -1) 1
> ( 1) 1
> ( 0) 0
> ( 1.1) 1.0
> ( 1.5) 2.0
> ( 1.6) 2.0
> ( 2.1) 2.0
> ( 2.5) 2.0
> ( 2.6) 3.0
> ( 1.1) 2.0
> ( -1.1) -1.0
> ( 1.9) 1.0
> ( -1.9) -2.0
> ( 1.9) 1.0
> ( -1.9) -1.0
为新造字
+
彡:数值修约、简化、近似值的;
另见:
(require ming/racket/base) | package: ming |
composition
composition
: elem + 复数?(各取偏旁得造,复数=实数+虚数;另 + needtofix + 是 + needtofix + 的简写, + needtofix + 通 + needtofix + ,故也有所有的数终归都是复数之意) = complex?
composition
composition
: elem + 有理数?(可以用两个整数之比表示的实数称为有理数(无理数用 + needtofix + 表示(北是背的原形))) = rational?
composition
composition
? : = exact-integer?
composition
composition
composition
? : = inexact-real?
composition
composition
composition
? : elem + 双倍精度浮点数(仿 + needtofix + ,且占用64位内存而得造)
= double-flonum?
composition
: elem + 单倍精度浮点数( + needtofix + 是 + needtofix + 的简写,因其在实现上占用32位内存而得造) = single-flonum?
composition
可? : 可 + + ? = single-flonum-available?
composition
composition
composition
composition
composition
composition
composition
composition
化 : elem + needtofix + 转化为 + needtofix = inexact->exact
composition
化 : elem + needtofix + 转化为 + needtofix = exact->inexact
composition
化 : elem + needtofix + 转化为 + needtofix = real->single-flonum
composition
化 : elem + needtofix + 转化为 + needtofix = real->double-flonum
(require ming/racket/base) | package: ming |
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
?分母 : ? + 分 + 母 = denominator
composition
?粊化 : = rationalize
composition
composition
composition
composition
composition
composition
composition
?整数平方根 : ? + 整 + 数 + 平 + 方 + 根 = integer-sqrt
composition
= integer-sqrt/remainder
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
米化句 : 米 + 化 + 句 = number->string
composition
句化米 : 句 + 化 + 米 = string->number
composition
宩化句 : elem + 将 + needtofix + 转化成 + needtofix + needtofix
= real->decimal-string
Originates from Pairs and Lists and Extends to .
Character | Connotation | Elucidation | Example |
resembles | Has the similar function process as it resembling and the type of output is same as accordingly. | ||
resembles | Has the similar function process as it resembling and the type of output is same as () accordingly. | ||
general subset or cousion | Returns a new list with elements produced from the input list.(Implies the input data and output data are the same type.) | ||
serial subset | Returns a new list with elements serially produced from the input list.(Implies the input data and output data are the same type.) | ||
serial subset of lists | Returns a new list with elements serially produced from the input lists.(Implies the multiple input data and output data are the same type.) | ||
broken subset | Returns a new list with removing some elements from the input list. | ||
broken subset of lists | Returns a new list with removing some elements from the input lists.(Implies the multiple input data and output data are the same type.) | ||
split input list to values | Implies the type of output data is values(並). | ||
split input lists to values | Implies input data is lists and the type of output data is values(並). | ||
same as /入 | Implies the type of input data is function. | ||
product data | Manufactures data and product new one, implies the type of output data is not same as input. | ||
Phrase | - | - | - |
split data to values | |||
Punctuation | - | - | - |
strengthen | Strengthen the process, thus the data of output may become longer, and the type may be changed accordingly. | ||
soften | Soften the process, thus the output data shorter. | ||
list as input | Implies the type of input data is list. | ||
extend prefix | Suffix of / can be considered as an extending explanation of its prefix. | ||
boolean as output | Implies the type of output data is boolean. | ||
Hybrid | - | - | - |
function as input | Implies the type of input data is function. |
Abstractly, we can pair two data together. Integrally, it is called 双. Separately, the position where set the first data is call 阳, the second is call 阴.
Further more, if we put another 双 to 阴 position of the former 双, we get a linked data. Likewise, the linked data can be extended as long as you want. By this way, if we leave 阴 of the ending 双 to be empty(㐅), we get a data called ; if not, we call it .
> (双 1 2) '(1 . 2)
> (双 1 (双 2 (双 3 (双 4 㐅)))) '(1 2 3 4)
> ( 1 2 3 4) '(1 2 3 4)
> (双 1 (双 2 (双 3 4))) '(1 2 3 . 4)
> ( 1 2 3 4) '(1 2 3 . 4)
> ( 1 2 3 '(4)) '(1 2 3 4)
> (阳 '(1 . 2)) 1
> (阴 '(1 . 2)) 2
> (阳 '(1 2 3 4)) 1
> (阴 '(1 2 3 4)) '(2 3 4)
阳+/阴+/阳-/阴-: For the case of functions starting with 阴 or 阳 and following with + or -, + stands for 阳 and - stands for 阴.
+For example, (阴+-- lst) is short for (阴 (阴 (阳 (阴 lst)))).
/: 毌: simplified from 贯, which means append, going through a few objects and connect them together.
> ( 1 2 3 4) '(1 2 3 4)
> ( '(1) '(2) '(3) '(4)) '(1 2 3 4)
> ( '(1) '(2 3 4) '(5 6) '(7)) '(1 2 3 4 5 6 7)
> ( '(a b) 'c) '(a b . c)
> ( '(a b) '(c . d)) '(a b c . d)
> ( '() 'a) 'a
> ( 'a) 'a
> ( 1 2 3 4) '(1 2 3 . 4)
> ( '(1) '(2) '(3) '(4)) '(1 2 3 . 4)
> ( '(1) '(2 3 4) '(5 6) '(7)) '(1 2 3 4 5 6 . 7)
> ( 1 2 3 '(4)) '(1 2 3 4)
> ( '(1) '(2) '(3) '((4))) '(1 2 3 4)
> ( '(1) '(2 22) '(3 33) '((4 44))) '(1 2 22 3 33 4 44)
> ( '(1) '(2 22) '((3 33)) '((4 44))) '(1 2 22 (3 33) 4 44)
> ( '(a b) '(c)) '(a b . c)
> ( '(a b) '((c . d))) '(a b c . d)
> ( '() '(a)) 'a
> ( '(a)) 'a
🐘 𰁦 𢪛
> ( 10) '(0 1 2 3 4 5 6 7 8 9)
> ( 10 20) '(10 11 12 13 14 15 16 17 18 19)
> ( 10 20 2) '(10 12 14 16 18)
> (* 10 20) '(10 11 12 13 14 15 16 17 18 19 20)
> (* 10 20 2) '(10 12 14 16 18 20)
🐘
> (巨 '(a b c d e 3 f g)) 8
🐘
> ( '(a b c d e f g) 2) '(a b)
> (𨚞 '(a b c d e f g) 2) '(f g)
> ( '(a b c d e f g) 2) '(c d e f g)
> ( '(a b c d e f g) 2) '(a b c d e)
> ( '(a b c d e f g) 2)
'(a b)
'(c d e f g)
> ( '(a b c d e f g) 2)
'(a b c d e)
'(f g)
> (/入 '(8 4 a b 1 c d 2 e f g 3 5 9) 米?) '(8 4)
> (𨚞/入 '(8 4 a b 1 c d 2 e f g 3 5 9) 米?) '(3 5 9)
> (? '(a b) '(a b c d e f g)) #t
> (? '(a b z) '(a b c d e f g)) #f
//: 同.
🐘 偅
> (𰂋 '(a b c d) '和) '(a 和 b 和 c 和 d)
> (偏 '((a b) (c d) (e f))) '(a b c d e f)
> ( '(a b c d e d c b a)) '(a b d b e a d c c)
> (重 '(a b c d e d c b a)) 'd
> (𠝤 '(a b c d e d c b a)) '(a b c d e)
> ( '(21 3 888 666 55 77 1000)) '(1000 77 55 666 888 3 21)
> (𠆯 '(21 3 888 666 55 77 1000) <) '(3 21 55 77 666 888 1000)
> (𠆯 '(21 3 888 666 55 77 1000) >) '(1000 888 666 77 55 21 3)
> (𠆯 '("cat" "dog" "chicken" "duck" "fox") 句<?) '("cat" "chicken" "dog" "duck" "fox")
> (𠆯 '("cat" "dog" "chicken" "duck" "fox") 句>?) '("fox" "duck" "dog" "chicken" "cat")
> ( 'c '(a b c d e f)) '(c d e f)
> ( 'c '((a b) (c d) (e f))) '(c d)
> (~ 'c '(a b c d e c f)) '(a b d e c f)
> (^ '(c e) '(a b c d e c f)) '(a b d f)
> ( 米? '(a b 1 c d 3 e 9 f)) 1
> ( 米? '(a b 1 c d 3 e 9 f)) '(1 3 9)
> ( 米? '(a b 1 c d 3 e 9 f)) '(1 c d 3 e 9 f)
> ( 米? '((a b) (1 d) (j k) (8 f))) '(1 d)
> ( 米? '(a b 1 c d 3 e 9 f)) '(a b c d e f)
> (~ 米? '(a b 1 c d 3 e 9 f)) '(a b c d 3 e 9 f)
> ( 行示 ( 2 4 6 8))
2
4
6
8
> ( '(1 2 3 4)) '(2 3 4 5)
> ( + '(1 2 3 4) '(100 200 300 400)) '(101 202 303 404)
> ( ? '(1 2 -3 4)) #f
> ( + '(1 2 3 4) '(100 200 300 400)) 404
> ( ? '(1 2 -3 4)) #f
> ( + '(1 2 3 4) '(100 200 300 400)) 101
> ( + 0 '(1 2 -3 4)) 4
> ( 双 '() '(1 2 -3 4)) '(4 -3 2 1)
> (右 双 '() '(1 2 -3 4)) '(1 2 -3 4)
> ( (入 (x) (并 (? x) ( x))) '(-2 -1 0 1 2)) '(2 3)
> ( 化 '(#(1) #(2 3) #(4))) '(1 2 3 4)
> ( char->integer '(#\a #\y #\b #\k #\c #\j #\d)) #\y
> ( char->integer '(#\a #\y #\b #\k #\c #\j #\d)) #\a
> ( 阳 '((3 pears) (1 banana) (2 apples))) '(3 pears)
> ( 阳 '((3 pears) (1 banana) (2 apples))) '(1 banana)
(require ming/racket/base) | package: ming |
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
: 弓 + = build-list
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
(require ming/racket/list) | package: ming |
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
攸/入 : 攸 + / + 入 = list-update
composition
composition
: 弓 + 入 = index-where
composition
弓* : 弓 + * = indexes-of
composition
* : + * = indexes-where
composition
composition
𨚞 : 右 + 阝 = take-right
composition
composition
: 右 + 刂 = drop-right
composition
composition
𨚞/入 : 𨚞 + / + 入 = takef-right
composition
composition
/入 : + / + 入 = dropf-right
composition
composition
: 右 + 分 = split-at-right
composition
composition
/入 : + / + 入 = splitf-at-right
composition
? : + ? = list-prefix?
composition
左 : 左 + 同 + = take-common-prefix
composition
左 : 左 + 同 + = drop-common-prefix
composition
左 : 左 + 同 + = split-common-prefix
composition
composition
𰂋 : 亻 + 间 = add-between
composition
composition
composition
重 : 重 = check-duplicates
composition
𠝤 : 重 + 刂 = remove-duplicates
composition
: + 刂 = filter-not
composition
composition
composition
: + = filter-map
composition
: + = append-map
composition
composition
* : + * = inclusive-range
composition
/组合 : + / + 组合 = combinations
composition
/排列组合 : + / + 排列组合 = permutations
composition
序列/组合 : 序列 + / + 组合 = in-combinations
composition
序列/排列组合 : 序列 + / + 排列组合 = in-permutations
composition
composition
composition
composition
/笛卡尔积 : + / + 笛卡尔积 = cartesian-product
composition
Racket’s Procedures is especially called 禾 in ming-lang.
(require ming/racket/base) | package: ming |
composition
composition
: 入 + 肖 = case-lambda
composition
composition
composition
composition
禾? : 禾 + ? = procedure?
composition
composition
composition
: 禾 + 名 + 攵 = procedure-rename
(require ming/racket/function) | package: ming |
composition
composition
? : + ? = equal-always?
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
composition
山? : 山 + ? = immutable?
composition
报参错 : 报 + 参 + 错 = raise-argument-error
1.1 Lisp and its parenthsis |
1.2 Chineseoid characters |
1.3 Character implications |
ref to: http://www.yanying.wang/SOICOL
Lisp, as an ancient programming language, when I was learning it with inherent ideas from modern programming languages such as Ruby, I noticed there are a few distinctions. Among them, The most prominent one is the form.
Operation | Ruby code | Racket code |
number addition | 1+2+3 | (+ 1 2 3) |
create array | (vector 1 2 3) | |
create hash | ||
create array of a range of numbers | Array(1..5) | (build-list 5 values) |
create array of duplication elements | Array.new(3, 1) | (make-list 3 1) |
By the examples above, we can see in Ruby, different operations are wrote in distinctive forms, but in Racket they are in same form: elements in one parenthesis. This each other resembled form of LISP impedes people differentiate them on a glimpse, therefore, the meaning of operations are more blamed on the function names(first word of elements in parenthesis).
In conclusion, the function names of LISP take more responsibilities to annotate various operations than modern PLs. The more informations that function names show to us, the better we can distinguish them and understand the purpose and usage of them.
Compare to English, of which the writing is based on the pronounciation of speaking, Chinese contrarily emphasize its writing more than speaking, which has actually developed a way to write related objects and concepts, we call it LiuShu(六书).
With the fact that chinese characters are just the implementation of using LiuShu for the communication of human, what I am doing here is using it to invent and design lots of chinese resembled characters, where we draw the phrase chineseoid characters, which especially is also called zi, means looking like chinese characters but can not be recognized by most Chinese people.
At last, we use those characters instead of common English words for the concepts of Lisp and even the whole programming language world to make human interact better with it.
Ming code | Racket code |
(build-list 10 values) | |
( 10) | (range 10) |
As chart shown above, the keywords of Ming are much short in length, and in forms the complex characters are usually constituted by other simpler characters, and those simpler characters are usually used for related function names as well.
Further more, the connotations behind the characters work the same way, they are related to each other and complex concepts are broke to simple concepts as well.
Most importantly, the chineseoid characters implemented here also have the ability to imply to human about the arguments and results of functions, check Naming Rules for more.
Since the chineseoid chracters are much complicated than general western characters, there are few terminologies we need to know in advance: radical, component, part(check the wiktionary page for details).
Simply put it, phrase is composed by more than one characters, character is composed by more than on parts. For the parts of an specific character, only one of them can be counted as radical, which usually is another standalone character that provides the basic meaning for the specific character, and the other one can be counted as component, which usually implies the difference(type of input, type of output, etc.) between the meaning of radical and the specific character.
Take example of the procedure 伄, this character is composed of two parts: 亻 as component and 弔 as radical. By composition, we can deduce that this procedure has a similar usage as 弔 since it is the radical. And the 亻 additionally means the type of output data is list(read Naming Rules for more).
2.1 Fonts and Input method |
2.2 Code highlight for Emacs editor |
2.3 GGFSM |
to show chineseoid characters, install cangjie font to your OS;
to input chineseoid characters, install rime input method and use asdfzma scheme;(check rime_custom for an out-of-the-box config)
(use-package racket-mode :load-path "your-cloned-code-dir/racket-mode-for-ming" )
As a demonstation, GGFSM is a website draw gua graph for stocks, most code of this project are wrote in the Ming-Lang flavor: +https://github.com/yanyingwang/ggfsm
另见名扩展库:句
见Naming Rules,有:
规则 | 指示 | 含义 | 举例 |
下偏旁句 | 指示出参 | 出参是句结构 | |
右偏旁句 | 指示出参 | 出参是句结构 | |
左偏旁句 | 指示入参 | 入参是句结构 |
句为活用字
+为新造字
+为新造字 +
为新造字
+为新造字
为新造字
+𰅡为古活字
+
扌:“!”的意思;
另见:
为新造字
+为新造字
+为新造字
+为新造字 +
> ( '("鹅" "鹅" "鹅" "," "曲" "项" "向" "天" "歌")) "鹅 鹅 鹅 , 曲 项 向 天 歌"
> ( '("鹅" "鹅" "鹅" "," "曲" "项" "向" "天" "歌") "") "鹅鹅鹅,曲项向天歌"
> ( '("鹅" "鹅" "鹅" "," "曲" "项" "向" "天" "歌") "-") "鹅-鹅-鹅-,-曲-项-向-天-歌"
> ( "鹅鹅鹅,曲项向天歌") '("鹅鹅鹅,曲项向天歌")
> ( "鹅鹅鹅,曲项向天歌" "") '("" "鹅" "鹅" "鹅" "," "曲" "项" "向" "天" "歌" "")
> ( "鹅鹅鹅,曲项向天歌" ",") '("鹅鹅鹅" "曲项向天歌")
> ( "鹅-鹅-鹅-曲-项-向-天-歌" "-") '("鹅" "鹅" "鹅" "曲" "项" "向" "天" "歌")
> ( '(#\鹅 #\鹅 #\鹅 #\, #\曲 #\项 #\向 #\天 #\歌 #\。)) "鹅鹅鹅,曲项向天歌。"
> ( "鹅鹅鹅,曲项向天歌。") '(#\鹅 #\鹅 #\鹅 #\, #\曲 #\项 #\向 #\天 #\歌 #\。)
为新造字
+为新造字
+为新造字 +
戈:本意是“兵器”,引申为“修改、替换”之意;
匕:本意是“匕首”,引申为“修剪、删除”之意;
穴:空的简写;
上下结构的丷+匕:修剪起始处和结尾处;
上下结构的穴+一:将相连的多个空格单一化成一个。
为新造字
+为新造字
+
本:本意是“树根”,在此引申为“起始、开头”之意;
末:本意是“树梢”,在此引申为“结尾、末尾”之意;
干:本意是“枝干”,在此引申为“中间、包含”之意;
为新造字
+为新造字
+为新造字 +
与:写的简写;
composition
composition
composition
: elem + 构造内容是若干个相同元素的 + needtofix = make-string
composition
化 : elem + 把 + needtofix + 转变为 + needtofix
= string->immutable-string
composition
: = string-length
composition
: = string-ref
composition
: elem + 直接修改原始数据第N处字(从0算起)为某字 = string-set!
composition
composition
化 : elem + 把 + needtofix + 转化为 + needtofix = string-copy
composition
/以 : elem + 从第N处字(从0算起)开始做覆盖(以另一个句的 + needtofix + 结果为内容)
= string-copy!
composition
𰅡 : = string-fill!
composition
: elem + 把很多句连成一个 + needtofix = string-append
composition
: elem + 把很多句连成一个 + needtofix = string-append-immutable
composition
: elem + 句化字:把 + needtofix + 转化为 + needtofix + (由 + needtofix + 组成) = string->list
composition
: elem + 字化句:把 + needtofix + (由 + needtofix + 组成)转化为 + needtofix = list->string
composition
: elem + 构造内容是一系列序数转化成 + needtofix + 所组成的 + needtofix
= build-string
composition
composition
composition
composition
composition
composition
句ci=? : 句 + c + i + = + ? = string-ci=?
composition
句ci<? : 句 + c + i + < + ? = string-ci<?
composition
句ci<=? : 句 + c + i + < + = + ? = string-ci<=?
composition
句ci>? : 句 + c + i + > + ? = string-ci>?
composition
句ci>=? : 句 + c + i + > + = + ? = string-ci>=?
composition
: elem + 将句大写化 = string-upcase
composition
: elem + 将句小写化 = string-downcase
composition
: elem + 将句中单词首字母大写化其余小写化 = string-titlecase
composition
* : elem + 将句中单词做CaseFolding处理 = string-foldcase
(require ming/racket/base) | package: ming |
(require ming/racket/string) | package: ming |
composition
: elem + 类 + needtofix + ,不过最后一个句是 + needtofix
= string-append*
composition
: = string-join
composition
: = string-split
composition
composition
: = string-replace
composition
: elem + 修剪句 = string-trim
composition
? : elem + 非空句? = non-empty-string?
composition
? : elem + 某句是否是某句中间的一部分 = string-contains?
composition
? : elem + 某句是否是某句起头的一部分 = string-prefix?
composition
? : elem + 某句是否是某句末尾的一部分 = string-suffix?
“勺”(symbols)是一种跟句类似的数据结构,但是它更广泛的在Racket语言的内部实现中被使用。
见Naming Rules中关于化和土的条目。
勺为古活字
+为新造字
+为新造字 +
勹:工厂、容器、外壳;
一:数据内容;
罒:目;
曰:不可读的(仿罒得造);
由:自由的;
勺:因为外形和勾、句相近,在此借用为表示勺是和它们相近的一种数据结构;
(require ming/racket/base) | package: ming |
composition
composition
? : = symbol-interned?
composition
? : = symbol-unreadable?
composition
勺化句 : = symbol->string
composition
句化勺 : = string->symbol
composition
composition
composition
(require ming/racket/symbol) | package: ming |
composition
勺化 : = symbol->immutable-string
“”(syntax object)是Racket编程语言构建其语言的基石。
+“”其实就是通俗意义上的“代码”,而“代码”究其本质而言是封装了“词法信息”和“位置信息”的“数据”。“卩”(identifier)可以看作是“”的极简单特例。
卩为古活字
+为新造字
+
卩:节的古字,本意是“瑞信,古代出使等用作凭证之物”,引申为“语法,包含了上下文信息的数据”;
厂:工厂,容器,内容。
为新造字
+为新造字
+为新造字
+为新造字
+为新造字
+
止:本意是“足”,在此为“地址”的意思;
:第几列,仿经字得造;
:第几行,仿纬字得造;
:第几位;
为新造字
+为新造字
+为新造字
+为新造字
+
:+解各取偏旁得造;
:+各取偏旁得造;
:+文各取偏旁得造;
:文+各取偏旁得造;
(require ming/racket/base) | package: ming |
composition
composition
composition
卩? : 卩 + ? = identifier?
composition
: elem + 地址,比如是文件路径 = syntax-source
composition
: elem + 所在文件的具体哪一行(纬是横向的,参见“纬线”一词) = syntax-line
composition
: elem + 所在文件的具体哪一列(经是竖向的,参见“经线”一词) = syntax-column
composition
: elem + 所在文件的第几位 = syntax-position
composition
: elem + 所占用的长度(从0算起) = syntax-span
composition
: ? + s + y + n + t + a + x + - + o + r + i + g + i + n + a + l + ? = syntax-original?
composition
?司 : ? + + 司 = syntax-source-module
composition
composition
: elem + 化 = syntax->list
composition
: elem + 化文(将转化成文(原料数据)) = syntax->datum
composition
: elem + 文化 = datum->syntax
composition
: ? + s + y + n + t + a + x + - + b + i + n + d + i + n + g + - + s + e + t + ? = syntax-binding-set?
composition
: ? + s + y + n + t + a + x + - + b + i + n + d + i + n + g + - + s + e + t = syntax-binding-set
composition
: ? + s + y + n + t + a + x + - + b + i + n + d + i + n + g + - + s + e + t + - + > + s + y + n + t + a + x = syntax-binding-set->syntax
composition
: ? + s + y + n + t + a + x + - + b + i + n + d + i + n + g + - + s + e + t + - + e + x + t + e + n + d = syntax-binding-set-extend
composition
: ? + d + a + t + u + m + - + i + n + t + e + r + n + - + l + i + t + e + r + a + l = datum-intern-literal
composition
: ? + s + y + n + t + a + x + - + s + h + i + f + t + - + p + h + a + s + e + - + l + e + v + e + l = syntax-shift-phase-level
composition
: ? + g + e + n + e + r + a + t + e + - + t + e + m + p + o + r + a + r + i + e + s = generate-temporaries
composition
: ? + i + d + e + n + t + i + f + i + e + r + - + p + r + u + n + e + - + l + e + x + i + c + a + l + - + c + o + n + t + e + x + t = identifier-prune-lexical-context
composition
: ? + i + d + e + n + t + i + f + i + e + r + - + p + r + u + n + e + - + t + o + - + s + o + u + r + c + e + - + m + o + d + u + l + e = identifier-prune-to-source-module
composition
: ? + s + y + n + t + a + x + - + r + e + c + e + r + t + i + f + y = syntax-recertify
composition
: ? + s + y + n + t + a + x + - + d + e + b + u + g + - + i + n + f + o = syntax-debug-info
Racket’s value is especially called 𰅰 in ming-lang.
Racket’s Multiple Values is especially called 並 in ming-lang.
(require ming/racket/base) | package: ming |
composition
composition
𡌶0 : 𡌶 + 0 = call-with-values
composition
: elem + needtofix + + + needtofix = define-values
composition
: elem + needtofix + + + needtofix = let-values
Originates from Vectors and Extends to .
To extend Naming Rules, specifically there are:
Character | Connotation | Elucidation | Example |
direct modification | directly modify the orignal data and return void | ||
Phrase | – | – | – |
as input | implies the type of input data is | ||
minor type convertion | implies slightly convert the type of input data, i.e. from mutable to immutable. | ||
type convertion |
> ( '#(a b c d e f) 2) '#(a b)
> ( '#(a b c d e f) 2) '#(c d e f)
> ( '#(a b c d e f) 2)
'#(a b)
'#(c d e f)
> ( '#(a b c d e f) 0 2) '#(a b)
🐘
(require ming/racket/base) | package: ming |
composition
composition
composition
: 三 + = make-vector
composition
: 山 + = vector-immutable
composition
巨 : + 巨 = vector-length
composition
弔 : + 弔 = vector-ref
composition
: + = vector-set!
composition
化 : + 化 + = vector->list
composition
化 : + 化 + = list->vector
composition
化 : + 化 = vector->immutable-vector
composition
𰅡 : + 𰅡 = vector-fill!
composition
𢪛/以 : 𢪛 + / + 以 = vector-copy!
composition
化並 : + 化 + 並 = vector->values
composition
: 弓 + = build-vector
(require ming/racket/vector) | package: ming |
composition
? : + ? = vector-empty?
composition
𢪛 : + 𢪛 = vector-set*!
composition
: + = vector-map
composition
: + = vector-map!
composition
: 毌 + = vector-append
composition
: + = vector-take
composition
𨚞 : + 𨚞 = vector-take-right
composition
: + = vector-drop
composition
: + = vector-drop-right
composition
: + = vector-split-at
composition
: + = vector-split-at-right
composition
: + = vector-copy
composition
: + = vector-filter
composition
: + = vector-filter-not
composition
巨 : + + 巨 = vector-count
composition
: + + = vector-argmin
composition
: + + = vector-argmax
composition
弓 : + 弓 = vector-member
composition
弓/ : 弓 + / + = vector-memv
composition
弓/ : 弓 + / + = vector-memq
composition
𠆯 : + 𠆯 = vector-sort
composition
: + = vector-sort!