• R/O
  • SSH

kink: Commit

Kink runtime


Commit MetaInfo

Revisionde5072245d26900a9000ab424bb486aa4e788fa4 (tree)
Time2020-02-08 14:34:34
Authormiyakawataku
Commitermiyakawataku

Log Message

rename BOOL.bool? to BOOL.is?

Change Summary

Incremental Difference

diff -r bd4338193d4f -r de5072245d26 src/main/resources/kink-mods/kink/BOOL.kn
--- a/src/main/resources/kink-mods/kink/BOOL.kn Sat Feb 08 14:26:31 2020 +0900
+++ b/src/main/resources/kink-mods/kink/BOOL.kn Sat Feb 08 14:34:34 2020 +0900
@@ -144,17 +144,17 @@
144144 'repr'
145145 ]
146146
147-## BOOL.bool?(Val)
147+## BOOL.is?(Val)
148148 #
149-# BOOL.bool? returns whether the Val is a bool val.
149+# BOOL.is? returns whether the Val is a bool val.
150150 #
151151 # Example:
152152 #
153153 # :BOOL.require_from('kink/')
154-# stdout.print_line(BOOL.bool?(true).repr) # => true
155-# stdout.print_line(BOOL.bool?(false).repr) # => true
156-# stdout.print_line(BOOL.bool?(42).repr) # => false
157-:bool? <- {(:Val)
154+# stdout.print_line(BOOL.is?(true).repr) # => true
155+# stdout.print_line(BOOL.is?(false).repr) # => true
156+# stdout.print_line(BOOL.is?(42).repr) # => false
157+:is? <- {(:Val)
158158 Bool_helper.call_method('isBool' [JAVA.wrap(Val)]).to_kink_bool
159159 }
160160
diff -r bd4338193d4f -r de5072245d26 src/main/resources/kink-mods/kink/json/JSON_VAL.kn
--- a/src/main/resources/kink-mods/kink/json/JSON_VAL.kn Sat Feb 08 14:26:31 2020 +0900
+++ b/src/main/resources/kink-mods/kink/json/JSON_VAL.kn Sat Feb 08 14:34:34 2020 +0900
@@ -38,7 +38,7 @@
3838 # whether Val is a JSON value, in continuation passing style
3939 :_json_val_aux? <- {(:Val :Testing :cont)
4040 branch(
41- { null?(Val) || BOOL.bool?(Val) || NUM.is?(Val) || STR.is?(Val) } {
41+ { null?(Val) || BOOL.is?(Val) || NUM.is?(Val) || STR.is?(Val) } {
4242 cont
4343 }
4444 { VEC.vec?(Val) } {
@@ -103,7 +103,7 @@
103103 :eq? <- {(:X :Y)
104104 branch(
105105 { null?(X) } { null?(Y) }
106- { BOOL.bool?(X) } { BOOL.bool?(Y) && X == Y }
106+ { 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 }
109109 { VEC.vec?(X) } {
diff -r bd4338193d4f -r de5072245d26 src/main/resources/kink-mods/kink/json/_encode/ENCODE.kn
--- a/src/main/resources/kink-mods/kink/json/_encode/ENCODE.kn Sat Feb 08 14:26:31 2020 +0900
+++ b/src/main/resources/kink-mods/kink/json/_encode/ENCODE.kn Sat Feb 08 14:34:34 2020 +0900
@@ -21,7 +21,7 @@
2121 :_encode_val <- {(:Accum :Encoding :Val :Level :Conf :reduce)
2222 branch(
2323 { JSON_VAL.null?(Val) } { reduce(Accum + 'null') }
24- { BOOL.bool?(Val) } { reduce(Accum + Val.repr) }
24+ { BOOL.is?(Val) } { reduce(Accum + Val.repr) }
2525 { NUM.is?(Val) } { reduce(Accum + Val.show) }
2626 { STR.is?(Val) } { reduce(Accum + _encode_str(Val)) }
2727 { VEC.vec?(Val) } { _encode_vec(Accum Encoding Val Level Conf $reduce) }
diff -r bd4338193d4f -r de5072245d26 src/test/java/org/kink_lang/kink/kink_mod_test/BoolModTest.java
--- a/src/test/java/org/kink_lang/kink/kink_mod_test/BoolModTest.java Sat Feb 08 14:26:31 2020 +0900
+++ b/src/test/java/org/kink_lang/kink/kink_mod_test/BoolModTest.java Sat Feb 08 14:34:34 2020 +0900
@@ -1,8 +1,7 @@
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
@@ -12,38 +11,35 @@
1211
1312 public class BoolModTest {
1413
15- @Rule
16- public final DisplayTestName displayTestName = new DisplayTestName();
17-
1814 private static Vm vm = Vm.newVm();
1915
20- @AfterClass
16+ @AfterAll
2117 public static void nullifyVm() {
2218 BoolModTest.vm = null;
2319 }
2420
25- // test kink/BOOL.bool?(Val) {{{1
21+ // test kink/BOOL.is?(Val) {{{1
2622
2723 @Test
28- public void test_bool_bool_p_true_for_true() {
24+ public void test_bool_is_p_true_for_true() {
2925 Val result = vm.run(
30- c -> c.call("kink/BOOL", vm.sym.getHandle("bool?")).args(vm.bool.trueVal),
26+ c -> c.call("kink/BOOL", vm.sym.getHandle("is?")).args(vm.bool.trueVal),
3127 v -> v, (msg, traces) -> { throw new AssertionError(msg); });
3228 assertThat(result).isEqualTo(vm.bool.trueVal);
3329 }
3430
3531 @Test
36- public void test_bool_bool_p_true_for_false() {
32+ public void test_bool_is_p_true_for_false() {
3733 Val result = vm.run(
38- c -> c.call("kink/BOOL", vm.sym.getHandle("bool?")).args(vm.bool.falseVal),
34+ c -> c.call("kink/BOOL", vm.sym.getHandle("is?")).args(vm.bool.falseVal),
3935 v -> v, (msg, traces) -> { throw new AssertionError(msg); });
4036 assertThat(result).isEqualTo(vm.bool.trueVal);
4137 }
4238
4339 @Test
44- public void test_bool_bool_p_false_for_nada() {
40+ public void test_bool_is_p_false_for_nada() {
4541 Val result = vm.run(
46- c -> c.call("kink/BOOL", vm.sym.getHandle("bool?")).args(vm.nada),
42+ c -> c.call("kink/BOOL", vm.sym.getHandle("is?")).args(vm.nada),
4743 v -> v, (msg, traces) -> { throw new AssertionError(msg); });
4844 assertThat(result).isEqualTo(vm.bool.falseVal);
4945 }
Show on old repository browser