• R/O
  • SSH

kink: Commit

Kink runtime


Commit MetaInfo

Revisiona03d5e642d4a5574859b3354d8f8b9b44c05e841 (tree)
Time2020-02-09 13:32:26
Authormiyakawataku
Commitermiyakawataku

Log Message

rename MAP.map? to MAP.is?

Change Summary

Incremental Difference

diff -r 2c6c461dfdd7 -r a03d5e642d4a src/main/resources/kink-mods/kink/container/MAP.kn
--- a/src/main/resources/kink-mods/kink/container/MAP.kn Sun Feb 09 13:27:14 2020 +0900
+++ b/src/main/resources/kink-mods/kink/container/MAP.kn Sun Feb 09 13:32:26 2020 +0900
@@ -3,11 +3,10 @@
33
44 # map {{{1
55
6-## MAP.map?(Val)
6+## MAP.is?(Val)
77 #
8-# Returns true if the Val is a map,
9-# otherwise false.
10-:map? <- {(:Val)
8+# MAP.is? returns whether Val is a map.
9+:is? <- {(:Val)
1110 Val.var_syms.have_all?(Map_syms)
1211 }
1312
diff -r 2c6c461dfdd7 -r a03d5e642d4a src/main/resources/kink-mods/kink/doc/model/SECTION.kn
--- a/src/main/resources/kink-mods/kink/doc/model/SECTION.kn Sun Feb 09 13:27:14 2020 +0900
+++ b/src/main/resources/kink-mods/kink/doc/model/SECTION.kn Sun Feb 09 13:32:26 2020 +0900
@@ -198,7 +198,7 @@
198198
199199 # parse a section from Json_val (expected to be a map) and tail-calls $cont
200200 :_parse_section <- {(:Json_val :hit_error :cont) # {{{1
201- MAP.map?(Json_val) || hit_error(
201+ MAP.is?(Json_val) || hit_error(
202202 'section must be a JSON object, but got {}'
203203 .format(JSON.stringify(Json_val)))
204204
@@ -233,7 +233,7 @@
233233 # parse a block from Json_elem (expected to be a map) and tail-calls $cont
234234 :_parse_block <- {(:Json_elem :hit_error :cont) # {{{1
235235 # check Json_elem
236- MAP.map?(Json_elem) || hit_error(
236+ MAP.is?(Json_elem) || hit_error(
237237 'block must be a JSON object, but got {}'.format(JSON.stringify(Json_elem)))
238238
239239 # check Json_elem.type
diff -r 2c6c461dfdd7 -r a03d5e642d4a src/main/resources/kink-mods/kink/json/JSON_VAL.kn
--- a/src/main/resources/kink-mods/kink/json/JSON_VAL.kn Sun Feb 09 13:27:14 2020 +0900
+++ b/src/main/resources/kink-mods/kink/json/JSON_VAL.kn Sun Feb 09 13:32:26 2020 +0900
@@ -44,7 +44,7 @@
4444 { VEC.is?(Val) } {
4545 _json_array?(Val Testing $cont)
4646 }
47- { MAP.map?(Val) } {
47+ { MAP.is?(Val) } {
4848 _json_object?(Val Testing $cont)
4949 }
5050 $true { false }
@@ -111,8 +111,8 @@
111111 && X.size == Y.size
112112 && X.size.times.for_all?{(:I) eq?(X.get(I) Y.get(I)) }
113113 }
114- { MAP.map?(X) } {
115- MAP.map?(Y)
114+ { MAP.is?(X) } {
115+ MAP.is?(Y)
116116 && X.size == Y.size
117117 && X.pair_iter.for_all?{([:X_key :X_val])
118118 Y.have_key?(X_key) && eq?(X_val Y.get(X_key))
diff -r 2c6c461dfdd7 -r a03d5e642d4a src/main/resources/kink-mods/kink/json/_encode/ENCODE.kn
--- a/src/main/resources/kink-mods/kink/json/_encode/ENCODE.kn Sun Feb 09 13:27:14 2020 +0900
+++ b/src/main/resources/kink-mods/kink/json/_encode/ENCODE.kn Sun Feb 09 13:32:26 2020 +0900
@@ -25,7 +25,7 @@
2525 { NUM.is?(Val) } { reduce(Accum + Val.show) }
2626 { STR.is?(Val) } { reduce(Accum + _encode_str(Val)) }
2727 { VEC.is?(Val) } { _encode_vec(Accum Encoding Val Level Conf $reduce) }
28- { MAP.map?(Val) } { _encode_map(Accum Encoding Val Level Conf $reduce) }
28+ { MAP.is?(Val) } { _encode_map(Accum Encoding Val Level Conf $reduce) }
2929 $true {
3030 raise(
3131 'JSON.stringify(Json_val ...[$config]): Json_val contains invalid JSON value {}'
diff -r 2c6c461dfdd7 -r a03d5e642d4a src/test/kink/container/FLAT_MAP_test.kn
--- a/src/test/kink/container/FLAT_MAP_test.kn Sun Feb 09 13:27:14 2020 +0900
+++ b/src/test/kink/container/FLAT_MAP_test.kn Sun Feb 09 13:32:26 2020 +0900
@@ -35,7 +35,7 @@
3535 TEST.group('type of flat map'){ # {{{1
3636 TEST.test('is map'){
3737 :Map = _new_map
38- MAP.map?(Map) || raise('got false')
38+ MAP.is?(Map) || raise('got false')
3939 }
4040
4141 TEST.test('is ordered_map'){
diff -r 2c6c461dfdd7 -r a03d5e642d4a src/test/kink/container/HASH_MAP_test.kn
--- a/src/test/kink/container/HASH_MAP_test.kn Sun Feb 09 13:27:14 2020 +0900
+++ b/src/test/kink/container/HASH_MAP_test.kn Sun Feb 09 13:32:26 2020 +0900
@@ -47,7 +47,7 @@
4747 TEST.group('type of hash map'){ # {{{1
4848 TEST.test('is map'){
4949 :Map = _new_map
50- MAP.map?(Map) || raise('got {}')
50+ MAP.is?(Map) || raise('got {}')
5151 }
5252 }
5353
diff -r 2c6c461dfdd7 -r a03d5e642d4a src/test/kink/container/MAP_test.kn
--- a/src/test/kink/container/MAP_test.kn Sun Feb 09 13:27:14 2020 +0900
+++ b/src/test/kink/container/MAP_test.kn Sun Feb 09 13:32:26 2020 +0900
@@ -6,14 +6,14 @@
66
77 :TEST.require_from('kink/test/')
88
9-TEST.group('MAP.map?'){
9+TEST.group('MAP.is?'){
1010 TEST.test('true for hash map'){
1111 :Map = HASH_MAP.new({(:K) K.val_id })
12- MAP.map?(Map) || raise('got false')
12+ MAP.is?(Map) || raise('got false')
1313 }
1414
1515 TEST.test('false for non-map val'){
16- MAP.map?(nada) && raise('got true')
16+ MAP.is?(nada) && raise('got true')
1717 }
1818 }
1919
diff -r 2c6c461dfdd7 -r a03d5e642d4a src/test/kink/container/TREE_MAP_test.kn
--- a/src/test/kink/container/TREE_MAP_test.kn Sun Feb 09 13:27:14 2020 +0900
+++ b/src/test/kink/container/TREE_MAP_test.kn Sun Feb 09 13:32:26 2020 +0900
@@ -34,7 +34,7 @@
3434 TEST.group('type of tree map'){ # {{{1
3535 TEST.test('is map'){
3636 :Map = _new_map
37- MAP.map?(Map) || raise('got false')
37+ MAP.is?(Map) || raise('got false')
3838 }
3939
4040 TEST.test('is ordered_map'){
Show on old repository browser