• R/O
  • SSH

kink: Commit

Kink runtime


Commit MetaInfo

Revision8f40499215223e2da3556120f7f3cb393859d693 (tree)
Time2020-02-10 23:39:29
Authormiyakawataku
Commitermiyakawataku

Log Message

rename THROWER.thrower? to THROWER.is?

Change Summary

Incremental Difference

diff -r 3d5fff6af795 -r 8f4049921522 src/kinkdoc-for-host-mod/kink/host_lang/java/THROWER.kn
--- a/src/kinkdoc-for-host-mod/kink/host_lang/java/THROWER.kn Mon Feb 10 23:32:18 2020 +0900
+++ b/src/kinkdoc-for-host-mod/kink/host_lang/java/THROWER.kn Mon Feb 10 23:39:29 2020 +0900
@@ -24,9 +24,9 @@
2424 # whose object reference is an instance of java.lang.Throwable.
2525 Mod_syms.push_back('new')
2626
27-## THROWER.thrower?(Val)
27+## THROWER.is?(Val)
2828 #
29-# thrower? returns whether Val is a thrower val.
30-Mod_syms.push_back('thrower?')
29+# THROWER.is? returns whether Val is a thrower val.
30+Mod_syms.push_back('is?')
3131
3232 # vim: et sw=2 sts=2 fdm=marker
diff -r 3d5fff6af795 -r 8f4049921522 src/main/java/org/kink_lang/kink/internal/mod/java/ThrowerMod.java
--- a/src/main/java/org/kink_lang/kink/internal/mod/java/ThrowerMod.java Mon Feb 10 23:32:18 2020 +0900
+++ b/src/main/java/org/kink_lang/kink/internal/mod/java/ThrowerMod.java Mon Feb 10 23:39:29 2020 +0900
@@ -45,8 +45,8 @@
4545 Val mod = vm.newVal();
4646 mod.setVar(vm.sym.getHandle("new"),
4747 vm.fun.make("THROWER.new(Exception_java_val)").take(1).action(this::newFun));
48- mod.setVar(vm.sym.getHandle("thrower?"),
49- vm.fun.make("THROWER.thrower?(Val)").take(1).action(this::throwerPFun));
48+ mod.setVar(vm.sym.getHandle("is?"),
49+ vm.fun.make("THROWER.is?(Val)").take(1).action(this::isPFun));
5050 mod.setVar(vm.sym.getHandle("repr"),
5151 vm.fun.constant(vm.str.of(String.format(Locale.ROOT, "Mod(%s)", MOD_NAME))));
5252 return mod;
@@ -86,9 +86,9 @@
8686 }
8787
8888 /**
89- * Implementation of THROWER.thrower?.
89+ * Implementation of THROWER.is?.
9090 */
91- private HostResult throwerPFun(CallContext c) {
91+ private HostResult isPFun(CallContext c) {
9292 return vm.bool.of(c.getArg(0) instanceof ThrowerVal);
9393 }
9494
diff -r 3d5fff6af795 -r 8f4049921522 src/test/java/org/kink_lang/kink/internal/mod/java/ThrowerModTest.java
--- a/src/test/java/org/kink_lang/kink/internal/mod/java/ThrowerModTest.java Mon Feb 10 23:32:18 2020 +0900
+++ b/src/test/java/org/kink_lang/kink/internal/mod/java/ThrowerModTest.java Mon Feb 10 23:39:29 2020 +0900
@@ -67,12 +67,12 @@
6767 }
6868
6969 // }}}1
70- // THROWER.thrower? {{{1
70+ // THROWER.is? {{{1
7171
7272 @Test
73- public void test_thrower_p_returns_true_for_thrower() {
73+ public void test_is_p_returns_true_for_thrower() {
7474 ThrowerVal throwerVal = ThrowerVal.of(vm, new RuntimeException());
75- int handle = vm.sym.getHandle("thrower?");
75+ int handle = vm.sym.getHandle("is?");
7676 Val result = vm.run(c -> c.call("kink/host_lang/java/THROWER", handle).args(throwerVal),
7777 v -> v,
7878 (msg, traces) -> { throw new AssertionError(msg); });
@@ -80,8 +80,8 @@
8080 }
8181
8282 @Test
83- public void test_thrower_p_returns_false_for_nada() {
84- int handle = vm.sym.getHandle("thrower?");
83+ public void test_is_p_returns_false_for_nada() {
84+ int handle = vm.sym.getHandle("is?");
8585 Val result = vm.run(c -> c.call("kink/host_lang/java/THROWER", handle).args(vm.nada),
8686 v -> v,
8787 (msg, traces) -> { throw new AssertionError(msg); });
diff -r 3d5fff6af795 -r 8f4049921522 src/test/kink/host_lang/java/THROWER_test.kn
--- a/src/test/kink/host_lang/java/THROWER_test.kn Mon Feb 10 23:32:18 2020 +0900
+++ b/src/test/kink/host_lang/java/THROWER_test.kn Mon Feb 10 23:39:29 2020 +0900
@@ -42,15 +42,15 @@
4242 }
4343
4444 # }}}1
45-TEST.group('THROWER.thrower?'){ # {{{1
45+TEST.group('THROWER.is?'){ # {{{1
4646 TEST.test('true for thrower'){
4747 :RuntimeException_class = JAVA.class('java.lang.RuntimeException')
4848 :Ex = RuntimeException_class.new([])
49- THROWER.thrower?(THROWER.new(Ex)) || raise('got false')
49+ THROWER.is?(THROWER.new(Ex)) || raise('got false')
5050 }
5151
5252 TEST.test('false for nada'){
53- THROWER.thrower?(nada) && raise('got true')
53+ THROWER.is?(nada) && raise('got true')
5454 }
5555 }
5656
Show on old repository browser