5.2 双 and
Extention:
5.2.1 Naming Rules
Character | Connotation | Elucidation | Example |
as radical | resembles | Has the similar function proceeding as it resembled and the output is list accordingly. | |
亻 as component | general subset | Returns a new list with elements produced from the input list. | |
阝 as component | serial subset | Returns a new list with elements serially produced from the input list. | |
刂 as component | broken subset | Returns a new list with removing some elements from the input list. | |
入 as component | same as /入 | Implies the type of input data is functions. | |
土 as component | product data | Manufactures data and product new one, implies the type of output data is not same as input. | |
Phrase | - | - | - |
suffixes with 分 | split data to values | Implies the type of output data is values(並). | |
Punctuation | - | - | - |
suffixed with * | strengthen | Strengthen the process, thus the output data may become longer. | |
suffixed sith ~ | soften | Soften the process, thus the output data shorter. | |
suffixes with ^ | list as input | Implies the type of input data is list. | |
inserts with / | extend suffix | Suffix of / is an extend explanation of prefix. | |
混合 | - | - | - |
/入 | function as input | Implies the type of input data is list. |
5.2.2 双,、
对于名语言来说,如果我们把两个数据配成对(双在一块),我们就得到一个“双”,而双在一块的这两个数据分别处于他们所构成的这个“双”的阳位和阴位。
> (双 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)
5.2.3 阴、阳,阴之阳、阳之阳、阴之阴阳、阳之阴阳
“阴”、“阳”是中国传统哲学的一种二元论观念。
5.2.4 、*
为新造字
米:数的简写,见米?;
5.2.5 0、
为新造字
为新造字
弔:原被用于“索引”之意(见弔),但因索引是从零开始的序数,在此借用为“序数”之意;
三:道生一,一生二,二生三,三生万物,故三个相同的一在此为“若干个相同元素”之意;
5.2.6 、
、为新造字
> ( 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
5.2.7 攸
攸为古活字
攵本意是“用手敲打敦促使其改变”,在此引申为“修改”之意;
另外,也可以认为该字分别取修字左部的偏旁(亻丨)和改字右部偏旁(攵)组成,也即含有“修改”的意思。
5.2.8 甲、乙、丙、丁、戊、己、庚、辛、壬、癸
“甲”、“乙”、“丙”、“丁”、“戊”、“己”、“庚”、“辛”、“壬”、“癸”是中国古代的一种文字记序符号 。
5.2.9 末、
5.2.10 巨
巨为活用字
巨:测量返回长度(本意是“木工用方尺做丈量”(圆是规,方是矩,固有“无规矩不成方圆”之说))。
另见:
> (巨 '(a b c d e 3 f g)) 8
5.2.11 弔,弓、,𰁣、
弔为古活字
弓为活用字
弔:第的简写,像是绳子缠绕在树干表皮上,表示是用某索引提取相对应的值。
弓:引的简写,像是缠绕在树干表皮上的绳子,即“索引”的意思,亦即返回某值的索引;
亻,见:例程命名规则。
5.2.12 、𨚞,、,分、𨚞分,/入、𨚞/入,于?
、𨚞为新造字
、为新造字
左:从左;
右:从右;
口:右的简写;
阝、刂见:例程命名规则。
另见:
> ( '(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
5.2.13 䢼,分,䢼分
䢼、为新造字
共:共同、共有;
阝、刂,见:例程命名规则。
5.2.14 𰂋,偏,,重、𠝤
𰂋为新造字
偏为活用字
为新造字
𠝤为古活字
间:间以;
扁:扁平;
糸:乱(紊去掉声旁,紊是“乱”的意思(故有成语“有条不紊”));
重:重复之元素;
亻、刂,见:例程命名规则。
另见:偅
> (𰂋 '(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)) '(b e d d a c b 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)
5.2.15 、𠆯
为新造字
𠆯为古活字
屰:倒序(通逆,甲骨文、金文是“一个倒立的人”);
川:理顺(类比驯、训而得造)。
亻,见:例程命名规则。
> ( '(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")
5.2.16 、、~、^,,,、,~、
> ( '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)
5.2.17 分,巨
5.2.18 各,佫,、,垎、右垎,佫、佫
为便理解,列下代码,两两等同:
> (各 行示 ( 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))) '(1 3 -4 5)) '(2 4 6)
> (佫 化 '(#(1) #(2 3) #(4))) '(1 2 3 4)
5.2.19 佫之、佫之
> (佫之 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)
5.2.20 /组合、/排列组合,/笛卡尔积,/分组
5.2.21 基础例程
(require ming/racket/base) | package: ming |
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
: 构造内容是一系列序数的 【MORE】 = build-list
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
5.2.22 扩展例程
(require ming/racket/list) | package: ming |
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
汉字化
攸/入 : 类上,另外进参是入 【MORE】 = list-update
汉字化
汉字化
: 类上,另外进参是入 【MORE】 = index-where
汉字化
𰁣 : 类上,另外,返回的是所有符合条件的元素组成的 【MORE】 = indexes-of
汉字化
: 类上,另外进参是入 【MORE】 = indexes-where
汉字化
汉字化
𨚞 : 类上,另外是从右边开始操作的 【MORE】 = take-right
汉字化
汉字化
: 类上,另外是从右边开始操作的 【MORE】 = drop-right
汉字化
汉字化
𨚞/入 : 类上,另外是从右边开始操作的 【MORE】 = takef-right
汉字化
汉字化
/入 : 类上,另外是从右边开始操作的 【MORE】 = dropf-right
汉字化
汉字化
𨚞分 : 类上,另外是从右边开始操作的 【MORE】 = split-at-right
汉字化
汉字化
𨚞分/入 : 类上,另外是从右边开始操作的 【MORE】 = splitf-at-right
汉字化
汉字化
䢼 : 返回左起相同的元素 【MORE】 = take-common-prefix
汉字化
分 : 删除左起相同的元素(输出结果是一个复值) 【MORE】 = drop-common-prefix
汉字化
䢼分 : 将䢼和余下分离开(输出结果是一个复值) 【MORE】 = split-common-prefix
汉字化
汉字化
𰂋 : 中每两个元素之间都插入另一元素 【MORE】 = add-between
汉字化
汉字化
汉字化
重 : 从中查找出第一个重复的元素并返回之 【MORE】 = check-duplicates
汉字化
𠝤 : 去除掉所有重复的元素并返回新数据 【MORE】 = remove-duplicates
汉字化
: 去除掉所有符合条件的元素并返回新数据 【MORE】 = filter-not
汉字化
汉字化
汉字化
汉字化
佫 : 等同于( (佫 proc lst)) 【MORE】 = append-map
汉字化
汉字化
* : 构造从A到B之间的一段连续数字组成的(包括A也包括B) 【MORE】 = inclusive-range
汉字化
/组合 : 【MORE】 = combinations
汉字化
/排列组合 : 【MORE】 = permutations
汉字化
序列/组合 : 【MORE】 = in-combinations
汉字化
序列/排列组合 : 【MORE】 = in-permutations
汉字化
汉字化
汉字化
汉字化
汉字化