• R/O
  • SSH

kink: Commit

Kink runtime


Commit MetaInfo

Revisiona8494bea9a79564b78b4776b6ea8b9150f75255d (tree)
Time2020-02-08 14:48:26
Authormiyakawataku
Commitermiyakawataku

Log Message

rename FUN.fun? to FUN.is?

Change Summary

Incremental Difference

diff -r b4a5bcd61fc7 -r a8494bea9a79 src/main/resources/kink-mods/kink/COMPARE.kn
--- a/src/main/resources/kink-mods/kink/COMPARE.kn Sat Feb 08 14:41:35 2020 +0900
+++ b/src/main/resources/kink-mods/kink/COMPARE.kn Sat Feb 08 14:48:26 2020 +0900
@@ -75,7 +75,7 @@
7575 # and return true if the first arg is less than the second,
7676 # otherwise return false.
7777 'lt_fun' {[:Conf](:lt?)
78- FUN.fun?($lt?) || raise(
78+ FUN.is?($lt?) || raise(
7979 'Compare_conf.lt_fun($lt?): required fun for $lt?, but got {}'.format($lt?.repr)
8080 )
8181 Conf:May_lt_fun <- [$lt?]
@@ -92,7 +92,7 @@
9292 # and return true if the first arg is less than or equal to the second,
9393 # otherwise return false.
9494 'le_fun' {[:Conf](:le?)
95- FUN.fun?($le?) || raise(
95+ FUN.is?($le?) || raise(
9696 'Compare_conf.le_fun($le?): required fun for $le?, but got {}'.format($le?.repr)
9797 )
9898 Conf:May_le_fun <- [$le?]
@@ -109,7 +109,7 @@
109109 # and return true if the first arg is equal to the second,
110110 # otherwise return false.
111111 'eq_fun' {[:Conf](:eq?)
112- FUN.fun?($eq?) || raise(
112+ FUN.is?($eq?) || raise(
113113 'Compare_conf.eq_fun($eq?): required fun for $eq?, but got {}'.format($eq?.repr)
114114 )
115115 Conf:May_eq_fun <- [$eq?]
@@ -126,7 +126,7 @@
126126 # and return true if the first arg is not equal to the second,
127127 # otherwise return false.
128128 'ne_fun' {[:Conf](:ne?)
129- FUN.fun?($ne?) || raise(
129+ FUN.is?($ne?) || raise(
130130 'Compare_conf.ne_fun($ne?): required fun for $ne?, but got {}'.format($ne?.repr)
131131 )
132132 Conf:May_ne_fun <- [$ne?]
diff -r b4a5bcd61fc7 -r a8494bea9a79 src/main/resources/kink-mods/kink/CONTROL.kn
--- a/src/main/resources/kink-mods/kink/CONTROL.kn Sat Feb 08 14:41:35 2020 +0900
+++ b/src/main/resources/kink-mods/kink/CONTROL.kn Sat Feb 08 14:48:26 2020 +0900
@@ -61,9 +61,9 @@
6161 # # exit from $divide_10_by
6262 # # exception: Num.op_intdiv: zero division: 10 is divided by 0
6363 :ensure <- {(:body :cleanup)
64- FUN.fun?($body) || raise(
64+ FUN.is?($body) || raise(
6565 'CONTROL.ensure($body $cleanup): required fun for $body, but got {}'.format($body.repr))
66- FUN.fun?($cleanup) || raise(
66+ FUN.is?($cleanup) || raise(
6767 'CONTROL.ensure($body $cleanup): required fun for $cleanup, but got {}'.format($cleanup.repr))
6868
6969 # TODO improve documentation of the mod
@@ -192,10 +192,10 @@
192192 # # exception message: Num.op_intdiv: zero division: 10 is divided by 0
193193 :try <- {(:body :on_returned :on_raised)
194194 :Desc = 'CONTROL.try($body $on_returned $on_raised)'
195- FUN.fun?($body) || raise('{}: required fun for $body, but got {}'.format(Desc $body.repr))
196- FUN.fun?($on_returned) || raise(
195+ FUN.is?($body) || raise('{}: required fun for $body, but got {}'.format(Desc $body.repr))
196+ FUN.is?($on_returned) || raise(
197197 '{}: required fun for $on_returned, but got {}'.format(Desc $on_returned.repr))
198- FUN.fun?($on_raised) || raise(
198+ FUN.is?($on_raised) || raise(
199199 '{}: required fun for $on_raised, but got {}'.format(Desc $on_raised.repr))
200200
201201 :handler = reset('kink/CONTROL-try'){
diff -r b4a5bcd61fc7 -r a8494bea9a79 src/main/resources/kink-mods/kink/FUN.kn
--- a/src/main/resources/kink-mods/kink/FUN.kn Sat Feb 08 14:41:35 2020 +0900
+++ b/src/main/resources/kink-mods/kink/FUN.kn Sat Feb 08 14:48:26 2020 +0900
@@ -13,11 +13,14 @@
1313 :Val_var_syms <- [
1414 ]
1515
16-## FUN.fun?(Val)
16+## FUN.is?(Val)
1717 #
18-# FUN.fun? returns whether the Val is a fun.
18+# FUN.is? returns whether the Val is a fun.
1919 :fun? <- {(:Val)
2020 JAVA.wrap(Val).typable_as?(FunVal_class)
2121 }
22+:is? <- {(:Val)
23+ JAVA.wrap(Val).typable_as?(FunVal_class)
24+}
2225
2326 # vim: et sw=2 sts=2
diff -r b4a5bcd61fc7 -r a8494bea9a79 src/main/resources/kink-mods/kink/PROGRAM.kn
--- a/src/main/resources/kink-mods/kink/PROGRAM.kn Sat Feb 08 14:41:35 2020 +0900
+++ b/src/main/resources/kink-mods/kink/PROGRAM.kn Sat Feb 08 14:48:26 2020 +0900
@@ -87,11 +87,11 @@
8787 'C.name(Name): Name must be a str, but got {}'.format(Name.repr))
8888 }
8989 C.req_arg('on_success'){(:success_cont)
90- FUN.fun?($success_cont) || raise(
90+ FUN.is?($success_cont) || raise(
9191 'C.on_success($success_cont): $success_cont must be a fun, but got {}'.format($success_cont.repr))
9292 }
9393 C.req_arg('on_error'){(:error_cont)
94- FUN.fun?($error_cont) || raise(
94+ FUN.is?($error_cont) || raise(
9595 'C.on_error($error_cont): $success_cont must be a fun, but got {}'.format($error_cont.repr))
9696 }
9797 }
diff -r b4a5bcd61fc7 -r a8494bea9a79 src/main/resources/kink-mods/kink/_java/CALL_AUX.kn
--- a/src/main/resources/kink-mods/kink/_java/CALL_AUX.kn Sat Feb 08 14:41:35 2020 +0900
+++ b/src/main/resources/kink-mods/kink/_java/CALL_AUX.kn Sat Feb 08 14:48:26 2020 +0900
@@ -6,12 +6,12 @@
66 :read_conf <- {(:config :def_success_cont :def_error_cont :cont)
77 :Conf = CONF.read($config){(:C)
88 C.req_arg('on_success'){(:success_cont)
9- FUN.fun?($success_cont) || raise(
9+ FUN.is?($success_cont) || raise(
1010 'C.on_success($success_cont): $success_cont must be a fun, but got {}'
1111 .format($success_cont.repr))
1212 }
1313 C.req_arg('on_error'){(:error_cont)
14- FUN.fun?($error_cont) || raise(
14+ FUN.is?($error_cont) || raise(
1515 'C.on_error($error_cont): $error_cont must be a fun, but got {}'
1616 .format($error_cont.repr))
1717 }
diff -r b4a5bcd61fc7 -r a8494bea9a79 src/main/resources/kink-mods/kink/_mod/REQUIRE_AUX.kn
--- a/src/main/resources/kink-mods/kink/_mod/REQUIRE_AUX.kn Sat Feb 08 14:41:35 2020 +0900
+++ b/src/main/resources/kink-mods/kink/_mod/REQUIRE_AUX.kn Sat Feb 08 14:48:26 2020 +0900
@@ -3,21 +3,21 @@
33 :CONF.require_from('kink/conf/')
44
55 :read_conf <- {(:Mod_name :config :cont)
6- FUN.fun?($config) || raise(
6+ FUN.is?($config) || raise(
77 'CORE.require(Mod_name ...[$config]): $config must be a fun, but got {}'.format($config.repr))
88 :Conf = CONF.read($config){(:C)
99 C.req_arg('on_success'){(:success_cont)
10- FUN.fun?($success_cont) || raise(
10+ FUN.is?($success_cont) || raise(
1111 'C.on_success($success_cont): $success_cont must be a fun, but got {}'
1212 .format($success_cont.repr))
1313 }
1414 C.req_arg('on_not_found'){(:not_found_cont)
15- FUN.fun?($not_found_cont) || raise(
15+ FUN.is?($not_found_cont) || raise(
1616 'C.on_not_found($not_found_cont): $not_found_cont must be a fun, but got {}'
1717 .format($not_found_cont.repr))
1818 }
1919 C.req_arg('on_compile_error'){(:compile_error_cont)
20- FUN.fun?($compile_error_cont) || raise(
20+ FUN.is?($compile_error_cont) || raise(
2121 'C.on_compile_error($compile_error_cont): $compile_error_cont must be a fun, but got {}'
2222 .format($compile_error_cont.repr))
2323 }
diff -r b4a5bcd61fc7 -r a8494bea9a79 src/main/resources/kink-mods/kink/container/HASH_MAP.kn
--- a/src/main/resources/kink-mods/kink/container/HASH_MAP.kn Sat Feb 08 14:41:35 2020 +0900
+++ b/src/main/resources/kink-mods/kink/container/HASH_MAP.kn Sat Feb 08 14:48:26 2020 +0900
@@ -38,7 +38,7 @@
3838 :_read_conf <- {(:config)
3939 CONF.read($config){(:C)
4040 C.req_arg('eq_fun'){(:eq?)
41- FUN.fun?($eq?) || raise('C.eq_fun($eq?): $eq? must be a fun, but got {}'.format($eq?.repr))
41+ FUN.is?($eq?) || raise('C.eq_fun($eq?): $eq? must be a fun, but got {}'.format($eq?.repr))
4242 }
4343 }
4444 }
diff -r b4a5bcd61fc7 -r a8494bea9a79 src/main/resources/kink-mods/kink/container/HASH_SET.kn
--- a/src/main/resources/kink-mods/kink/container/HASH_SET.kn Sat Feb 08 14:41:35 2020 +0900
+++ b/src/main/resources/kink-mods/kink/container/HASH_SET.kn Sat Feb 08 14:48:26 2020 +0900
@@ -38,7 +38,7 @@
3838 :_read_conf <- {(:config)
3939 CONF.read($config){(:C)
4040 C.req_arg('eq_fun'){(:eq?)
41- FUN.fun?($eq?) || raise('C.eq_fun($eq?): $eq? must be a fun, but got {}'.format($eq?.repr))
41+ FUN.is?($eq?) || raise('C.eq_fun($eq?): $eq? must be a fun, but got {}'.format($eq?.repr))
4242 }
4343 }
4444 }
diff -r b4a5bcd61fc7 -r a8494bea9a79 src/main/resources/kink-mods/kink/io/_SIMPLE_IO_CONF.kn
--- a/src/main/resources/kink-mods/kink/io/_SIMPLE_IO_CONF.kn Sat Feb 08 14:41:35 2020 +0900
+++ b/src/main/resources/kink-mods/kink/io/_SIMPLE_IO_CONF.kn Sat Feb 08 14:48:26 2020 +0900
@@ -6,12 +6,12 @@
66 :read <- {(:config)
77 :Conf = CONF.read($config){(:C)
88 C.req_arg('on_success'){(:success_cont)
9- FUN.fun?($success_cont) || raise(
9+ FUN.is?($success_cont) || raise(
1010 'C.on_success($success_cont): $success_cont must be a fun, but got {}'
1111 .format($success_cont.repr))
1212 }
1313 C.req_arg('on_error'){(:error_cont)
14- FUN.fun?($error_cont) || raise(
14+ FUN.is?($error_cont) || raise(
1515 'C.on_error($error_cont): $error_cont must be a fun, but got {}'
1616 .format($error_cont.repr))
1717 }
@@ -22,17 +22,17 @@
2222 :read_presence <- {(:config)
2323 :Conf = CONF.read($config){(:C)
2424 C.req_arg('on_present'){(:present_cont)
25- FUN.fun?($present_cont) || raise(
25+ FUN.is?($present_cont) || raise(
2626 'C.on_present($present_cont): $present_cont must be a fun, but got {}'
2727 .format($present_cont.repr))
2828 }
2929 C.req_arg('on_absent'){(:absent_cont)
30- FUN.fun?($absent_cont) || raise(
30+ FUN.is?($absent_cont) || raise(
3131 'C.on_absent($absent_cont): $absent_cont must be a fun, but got {}'
3232 .format($absent_cont.repr))
3333 }
3434 C.req_arg('on_error'){(:error_cont)
35- FUN.fun?($error_cont) || raise(
35+ FUN.is?($error_cont) || raise(
3636 'C.on_error($error_cont): $error_cont must be a fun, but got {}'
3737 .format($error_cont.repr))
3838 }
diff -r b4a5bcd61fc7 -r a8494bea9a79 src/main/resources/kink-mods/kink/json/JSON.kn
--- a/src/main/resources/kink-mods/kink/json/JSON.kn Sat Feb 08 14:41:35 2020 +0900
+++ b/src/main/resources/kink-mods/kink/json/JSON.kn Sat Feb 08 14:48:26 2020 +0900
@@ -113,7 +113,7 @@
113113 # If this method is not called,
114114 # kink/CORE$id is used as the success continuation.
115115 'on_success' {[:C](:success_cont)
116- FUN.fun?($success_cont) || raise(
116+ FUN.is?($success_cont) || raise(
117117 'Parse_conf.on_success($success_cont): required fun for $success_cont, but got {}'
118118 .format($success_cont.repr))
119119 C:_success_cont <- $success_cont
@@ -133,7 +133,7 @@
133133 # If this method is not called,
134134 # the default erro continuation, which raises an exception for the error, is used.
135135 'on_error' {[:C](:error_cont)
136- FUN.fun?($error_cont) || raise(
136+ FUN.is?($error_cont) || raise(
137137 'Parse_conf.on_error($error_cont): required fun for $error_cont, but got {}'
138138 .format($error_cont.repr))
139139 C:_error_cont <- $error_cont
diff -r b4a5bcd61fc7 -r a8494bea9a79 src/main/resources/kink-mods/kink/test/TEST.kn
--- a/src/main/resources/kink-mods/kink/test/TEST.kn Sat Feb 08 14:41:35 2020 +0900
+++ b/src/main/resources/kink-mods/kink/test/TEST.kn Sat Feb 08 14:48:26 2020 +0900
@@ -62,7 +62,7 @@
6262 :test <- {(:Name :test_thunk)
6363 STR.is?(Name) || raise(
6464 'TEST.test(Name $test_thunk): required str for Name, but got {}'.format(Name.repr))
65- FUN.fun?($test_thunk) || raise(
65+ FUN.is?($test_thunk) || raise(
6666 'TEST.test(Name $test_thunk): required fun for $test_thunk, but got {}'.format($test_thunk.repr))
6767 _collecting? || raise(
6868 'TEST.test(Name $test_thunk): must be called in invocation of TEST.collect_in')
diff -r b4a5bcd61fc7 -r a8494bea9a79 src/test/java/org/kink_lang/kink/kink_mod_test/FunModTest.java
--- a/src/test/java/org/kink_lang/kink/kink_mod_test/FunModTest.java Sat Feb 08 14:41:35 2020 +0900
+++ b/src/test/java/org/kink_lang/kink/kink_mod_test/FunModTest.java Sat Feb 08 14:48:26 2020 +0900
@@ -1,43 +1,38 @@
11 package org.kink_lang.kink.kink_mod_test;
22
3-import org.junit.AfterClass;
4-import org.junit.Rule;
5-import org.junit.Test;
3+import org.junit.jupiter.api.AfterAll;
4+import org.junit.jupiter.api.Test;
65
76 import static org.assertj.core.api.Assertions.assertThat;
87
98 import org.kink_lang.kink.FunVal;
109 import org.kink_lang.kink.Val;
1110 import org.kink_lang.kink.Vm;
12-import org.kink_lang.kink.internal.test.DisplayTestName;
1311
1412 public class FunModTest {
1513
16- @Rule
17- public final DisplayTestName displayTestName = new DisplayTestName();
18-
1914 private static Vm vm = Vm.newVm();
2015
21- @AfterClass
16+ @AfterAll
2217 public static void nullifyVm() {
2318 FunModTest.vm = null;
2419 }
2520
26- // test kink/FUN.fun?(Val) {{{1
21+ // test kink/FUN.is?(Val) {{{1
2722
2823 @Test
29- public void test_fun_fun_p_true() {
24+ public void test_fun_is_p_true() {
3025 FunVal fun = vm.fun.make().action(c -> vm.nada);
3126 Val result = vm.run(
32- c -> c.call("kink/FUN", vm.sym.getHandle("fun?")).args(fun),
27+ c -> c.call("kink/FUN", vm.sym.getHandle("is?")).args(fun),
3328 v -> v, (msg, traces) -> { throw new AssertionError(msg); });
3429 assertThat(result).isEqualTo(vm.bool.trueVal);
3530 }
3631
3732 @Test
38- public void test_fun_fun_p_false() {
33+ public void test_fun_is_p_false() {
3934 Val result = vm.run(
40- c -> c.call("kink/FUN", vm.sym.getHandle("fun?")).args(vm.nada),
35+ c -> c.call("kink/FUN", vm.sym.getHandle("is?")).args(vm.nada),
4136 v -> v, (msg, traces) -> { throw new AssertionError(msg); });
4237 assertThat(result).isEqualTo(vm.bool.falseVal);
4338 }
Show on old repository browser