• R/O
  • SSH

kink: Commit

Kink runtime


Commit MetaInfo

Revisionfe10cc618a1b759c45bb45b38244a7330d348b33 (tree)
Time2020-02-08 15:18:09
Authormiyakawataku
Commitermiyakawataku

Log Message

rename VEC.vec?? to VEC.is?

Change Summary

Incremental Difference

diff -r 32d91aaa449f -r fe10cc618a1b src/main/resources/kink-mods/kink/TRACE.kn
--- a/src/main/resources/kink-mods/kink/TRACE.kn Sat Feb 08 15:12:53 2020 +0900
+++ b/src/main/resources/kink-mods/kink/TRACE.kn Sat Feb 08 15:18:09 2020 +0900
@@ -211,7 +211,7 @@
211211 :format_traces <- {(:Msg :Traces)
212212 STR.is?(Msg) || raise(
213213 'TRACE.format_traces(Msg Traces): requires str for Msg, but got {}'.format(Msg.repr))
214- VEC.vec?(Traces) || raise(
214+ VEC.is?(Traces) || raise(
215215 'TRACE.format_traces(Msg Traces): requires vec for Traces, but got {}'.format(Traces.repr))
216216 :T = Traces.iter.map{(:C) C.desc }
217217 ITER.chain(
diff -r 32d91aaa449f -r fe10cc618a1b src/main/resources/kink-mods/kink/VEC.kn
--- a/src/main/resources/kink-mods/kink/VEC.kn Sat Feb 08 15:12:53 2020 +0900
+++ b/src/main/resources/kink-mods/kink/VEC.kn Sat Feb 08 15:18:09 2020 +0900
@@ -1359,10 +1359,10 @@
13591359 'repr'
13601360 ]
13611361
1362-## VEC.vec?(Val)
1362+## VEC.is?(Val)
13631363 #
1364-# VEC.vec? returns whether Val is a vec val.
1365-:vec? <- {(:Val)
1364+# VEC.is? returns whether Val is a vec val.
1365+:is? <- {(:Val)
13661366 JAVA.wrap(Val).typable_as?(VecVal_class)
13671367 }
13681368
diff -r 32d91aaa449f -r fe10cc618a1b src/main/resources/kink-mods/kink/doc/_input/CHUNK.kn
--- a/src/main/resources/kink-mods/kink/doc/_input/CHUNK.kn Sat Feb 08 15:12:53 2020 +0900
+++ b/src/main/resources/kink-mods/kink/doc/_input/CHUNK.kn Sat Feb 08 15:18:09 2020 +0900
@@ -16,7 +16,7 @@
1616 :Desc = 'CHUNK.new(First_line_num Lines)'
1717 NUM.is?(First_line_num) && First_line_num.int? && First_line_num >= 1 || raise(
1818 '{}: required int num >=1 for First_line_num, but got {}'.format(Desc First_line_num.repr))
19- VEC.vec?(Lines) && Lines.nonempty? && Lines.for_all?($_comment_only_line?) || raise(
19+ VEC.is?(Lines) && Lines.nonempty? && Lines.for_all?($_comment_only_line?) || raise(
2020 '{}: required nonempty vec of comment-only lines without LF for Lines, but got {}'.format(Desc Lines.repr))
2121
2222 :Indent = _indent_of(Lines.front)
diff -r 32d91aaa449f -r fe10cc618a1b src/main/resources/kink-mods/kink/doc/model/SECTION.kn
--- a/src/main/resources/kink-mods/kink/doc/model/SECTION.kn Sat Feb 08 15:12:53 2020 +0900
+++ b/src/main/resources/kink-mods/kink/doc/model/SECTION.kn Sat Feb 08 15:18:09 2020 +0900
@@ -37,9 +37,9 @@
3737 STR.is?(Title) && _valid_title?(Title) || raise(
3838 '{}: for title, required: {}, but got: {}'
3939 .format(Desc Title_req Title.repr))
40- VEC.vec?(Blocks) && Blocks.for_all?(BLOCK$block?) || raise(
40+ VEC.is?(Blocks) && Blocks.for_all?(BLOCK$block?) || raise(
4141 '{}: required vec of blocks for Blocks, but got {}'.format(Desc Blocks.repr))
42- VEC.vec?(Subsections) && Subsections.for_all?($section?) || raise(
42+ VEC.is?(Subsections) && Subsections.for_all?($section?) || raise(
4343 '{}: required vec of sections for Subsections, but got {}'.format(Desc Subsections.repr))
4444
4545 new_val(
@@ -212,12 +212,12 @@
212212 :Blocks_array = Json_val.get_or('blocks'){
213213 hit_error('section must have "blocks" key, but got {}'.format(JSON.stringify(Json_val)))
214214 }
215- VEC.vec?(Blocks_array) || hit_error(
215+ VEC.is?(Blocks_array) || hit_error(
216216 '"blocks" of a section must be a vec, but got {}'.format(JSON.stringify(Blocks_array)))
217217 :Subsections_array = Json_val.get_or('subsections'){
218218 hit_error('section must have "subsections" key, but got {}'.format(JSON.stringify(Json_val)))
219219 }
220- VEC.vec?(Subsections_array) || hit_error(
220+ VEC.is?(Subsections_array) || hit_error(
221221 '"subsections" of a section must be a vec, but got {}'.format(JSON.stringify(Subsections_array)))
222222
223223 _parse_array($_parse_block Blocks_array [] $hit_error){(:Blocks)
diff -r 32d91aaa449f -r fe10cc618a1b src/main/resources/kink-mods/kink/json/JSON_VAL.kn
--- a/src/main/resources/kink-mods/kink/json/JSON_VAL.kn Sat Feb 08 15:12:53 2020 +0900
+++ b/src/main/resources/kink-mods/kink/json/JSON_VAL.kn Sat Feb 08 15:18:09 2020 +0900
@@ -41,7 +41,7 @@
4141 { null?(Val) || BOOL.is?(Val) || NUM.is?(Val) || STR.is?(Val) } {
4242 cont
4343 }
44- { VEC.vec?(Val) } {
44+ { VEC.is?(Val) } {
4545 _json_array?(Val Testing $cont)
4646 }
4747 { MAP.map?(Val) } {
@@ -106,8 +106,8 @@
106106 { BOOL.is?(X) } { BOOL.is?(Y) && X == Y }
107107 { NUM.is?(X) } { NUM.is?(Y) && X == Y }
108108 { STR.is?(X) } { STR.is?(Y) && X == Y }
109- { VEC.vec?(X) } {
110- VEC.vec?(Y)
109+ { VEC.is?(X) } {
110+ VEC.is?(Y)
111111 && X.size == Y.size
112112 && X.size.times.for_all?{(:I) eq?(X.get(I) Y.get(I)) }
113113 }
diff -r 32d91aaa449f -r fe10cc618a1b src/main/resources/kink-mods/kink/json/_encode/ENCODE.kn
--- a/src/main/resources/kink-mods/kink/json/_encode/ENCODE.kn Sat Feb 08 15:12:53 2020 +0900
+++ b/src/main/resources/kink-mods/kink/json/_encode/ENCODE.kn Sat Feb 08 15:18:09 2020 +0900
@@ -24,7 +24,7 @@
2424 { BOOL.is?(Val) } { reduce(Accum + Val.repr) }
2525 { NUM.is?(Val) } { reduce(Accum + Val.show) }
2626 { STR.is?(Val) } { reduce(Accum + _encode_str(Val)) }
27- { VEC.vec?(Val) } { _encode_vec(Accum Encoding Val Level Conf $reduce) }
27+ { VEC.is?(Val) } { _encode_vec(Accum Encoding Val Level Conf $reduce) }
2828 { MAP.map?(Val) } { _encode_map(Accum Encoding Val Level Conf $reduce) }
2929 $true {
3030 raise(
diff -r 32d91aaa449f -r fe10cc618a1b src/test/kink/EVALUATOR_test.kn
--- a/src/test/kink/EVALUATOR_test.kn Sat Feb 08 15:12:53 2020 +0900
+++ b/src/test/kink/EVALUATOR_test.kn Sat Feb 08 15:18:09 2020 +0900
@@ -23,7 +23,7 @@
2323 {(:M :T) [M T] }
2424 )
2525 Msg == 'boo' || raise('got {}'.format(Msg.repr))
26- VEC.vec?(Traces) || raise('got {}'.format(Traces.repr))
26+ VEC.is?(Traces) || raise('got {}'.format(Traces.repr))
2727 Traces.each{(:T)
2828 TRACE.is?(T) || raise('got {}'.format(T.repr))
2929 }
diff -r 32d91aaa449f -r fe10cc618a1b src/test/kink/VEC_test.kn
--- a/src/test/kink/VEC_test.kn Sat Feb 08 15:12:53 2020 +0900
+++ b/src/test/kink/VEC_test.kn Sat Feb 08 15:18:09 2020 +0900
@@ -5,14 +5,15 @@
55
66 :TEST.require_from('kink/test/')
77
8-# test VEC.vec?(Val) {{{1
98
10-TEST.test('VEC.vec?(Vec) is true'){
11- VEC.vec?([1 2 3]) || raise('got false')
12-}
9+TEST.group('VEC.is?'){ # {{{1
10+ TEST.test('true for vec'){
11+ VEC.is?([1 2 3]) || raise('got false')
12+ }
1313
14-TEST.test('VEC.vec?(non-vec) is false'){
15- VEC.vec?(nada) && raise('got true')
14+ TEST.test('false for nada'){
15+ VEC.is?(nada) && raise('got true')
16+ }
1617 }
1718
1819 # }}}1
diff -r 32d91aaa449f -r fe10cc618a1b src/test/kink/host_lang/java/JAVA_EXCEPTION_test.kn
--- a/src/test/kink/host_lang/java/JAVA_EXCEPTION_test.kn Sat Feb 08 15:12:53 2020 +0900
+++ b/src/test/kink/host_lang/java/JAVA_EXCEPTION_test.kn Sat Feb 08 15:18:09 2020 +0900
@@ -56,7 +56,7 @@
5656 TEST.test('returns a vec of traces'){
5757 :Exc = RuntimeException_class.new([JAVA.string('boo!')])
5858 :Traces = JAVA_EXCEPTION.traces_from_throwable(Exc)
59- VEC.vec?(Traces) && Traces.for_all?{(:T) TRACE.is?(T) }
59+ VEC.is?(Traces) && Traces.for_all?{(:T) TRACE.is?(T) }
6060 || raise('got {}'.format(Traces.repr))
6161 }
6262
Show on old repository browser