• R/O
  • SSH

kink: Commit

Kink runtime


Commit MetaInfo

Revisionbd4338193d4f78df92159693ec7ec202e03478d0 (tree)
Time2020-02-08 14:26:31
Authormiyakawataku
Commitermiyakawataku

Log Message

rename BIN.bin? to BIN.is?

Change Summary

Incremental Difference

diff -r 125679199a2a -r bd4338193d4f src/main/resources/kink-mods/kink/BIN.kn
--- a/src/main/resources/kink-mods/kink/BIN.kn Thu Feb 06 22:33:03 2020 +0900
+++ b/src/main/resources/kink-mods/kink/BIN.kn Sat Feb 08 14:26:31 2020 +0900
@@ -216,7 +216,7 @@
216216 'repr'
217217 ]
218218
219-## BIN.bin?(Val)
219+## BIN.is?(Val)
220220 #
221221 # Returns whether the Val is a bin.
222222 #
@@ -224,9 +224,9 @@
224224 #
225225 # :BIN.require_from('kink/')
226226 # :Bin <- BIN.of(1 2 3)
227-# stdout.print_line(BIN.bin?(Bin).repr) # => true
228-# stdout.print_line(BIN.bin?(42).repr) # => false
229-:bin? <- {(:Val)
227+# stdout.print_line(BIN.is?(Bin).repr) # => true
228+# stdout.print_line(BIN.is?(42).repr) # => false
229+:is? <- {(:Val)
230230 JAVA.wrap(Val).typable_as?(BinVal_class)
231231 }
232232
diff -r 125679199a2a -r bd4338193d4f src/main/resources/kink-mods/kink/io/BIN_INPUT.kn
--- a/src/main/resources/kink-mods/kink/io/BIN_INPUT.kn Thu Feb 06 22:33:03 2020 +0900
+++ b/src/main/resources/kink-mods/kink/io/BIN_INPUT.kn Sat Feb 08 14:26:31 2020 +0900
@@ -26,7 +26,7 @@
2626 # .close method of the result input does nothing,
2727 # thus you don't have to call .close for the input.
2828 :new <- {(:Bin)
29- BIN.bin?(Bin) || raise(
29+ BIN.is?(Bin) || raise(
3030 'BIN_INPUT.new(Bin): required bin for Bin, but got {}'.format(Bin.repr))
3131 new_val(
3232 ... Bin_input_trait
diff -r 125679199a2a -r bd4338193d4f src/main/resources/kink-mods/kink/io/BIN_OUTPUT.kn
--- a/src/main/resources/kink-mods/kink/io/BIN_OUTPUT.kn Thu Feb 06 22:33:03 2020 +0900
+++ b/src/main/resources/kink-mods/kink/io/BIN_OUTPUT.kn Sat Feb 08 14:26:31 2020 +0900
@@ -53,7 +53,7 @@
5353 # Writes Bin to the bin of the output.
5454 'write_bin' {[:B](:Bin :Config_fun.opt)
5555 [:Success_cont_maybe :Dmy] = _SIMPLE_IO_CONF.read(Config_fun.just_or{ {} })
56- BIN.bin?(Bin) || raise(
56+ BIN.is?(Bin) || raise(
5757 'Bin_out.write_bin(Bin ...[$on_error]): required bin for Bin, but got {}'
5858 .format(Bin.repr))
5959 B:Bin <- B.Bin + Bin
diff -r 125679199a2a -r bd4338193d4f src/test/java/org/kink_lang/kink/kink_mod_test/BinModTest.java
--- a/src/test/java/org/kink_lang/kink/kink_mod_test/BinModTest.java Thu Feb 06 22:33:03 2020 +0900
+++ b/src/test/java/org/kink_lang/kink/kink_mod_test/BinModTest.java Sat Feb 08 14:26:31 2020 +0900
@@ -2,36 +2,31 @@
22
33 import java.math.BigDecimal;
44
5-import org.junit.AfterClass;
6-import org.junit.Rule;
7-import org.junit.Test;
5+import org.junit.jupiter.api.AfterAll;
6+import org.junit.jupiter.api.Test;
87
98 import static org.assertj.core.api.Assertions.assertThat;
109
1110 import org.kink_lang.kink.BinVal;
1211 import org.kink_lang.kink.Val;
1312 import org.kink_lang.kink.Vm;
14-import org.kink_lang.kink.internal.test.DisplayTestName;
1513
1614 public class BinModTest {
1715
18- @Rule
19- public final DisplayTestName displayTestName = new DisplayTestName();
20-
2116 private static Vm vm = Vm.newVm();
2217
2318
24- @AfterClass
25- public static void nullifyVM() {
19+ @AfterAll
20+ public static void nullifyVm() {
2621 BinModTest.vm = null;
2722 }
2823
29- // test kink/BIN.bin?(Val) {{{1
24+ // test kink/BIN.is?(Val) {{{1
3025
3126 @Test
3227 public void test_bin_bin_p_true() {
3328 Val result = vm.run(
34- c -> c.call("kink/BIN", vm.sym.getHandle("bin?")).args(vm.bin.of(new byte[0])),
29+ c -> c.call("kink/BIN", vm.sym.getHandle("is?")).args(vm.bin.of(new byte[0])),
3530 v -> v, (msg, traces) -> { throw new AssertionError(msg); });
3631 assertThat(result).isEqualTo(vm.bool.trueVal);
3732 }
@@ -39,7 +34,7 @@
3934 @Test
4035 public void test_bin_bin_p_false() {
4136 Val result = vm.run(
42- c -> c.call("kink/BIN", vm.sym.getHandle("bin?")).args(vm.nada),
37+ c -> c.call("kink/BIN", vm.sym.getHandle("is?")).args(vm.nada),
4338 v -> v, (msg, traces) -> { throw new AssertionError(msg); });
4439 assertThat(result).isEqualTo(vm.bool.falseVal);
4540 }
Show on old repository browser