Commits

Taku Miyakawa committed 7026703 Merge

Merges a branch which cleans renames command functions which could be confused as attributes

Comments (0)

Files changed (40)

src/bench/tarai.kn

     )
 }
 
-[:X :Y :Z] = Argv.map { \0.int }
+[:X :Y :Z] = Argv.map { \0.parse_int }
 
 :Start = System.nanoTime
 tarai(X Y Z)

src/build/deleteassertion.kn

             }
             { Src_child.name.ends_with?('.class') } {
                 print_line(expand('Class #Src_child => #Dest_child'))
-                :Reader = ClassReader.new(Src_child.bytes)
+                :Reader = ClassReader.new(Src_child.read_bytes)
                 :Writer = ClassWriter.new(Reader ClassWriter.COMPUTE_MAXS + ClassWriter.COMPUTE_FRAMES)
                 :Adapter = ClassVisitor.with(
                     'visitMethod' { (:Access :Name :Desc :Signature :Exceptions)

src/main/java/org/kink_lang/kink/internal/box/InputStreamEnhancer.java

 
         @Define
         public Value
-        bytes( @Receiver InputStream stream , @Optional Value targetSizeVal ) throws IOException {
+        read_bytes( @Receiver InputStream stream , @Optional Value targetSizeVal ) throws IOException {
             if ( targetSizeVal != null ) {
                 int targetSize = targetSizeVal.asInt( 0 , Integer.MAX_VALUE , () -> "\\0" );
                 byte[] buffer = new byte[ targetSize ];
 
         @Define
         public Value
-        text( @Receiver InputStream stream , @Optional Value charsetVal ) throws IOException {
+        read_text( @Receiver InputStream stream , @Optional Value charsetVal ) throws IOException {
             Charset charset = Strings.getCharset( charsetVal );
             char[] buffer = new char[ 1024 ];
             Reader reader = new InputStreamReader( stream , charset );
 
         @Define
         public Value
-        line( @Receiver InputStream stream , @Optional Value charsetVal ) throws IOException {
+        read_line( @Receiver InputStream stream , @Optional Value charsetVal ) throws IOException {
             Charset charset = Strings.getCharset( charsetVal );
             ByteArrayOutputStream output = new ByteArrayOutputStream();
             int ch;
 
         @Define
         public Value
-        lines( @Receiver InputStream stream , @Optional Value charsetVal ) throws IOException {
+        read_lines( @Receiver InputStream stream , @Optional Value charsetVal ) throws IOException {
             Charset charset = Strings.getCharset( charsetVal );
             Reader reader = new InputStreamReader( stream , charset );
             StringBuilder builder = new StringBuilder();
 
         @Define
         public static Value
-        line_seq( @Receiver final InputStream stream , @Optional Value charsetVal ) {
+        read_line_seq( @Receiver final InputStream stream , @Optional Value charsetVal ) {
             final Charset charset = Strings.getCharset( charsetVal );
             final Reader reader = new InputStreamReader( stream , charset );
             final StringBuilder builder = new StringBuilder();

src/main/java/org/kink_lang/kink/internal/box/RandomEnhancer.java

 
 
         @Define
-        public Value random( @Receiver Random rng , Number upperBoundExclusive ) {
+        public Value produce_int( @Receiver Random rng , Number upperBoundExclusive ) {
             return RandomNumbers.randomNumber( rng , upperBoundExclusive );
         }
 
 
 
         @Define
-        public static Value seq( @Receiver final Random rng , final Number upperBoundExclusive ) {
+        public static Value
+        produce_int_seq( @Receiver final Random rng , final Number upperBoundExclusive ) {
             Fun fun = Fun.builder().build( receiver -> {
                 Value numVal = RandomNumbers.randomNumber( rng , upperBoundExclusive );
                 return Value.value( new ValueList( numVal ) );

src/main/java/org/kink_lang/kink/internal/box/StringEnhancer.java

 
 
         @Define
-        public static Value bytes( @Receiver String str , @Optional Value charsetVal ) {
+        public static Value encode( @Receiver String str , @Optional Value charsetVal ) {
             Charset charset = Strings.getCharset( charsetVal );
             return Value.value( str.getBytes( charset ) );
         }
 
 
-        @Define( "int" )
-        public static Value int_( @Receiver String str , @Optional Value radixVal ) {
+        @Define
+        public static Value parse_int( @Receiver String str , @Optional Value radixVal ) {
             int radix = ( radixVal == null
                     ? 10
                     : radixVal.asInt( 2 , 36 , () -> "\\0" ) );
 
 
         @Define
-        public static Value decimal( @Receiver String str ) {
+        public static Value parse_decimal( @Receiver String str ) {
             Checker.check( canParseDecimal( str ) , () -> Messages.cannotParseDecimal( str ) );
             return Numbers.normalize( parseDecimal( str ) );
         }
 
 
         @Define
-        public static Value program( @Receiver String text , String name ) {
+        public static Value to_program( @Receiver String text , String name ) {
             return Value.value( new Program( name , text ) );
         }
 

src/main/java/org/kink_lang/kink/internal/box/ValueListEnhancer.java

 
 
         @Define
-        public static Value bytes( @Receiver Value listVal ) {
+        public static Value to_bytes( @Receiver Value listVal ) {
             List< Value > list = ( (ValueList) listVal.unbox() ).getElements();
             byte[] bytes = new byte[ list.size() ];
             int index = 0;

src/main/java/org/kink_lang/kink/internal/box/number/NumberMethods.java

 
 
     // }}}1
-    // NUM.bin_str {{{1
+    // NUM.to_bin_str {{{1
 
 
     @Define
-    public Value bin_str( @Receiver Number num  , @Optional Number minDigitCount ) {
+    public Value to_bin_str( @Receiver Number num  , @Optional Number minDigitCount ) {
         return Value.value( showBasedOnPowerOf2( num , minDigitCount , 1 , '1' ) );
     }
 
 
     // }}}1
-    // NUM.hex_str {{{1
+    // NUM.to_hex_str {{{1
 
 
     @Define
-    public Value hex_str( @Receiver Number num  , @Optional Number minDigitCount ) {
+    public Value to_hex_str( @Receiver Number num  , @Optional Number minDigitCount ) {
         return Value.value( showBasedOnPowerOf2( num , minDigitCount , 4 , 'f' ) );
     }
 

src/main/kink/KINK_VERSION.kn

     use('USING.using')
     use('org.kink_lang.kink.Value')
     :String = using(Value.getClassLoader.getResourceAsStream('org/kink_lang/kink/version.txt')) {
-        \0.text.trim
+        \0.read_text.trim
     }
-    :Numbers = (String / '.').map { \0.int }
+    :Numbers = (String / '.').map { \0.parse_int }
     [String Numbers]
 }
 

src/main/kink/REPL.kn

     }
     '_input' { > :Repl (:Line)
         Repl.:Script += Line + "\n"
-        :Program = Repl.Script.program(Repl._program_name)
+        :Program = Repl.Script.to_program(Repl._program_name)
         switch(
             { Program.valid? } {
                 _execute(Program Repl.Env).tee { Repl._clear }
             }
         )
     }
-    'run' { > :Repl (:print = $print :print_line = $print_line :readline = { stdin.line })
+    'run' { > :Repl (:print = $print :print_line = $print_line :readline = { stdin.read_line })
         print(Repl._prompt)
         readline.switch(
             '' {

src/main/kink/TEST.kn

     }
     :Test_script_programs = Path_names.concat_map { (:Path_name)
         [Path_name Recursive?].switch(
-            ['-' any] { [stdin.bytes.program('(stdin)')] }
+            ['-' any] { [stdin.read_bytes.to_program('(stdin)')] }
             [any true] {
                 path(Path_name).descendent_paths.select { \0.name =~ %'.*_test\.kn$' } .map { (:Script_path)
-                    Script_path.program
+                    Script_path.to_program
                 }
             }
             [any false] { [path(Path_name).program] }

src/main/kink/_enhance/array_of/Primitive_byte.kn

     use('_internal/COMMON_ARRAY')
     Proto.set_vars(*** COMMON_ARRAY.arraytrait)
 
-    Proto.:program = { > :Array (:Name)
+    Proto.:to_program = { > :Array (:Name)
         use('org.kink_lang.kink.Program')
         Program.of(Name Array)
     }

src/main/kink/_enhance/java/io/OutputStream.kn

     ## stream.print(value charset=Charset.defaultcharset)
     ##   Print the string representation of the value, encoding the charset
     'print' { > :Stream (:Value :Charset = Charset.defaultCharset)
-        Stream.write(Value.to_str.bytes(Charset))
+        Stream.write(Value.to_str.encode(Charset))
     }
 
     ## stream.print_line(value charset=Charset.defaultcharset)

src/main/kink/_enhance/java/io/Reader.kn

 :Lf_code = "\n".code_points.first
 
 :Reader_trait = [
-    ## Reader.line >> String
+    ## Reader.read_line >> String
     ##   Reads a line (till LF) and returns it.
     ##   If the reader reaches the end, the result will be an empty string.
-    'line' { > :Reader ()
+    'read_line' { > :Reader ()
         :Builder = StringBuilder.new
         :loop.do {
             Reader.read.switch(
         }
     }
 
-    ## Reader.lines >> ValueList(String)
+    ## Reader.read_lines >> ValueList(String)
     ##   Reads list of lines.
     ##   Each line contains LF if any.
-    'lines' { > :Reader ()
+    'read_lines' { > :Reader ()
         LIST.extend {
-            Reader.line.switch(
+            Reader.read_line.switch(
                 '' { [] }
                 :Line { [Line] }
             )
         }
     }
 
-    ## Reader.line_seq >> sequence(String)
+    ## Reader.read_line_seq >> sequence(String)
     ##   Returns a sequence which represents lines of the reader
     ##   Each line contains LF if any.
-    'line_seq' { > :Reader ()
+    'read_line_seq' { > :Reader ()
         SEQ.one_shot {
-            Reader.line.switch(
+            Reader.read_line.switch(
                 '' { [] }
                 :Line { [Line] }
             )

src/main/kink/_enhance/java/nio/file/Path.kn

     }
 
     # Reads a text from the file
-    'text' { > :File_path (:Charset)
+    'read_text' { > :File_path (:Charset)
         use('USING.using')
         using(File_path.input_stream) { (:In)
-            :Charset.any?.then { In.text(Charset) } { In.text }
+            :Charset.any?.then { In.read_text(Charset) } { In.read_text }
         }
     }
 
     # Reads bytes from the file
-    'bytes' { > :File_path (:Size)
+    'read_bytes' { > :File_path (:Size)
         use('USING.using')
         using(File_path.input_stream) { (:In)
-            :Size.any?.then { In.bytes(Size) } { In.bytes }
+            :Size.any?.then { In.read_bytes(Size) } { In.read_bytes }
         }
     }
 
     # Reads a program from the file
-    'program' { > :File_path (:Charset)
-        File_path.bytes.program(File_path.name)
+    'to_program' { > :File_path (:Charset)
+        File_path.read_bytes.to_program(File_path.name)
     }
 
     # Writes a line to the file
     }
 
     # Reads lines from the file
-    'lines' { > :File_path (:Charset)
+    'read_lines' { > :File_path (:Charset)
         use('USING.using')
         using(File_path.input_stream) { (:In)
-            :Charset.any?.then { In.lines(Charset) } { In.lines }
+            :Charset.any?.then { In.read_lines(Charset) } { In.read_lines }
         }
     }
 

src/main/kink/_internal/EXPAND.kn

             }
             { \0.group(1).object?? } {
                 :Script = Template.slice(Open Brace_matcher.start)
-                :_fun = Script.program('(expand)').compile
+                :_fun = Script.to_program('(expand)').compile
                 Builder.append(_fun(Env).to_str)
                 parse(Brace_matcher.end)
             }

src/main/kink/_internal/START.kn

     :Args_after_opts = Parser.parse(Args)
     switch(
         { Script_to_be_executed.str?? } {
-            :Program = Script_to_be_executed.program('(execute)')
+            :Program = Script_to_be_executed.to_program('(execute)')
             _run(Program Args_after_opts)
         }
         { Args_after_opts.empty? } {
             REPL.new.run
         }
         { Args_after_opts.first == '-' } {
-            :Program = stdin.bytes.program('(stdin)')
+            :Program = stdin.read_bytes.to_program('(stdin)')
             :Argv = Args_after_opts.drop_head(1)
             _run(Program Argv)
         }
         (any) {
             :File_name = Args_after_opts.first
-            :Program = try { path(File_name).program } .switch(
+            :Program = try { path(File_name).to_program } .switch(
                 [true :Result] { Result }
                 [false :Exception] { die(expand('kink: #{Exception.message}')) }
             )

src/test/bintest/file_mode_test.kn

     Kink_process_builder.redirectError(ProcessBuilder.Redirect.INHERIT)
     :Kink_process = Kink_process_builder.start
     :Bytes = using(Kink_process.getInputStream) { (:Stdout)
-        Stdout.bytes
+        Stdout.read_bytes
     }
     :Status = Kink_process.waitFor
     [Status Bytes]
 
 # Returns an expected text
 :expected_bytes = { ()
-    ClassLoader.getSystemClassLoader.getResourceAsStream('expected.utf8').bytes
+    ClassLoader.getSystemClassLoader.getResourceAsStream('expected.utf8').read_bytes
 }
 
 # Test euc input

src/test/bintest/interact_mode_test.kn

         }
     } .start
     :Stdout_text = using(Kink_process.getInputStream) { (:Stdout)
-        Stdout.text
+        Stdout.read_text
     }
     :Exit_status = Kink_process.waitFor
     Exit_status.check(0)

src/test/bintest/line_separator_test.kn

     Kink_process_builder.redirectError(ProcessBuilder.Redirect.INHERIT)
     :Kink_process = Kink_process_builder.start
     :Text = using(Kink_process.getInputStream) { (:Stdout)
-        Stdout.text
+        Stdout.read_text
     }
     Text.check("voxxx\ttwift\t")
 }

src/test/bintest/stdin_mode_test.kn

         }
     } .start
     :Stdout_bytes = using(Kink_process.getInputStream) { (:Stdout)
-        Stdout.bytes
+        Stdout.read_bytes
     }
     :Exit_status = Kink_process.waitFor
     [Exit_status Stdout_bytes]
 
 # Returns an expected text
 :expected = { ()
-    ClassLoader.getSystemClassLoader.getResourceAsStream('expected.utf8').bytes
+    ClassLoader.getSystemClassLoader.getResourceAsStream('expected.utf8').read_bytes
 }
 
 # Test euc input
 test {
-    :Stdin = path('src/test/stub/kink/bintest/euc.kn').bytes
+    :Stdin = path('src/test/stub/kink/bintest/euc.kn').read_bytes
     execute(['bin/kink' '-'] Stdin).check([0 expected])
 }
 
 # Test sjis input
 test {
-    :Stdin = path('src/test/stub/kink/bintest/sjis.kn').bytes
+    :Stdin = path('src/test/stub/kink/bintest/sjis.kn').read_bytes
     execute(['bin/kink' '-'] Stdin).check([0 expected])
 }
 
 # Test default input
 test {
-    :Stdin = path('src/test/stub/kink/bintest/default.kn').bytes
+    :Stdin = path('src/test/stub/kink/bintest/default.kn').read_bytes
     execute(['bin/kink' '-J-Dfile.encoding=US-ASCII' '-'] Stdin).check([0 expected])
 }

src/test/bintest/test_module_test.kn

+#!/usr/bin/env kink
+# vim: et sw=4 sts=4
+
+# Copyright (c) 2013 Miyakawa Taku
+# 
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+# 
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+# 
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+use('USING.using')
+use('COMMON_PATTERN.not')
+use('TEST.test_group')
+use('TEST.test')
+use('java.lang.Thread')
+use('java.lang.ProcessBuilder')
+
+test_group('TEST module invoked from the command line') {
+    test('with a script which succeeds from stdin') {
+        :Kink_process_builder = ProcessBuilder.new(
+            'bin/kink'
+            '--execute' "module('TEST').main(Argv)"
+            '--' '-'
+        )
+        Kink_process_builder.redirectErrorStream
+        :Kink_process = Kink_process_builder.start
+        Thread.new {
+            using(Kink_process.getOutputStream) { (:Stdin)
+                Stdin.print_line('use("TEST.test")')
+                Stdin.print_line('test("OK") { true }')
+            }
+        } .start
+        :Stdout_text = using(Kink_process.getInputStream) { (:Stdout)
+            Stdout.read_text
+        }
+        :Exit_status = Kink_process.waitFor
+        Stdout_text.lines.loop { (:Line)
+            print('Child (TEST.main/success): ' + Line)
+        }
+        Exit_status.check(0)
+    }
+
+    test('with a script which fails from stdin') {
+        :Kink_process_builder = ProcessBuilder.new(
+            'bin/kink'
+            '--execute' "module('TEST').main(Argv)"
+            '--' '-'
+        )
+        Kink_process_builder.redirectErrorStream
+        :Kink_process = Kink_process_builder.start
+        Thread.new {
+            using(Kink_process.getOutputStream) { (:Stdin)
+                Stdin.print_line('use("TEST.test")')
+                Stdin.print_line('test("Fail") { throw("Fail") }')
+            }
+        } .start
+        :Stdout_text = using(Kink_process.getInputStream) { (:Stdout)
+            Stdout.read_text
+        }
+        :Exit_status = Kink_process.waitFor
+        Stdout_text.lines.loop { (:Line)
+            print('Child (TEST.main/fail): ' + Line)
+        }
+        Exit_status.check(not(0))
+    }
+}

src/test/java/org/kink_lang/kink/internal/box/RandomEnhancerTest.java

 import org.kink_lang.kink.GetSite;
 
 import java.util.Random;
+import java.util.function.IntSupplier;
 
 import org.junit.Test;
 import static org.junit.Assert.assertThat;
 
 
     @Test
-    public void make_random() {
+    public void test_produce_int() {
+        GetSite produce_int = new GetSite( "produce_int" );
         Value rngVal = Value.value( new Random( 0 ) );
-        assertThat( rngVal.call( new GetSite( "random" ) , Value.value( 42L ) ).asInt( () -> "" ) < 42
-                , is( true ) );
-        assertThat( rngVal.call( new GetSite( "random" ) , Value.value( 42L ) ).asInt( () -> "" ) < 42
-                , is( true ) );
-        assertThat( rngVal.call( new GetSite( "random" ) , Value.value( 42L ) ).asInt( () -> "" ) < 42
-                , is( true ) );
+        IntSupplier produceInt = () -> {
+            return rngVal.call( produce_int , Value.value( 42L ) ).asInt( () -> "" );
+        };
+        assertThat( produceInt.getAsInt() < 42 , is( true ) );
+        assertThat( produceInt.getAsInt() < 42 , is( true ) );
+        assertThat( produceInt.getAsInt() < 42 , is( true ) );
     }
 
 
     @Test
     public void random_seq() {
         Value rngVal = Value.value( new Random( 0 ) );
-        Value seq = rngVal.call( new GetSite( "seq" ) , Value.value( 42L ) );
+        Value seq = rngVal.call( new GetSite( "produce_int_seq" ) , Value.value( 42L ) );
         Value first5Numbers = seq.call( new GetSite( "head" ) , Value.value( 5 ) );
         Value first5NumbersList = first5Numbers.call( new GetSite( "to_list" ) );
         for ( int num : first5NumbersList.asList( () -> "" ).unboxElements( Integer.class ) ) {

src/test/java/org/kink_lang/kink/internal/box/StringEnhancerTest.java

 
 
     @Test
-    public void lines_terminated_by_lf() {
+    public void test_lines_terminated_by_lf() {
         Value str = Value.value( "foo\nbar\n\nbaz\n\n" );
         Value lines = str.call( LINES );
         assertThat( lines.asList( () -> "" ).unboxElements( String.class )
 
 
     @Test
-    public void lines_not_terminated_by_lf() {
+    public void test_lines_not_terminated_by_lf() {
         Value str = Value.value( "foo\nbar\n\nbaz" );
         Value lines = str.call( LINES );
         assertThat( lines.asList( () -> "" ).unboxElements( String.class )
     }
 
 
-    /** GetSite of {@code bytes}. */
-    private static final GetSite BYTES = new GetSite( "bytes" );
+    /** GetSite of {@code encode}. */
+    private static final GetSite ENCODE = new GetSite( "encode" );
 
 
     @Test
-    public void bytes_without_charset_name() {
+    public void test_encode_without_charset_name() {
         Value str = Value.value( "foobar" );
-        Value bytes = str.call( BYTES );
+        Value bytes = str.call( ENCODE );
         assertThat( bytes.as( byte[].class , () -> "" )
                 , is( "foobar".getBytes( Charset.defaultCharset() ) ) );
     }
 
 
     @Test
-    public void bytes_with_charset_name() {
+    public void test_encode_with_charset_name() {
         Value str = Value.value( "foobar" );
-        Value bytes = str.call( BYTES , Value.value( "UTF-16BE" ) );
+        Value bytes = str.call( ENCODE , Value.value( "UTF-16BE" ) );
         assertThat( bytes.as( byte[].class , () -> "" )
                 , is( "foobar".getBytes( Charset.forName( "UTF-16BE" ) ) ) );
     }
 
 
     @Test
-    public void bytes_with_charset() {
+    public void test_encode_with_charset() {
         Value str = Value.value( "foobar" );
-        Value bytes = str.call( BYTES , Value.value( Charset.forName( "UTF-16BE" ) ) );
+        Value bytes = str.call( ENCODE , Value.value( Charset.forName( "UTF-16BE" ) ) );
         assertThat( bytes.as( byte[].class , () -> "" )
                 , is( "foobar".getBytes( Charset.forName( "UTF-16BE" ) ) ) );
     }
 
 
-    /** GetSite of {@code int}. */
-    private static final GetSite INT = new GetSite( "int" );
+    /** GetSite of {@code parse_int}. */
+    private static final GetSite PARSE_INT = new GetSite( "parse_int" );
 
 
     @Test
-    public void int_witout_radix_test() {
-        Value result = Value.value( "42" ).call( INT );
+    public void test_parse_int_witout_radix_test() {
+        Value result = Value.value( "42" ).call( PARSE_INT );
         assertThat( result.asInt( () -> "" ) , is( 42 ) );
     }
 
 
     @Test
-    public void int_big_integer() {
-        Value result = Value.value( "9999999999999999" ).call( INT );
+    public void test_parse_int_big_integer() {
+        Value result = Value.value( "9999999999999999" ).call( PARSE_INT );
         assertThat( Numbers.toBigInteger( (Number) result.unbox() )
                 , is( (Object) BigInteger.valueOf( 9999999999999999L ) ) );
     }
 
 
     @Test( expected = KinkException.class )
-    public void int_witout_radix_throws_exception_for_illegal_input() {
-        methods.int_( "xxx" , null );
+    public void test_parse_int_witout_radix_throws_exception_for_illegal_input() {
+        methods.parse_int( "xxx" , null );
     }
 
 
 
 
     @Test
-    public void int_with_radix_test() {
-        Value result = Value.value( "ff" ).call( INT , Value.value( 16 ) );
+    public void test_parse_int_with_radix_test() {
+        Value result = Value.value( "ff" ).call( PARSE_INT , Value.value( 16 ) );
         assertThat( result.asInt( () -> "" ) , is( 0xff ) );
     }
 
 
     @Test( expected = KinkException.class )
-    public void int_wit_radix_throws_exception_for_illegal_input() {
-        methods.int_( "xxx" , Value.value( 16 ) );
+    public void test_parse_int_wit_radix_throws_exception_for_illegal_input() {
+        methods.parse_int( "xxx" , Value.value( 16 ) );
     }
 
 
 
 
     @Test( expected = KinkException.class )
-    public void int_wit_radix_throws_exception_for_too_small_radix() {
-        methods.int_( "11" , Value.value( 1 ) );
+    public void test_parse_int_wit_radix_throws_exception_for_too_small_radix() {
+        methods.parse_int( "11" , Value.value( 1 ) );
     }
 
 
     @Test( expected = KinkException.class )
-    public void int_wit_radix_throws_exception_for_too_big_radix() {
-        methods.int_( "11" , Value.value( 37 ) );
+    public void test_parse_int_wit_radix_throws_exception_for_too_big_radix() {
+        methods.parse_int( "11" , Value.value( 37 ) );
     }
 
 
     }
 
 
-    /** GetSite of {@code decimal}. */
-    private static final GetSite DECIMAL = new GetSite( "decimal" );
+    /** GetSite of {@code parse_decimal}. */
+    private static final GetSite PARSE_DECIMAL = new GetSite( "parse_decimal" );
 
 
     @Test
-    public void cast_decimal() {
-        assertThat( Value.value( "123.456" ).call( DECIMAL ).unbox()
+    public void test_parse_decimal() {
+        assertThat( Value.value( "123.456" ).call( PARSE_DECIMAL ).unbox()
                 , is( (Object) new BigDecimal( "123.456" ) ) );
     }
 
 
     @Test( expected = KinkException.class )
-    public void cannot_convert_invalid_format_to_decimal() {
-        methods.decimal( "foobar" );
+    public void test_parse_decimal_cannot_convert_invalid_format_to_decimal() {
+        methods.parse_decimal( "foobar" );
     }
 
 
-    /** GetSite of {@code program}. */
-    private static final GetSite PROGRAM = new GetSite( "program" );
+    /** GetSite of {@code to_program}. */
+    private static final GetSite TO_PROGRAM = new GetSite( "to_program" );
 
 
     @Test
-    public void program_returns_program() {
+    public void test_to_program_returns_program() {
         Value name = Value.value( "some.kn" );
-        Value program = Value.value( "2 + 3" ).call( PROGRAM , name );
+        Value program = Value.value( "2 + 3" ).call( TO_PROGRAM , name );
         assertThat( program.as( Program.class , () -> "" )
                 , is( new Program( "some.kn" , "2 + 3" ) ) );
     }

src/test/java/org/kink_lang/kink/internal/box/ValueListEnhancerTest.java

     }
 
 
-    /** GetSite of {@code bytes}. */
-    private static final GetSite BYTES = new GetSite( "bytes" );
+    /** GetSite of {@code to_bytes}. */
+    private static final GetSite TO_BYTES = new GetSite( "to_bytes" );
 
 
     @Test
-    public void bytes_returns_bytes() {
+    public void test_to_bytes_returns_bytes() {
         Value listVal = box(
                 Value.value( 0x00 )
                 , Value.value( 0x10 )
                 , Value.value( 0x20 ) );
-        Value result = listVal.call( BYTES );
+        Value result = listVal.call( TO_BYTES );
         assertThat(
                 result.as( byte[].class , () -> "" )
                 , is( new byte[] { 0x00 , 0x10 , 0x20 } ) );

src/test/java/org/kink_lang/kink/internal/box/number/NumberMethodsTest.java

 
 
     // }}}1
-    // Test NUM.bin_str {{{1
-
-
-    /** Calls NUM.bin_str with valid values. */
+    // Test NUM.to_bin_str {{{1
+
+
+    /** Calls NUM.to_bin_str with valid values. */
     @Test
-    public void test_bin_str() {
-        assertThat( bin_str( 0b111 ) , is( "111" ) );
-        assertThat( bin_str( - 0b111 ) , is( "..001" ) );
-        assertThat( bin_str( 0b111 , 3 ) , is( "111" ) );
-        assertThat( bin_str( - 0b111 , 3 ) , is( "..001" ) );
-        assertThat( bin_str( 0b111 , 5 ) , is( "00111" ) );
-        assertThat( bin_str( - 0b111 , 5 ) , is( "..11001" ) );
-        assertThat( bin_str( - 0b100 , 0 ) , is( "..00" ) );
-        assertThat( bin_str( 0 ) , is( "0" ) );
-        assertThat( bin_str( - 1 ) , is( "..1" ) );
-        assertThat( bin_str( 0 , 0 ) , is( "" ) );
-        assertThat( bin_str( - 1 , 0 ) , is( ".." ) );
-        assertThat( bin_str( 0 , - 1 ) , is( "" ) );
-        assertThat( bin_str( - 1 , - 1 ) , is( ".." ) );
+    public void test_to_bin_str() {
+        assertThat( to_bin_str( 0b111 ) , is( "111" ) );
+        assertThat( to_bin_str( - 0b111 ) , is( "..001" ) );
+        assertThat( to_bin_str( 0b111 , 3 ) , is( "111" ) );
+        assertThat( to_bin_str( - 0b111 , 3 ) , is( "..001" ) );
+        assertThat( to_bin_str( 0b111 , 5 ) , is( "00111" ) );
+        assertThat( to_bin_str( - 0b111 , 5 ) , is( "..11001" ) );
+        assertThat( to_bin_str( - 0b100 , 0 ) , is( "..00" ) );
+        assertThat( to_bin_str( 0 ) , is( "0" ) );
+        assertThat( to_bin_str( - 1 ) , is( "..1" ) );
+        assertThat( to_bin_str( 0 , 0 ) , is( "" ) );
+        assertThat( to_bin_str( - 1 , 0 ) , is( ".." ) );
+        assertThat( to_bin_str( 0 , - 1 ) , is( "" ) );
+        assertThat( to_bin_str( - 1 , - 1 ) , is( ".." ) );
     }
 
 
     @Test( expected = KinkException.class )
     public void test_bin_str_kicks_not_integral_numbers() {
-        methods.bin_str( 0.5 , null );
+        methods.to_bin_str( 0.5 , null );
     }
 
 
     /**
-     * Calls {@code num.bin_str} and returns the result as a string.
+     * Calls {@code num.to_bin_str} and returns the result as a string.
      */
-    private static String bin_str( Number num ) {
+    private static String to_bin_str( Number num ) {
         Value numVal = Value.value( num );
-        return numVal.call( new GetSite( "bin_str" ) ).asString( () -> "" );
+        return numVal.call( new GetSite( "to_bin_str" ) ).asString( () -> "" );
     }
 
 
     /**
-     * Calls {@code num.bin_str(digitCount)} and returns the result as a string.
+     * Calls {@code num.to_bin_str(digitCount)} and returns the result as a string.
      */
-    private static String bin_str( Number num , int digitCount ) {
+    private static String to_bin_str( Number num , int digitCount ) {
         Value numVal = Value.value( num );
         Value digitCountVal = Value.value( digitCount );
-        return numVal.call( new GetSite( "bin_str" ) , digitCountVal ).asString( () -> "" );
+        return numVal.call( new GetSite( "to_bin_str" ) , digitCountVal ).asString( () -> "" );
     }
 
 
     // }}}1
-    // Test NUM.hex_str {{{1
+    // Test NUM.to_hex_str {{{1
 
 
     /** Calls NUM.hextr with valid values. */
     @Test
-    public void test_hex_str() {
-        assertThat( hex_str( 0xfff ) , is( "fff" ) );
-        assertThat( hex_str( - 0xfff ) , is( "..001" ) );
-        assertThat( hex_str( 0xfff , 3 ) , is( "fff" ) );
-        assertThat( hex_str( - 0xfff , 3 ) , is( "..001" ) );
-        assertThat( hex_str( 0xfff , 5 ) , is( "00fff" ) );
-        assertThat( hex_str( - 0xfff , 5 ) , is( "..ff001" ) );
-        assertThat( hex_str( - 0x100 , 0 ) , is( "..00" ) );
-        assertThat( hex_str( 0 ) , is( "0" ) );
-        assertThat( hex_str( - 1 ) , is( "..f" ) );
-        assertThat( hex_str( 0 , 0 ) , is( "" ) );
-        assertThat( hex_str( - 1 , 0 ) , is( ".." ) );
-        assertThat( hex_str( 0 , - 1 ) , is( "" ) );
-        assertThat( hex_str( - 1 , - 1 ) , is( ".." ) );
+    public void test_to_hex_str() {
+        assertThat( to_hex_str( 0xfff ) , is( "fff" ) );
+        assertThat( to_hex_str( - 0xfff ) , is( "..001" ) );
+        assertThat( to_hex_str( 0xfff , 3 ) , is( "fff" ) );
+        assertThat( to_hex_str( - 0xfff , 3 ) , is( "..001" ) );
+        assertThat( to_hex_str( 0xfff , 5 ) , is( "00fff" ) );
+        assertThat( to_hex_str( - 0xfff , 5 ) , is( "..ff001" ) );
+        assertThat( to_hex_str( - 0x100 , 0 ) , is( "..00" ) );
+        assertThat( to_hex_str( 0 ) , is( "0" ) );
+        assertThat( to_hex_str( - 1 ) , is( "..f" ) );
+        assertThat( to_hex_str( 0 , 0 ) , is( "" ) );
+        assertThat( to_hex_str( - 1 , 0 ) , is( ".." ) );
+        assertThat( to_hex_str( 0 , - 1 ) , is( "" ) );
+        assertThat( to_hex_str( - 1 , - 1 ) , is( ".." ) );
     }
 
 
     @Test( expected = KinkException.class )
     public void test_hex_str_kicks_not_integral_numbers() {
-        methods.hex_str( 0.5 , null );
+        methods.to_hex_str( 0.5 , null );
     }
 
 
     /**
-     * Calls {@code num.hex_str} and returns the result as a string.
+     * Calls {@code num.to_hex_str} and returns the result as a string.
      */
-    private static String hex_str( Number num ) {
+    private static String to_hex_str( Number num ) {
         Value numVal = Value.value( num );
-        return numVal.call( new GetSite( "hex_str" ) ).asString( () -> "" );
+        return numVal.call( new GetSite( "to_hex_str" ) ).asString( () -> "" );
     }
 
 
     /**
-     * Calls {@code num.hex_str(digitCount)} and returns the result as a string.
+     * Calls {@code num.to_hex_str(digitCount)} and returns the result as a string.
      */
-    private static String hex_str( Number num , int digitCount ) {
+    private static String to_hex_str( Number num , int digitCount ) {
         Value numVal = Value.value( num );
         Value digitCountVal = Value.value( digitCount );
-        return numVal.call( new GetSite( "hex_str" ) , digitCountVal ).asString( () -> "" );
+        return numVal.call( new GetSite( "to_hex_str" ) , digitCountVal ).asString( () -> "" );
     }
 
 

src/test/kink/RANDOM_NUMBER_GENERATOR_test.kn

 
 :_10_numbers_below_100_with_seed = { (:Seed)
     :Rng = RANDOM_NUMBER_GENERATOR.new(Seed)
-    Rng.seq(100).head(10).to_list
+    Rng.produce_int_seq(100).head(10).to_list
 }
 
 test_group('Random numbers with an integer seed') {
 
 test('Random numbers with an auto generated seed') {
     use('COMMON_PATTERN.lt')
-    :Numbers = RANDOM_NUMBER_GENERATOR.new.seq(100).head(10).to_list
+    :Numbers = RANDOM_NUMBER_GENERATOR.new.produce_int_seq(100).head(10).to_list
     Numbers.check([lt(100)] * 10)
 }

src/test/kink/TEST_test.kn

 
     test_group('after it loads a program') { # {{{2
         before {
-            :Program = 'use("TEST.test") test("Test in program")'.program('test_in_program.kn')
+            :Program = 'use("TEST.test") test("Test in program")'.to_program('test_in_program.kn')
             Group.load(Program)
         }
 

src/test/kink/_internal/RUN_ALL_TEST.kn

         :Program_files = Dir.descendent_paths.select { (:F)
             F.file? && F.name =~ %'.*/[^/]*_test.kn'
         }
-        :Programs = Program_files.map { \0.program }
+        :Programs = Program_files.map { \0.to_program }
         Programs.loop {
             Test_group.load(\0)
         }

src/test/kink/_internal/START_test.kn

 
 # 'run' returns the result of the program
 test {
-    :Program = '2 * 3 * 7'.program('starttest.kn')
+    :Program = '2 * 3 * 7'.to_program('starttest.kn')
     START._run(Program []).check(2 * 3 * 7)
 }
 
 # 'run' passes arguments
 test {
-    :Program = 'Argv * 2'.program('starttest')
+    :Program = 'Argv * 2'.to_program('starttest')
     START._run(Program ['twift' 'voxxx']).check(['twift' 'voxxx' 'twift' 'voxxx'])
 }
 
 # 'run' makes the string representation of the environment
 test {
-    :Program = 'show'.program('starttest.kn')
+    :Program = 'show'.to_program('starttest.kn')
     START._run(Program []).check(%'<env:#program.name=''starttest.kn'':hash=([0-9]+|\(-[0-9]+\))>')
 }
 
 # 'run' cuts the traces
 test {
-    :Program = 'traces'.program('starttest.kn')
+    :Program = 'traces'.to_program('starttest.kn')
     :Traces = START._run(Program [])
     Traces.drop_tail(1).check([])
 }

src/test/kink/enhancertest/Area_test.kn

 use('TEST.test')
 
 test {
-    :Program = '10 + 20'.program('add.kn')
+    :Program = '10 + 20'.to_program('add.kn')
     :Area = Program.area(0 Program.text.count)
     Area.program.check(Program)
     Area.start.check(0)
 
 # Tests start_of_program?
 test {
-    :Program = '10 + 20'.program('add.kn')
+    :Program = '10 + 20'.to_program('add.kn')
     Program.area(0 2).start_of_program?.check(true)
     Program.area(3 4).start_of_program?.check(false)
 }
 
 # Tests end_of_program?
 test {
-    :Program = '10 + 20'.program('add.kn')
+    :Program = '10 + 20'.to_program('add.kn')
     Program.area(0 2).end_of_program?.check(false)
     Program.area(3 Program.text.count).end_of_program?.check(true)
 }

src/test/kink/enhancertest/InputStream_test.kn

 }
 
 test {
-    :Stream = bytes_stream([0 1 2 3].bytes)
-    Stream.bytes.check([0 1 2 3].bytes)
+    :Stream = bytes_stream([0 1 2 3].to_bytes)
+    Stream.read_bytes.check([0 1 2 3].to_bytes)
 }
 
 test {
-    :Stream = bytes_stream([0 1 2 3 4 5 6 7 8 9].bytes)
-    Stream.bytes(4).check([0 1 2 3].bytes)
+    :Stream = bytes_stream([0 1 2 3 4 5 6 7 8 9].to_bytes)
+    Stream.read_bytes(4).check([0 1 2 3].to_bytes)
 }
 
 test {
-    :Stream = bytes_stream([0 1 2 3 4 5 6 7 8 9].bytes)
-    Stream.bytes(20).check([0 1 2 3 4 5 6 7 8 9].bytes)
+    :Stream = bytes_stream([0 1 2 3 4 5 6 7 8 9].to_bytes)
+    Stream.read_bytes(20).check([0 1 2 3 4 5 6 7 8 9].to_bytes)
 }
 
 test {
-    :Input = bytes_stream("foo\nbar\nbaz\n".bytes)
-    Input.text.check("foo\nbar\nbaz\n")
+    :Input = bytes_stream("foo\nbar\nbaz\n".encode)
+    Input.read_text.check("foo\nbar\nbaz\n")
 }
 
 test {
-    :Input = bytes_stream("foo\nbar\nbaz\n".bytes('UTF-16'))
-    Input.text('UTF-16').check("foo\nbar\nbaz\n")
+    :Input = bytes_stream("foo\nbar\nbaz\n".encode('UTF-16'))
+    Input.read_text('UTF-16').check("foo\nbar\nbaz\n")
 }
 
 test {
-    :Input = bytes_stream("foo\nbar\nbaz\n".bytes)
-    Input.lines.check(["foo\n" "bar\n" "baz\n"])
+    :Input = bytes_stream("foo\nbar\nbaz\n".encode)
+    Input.read_lines.check(["foo\n" "bar\n" "baz\n"])
 }
 
 test {
-    :Input = bytes_stream("foo\nbar\nbaz".bytes)
-    Input.lines.check(["foo\n" "bar\n" "baz"])
+    :Input = bytes_stream("foo\nbar\nbaz".encode)
+    Input.read_lines.check(["foo\n" "bar\n" "baz"])
 }
 
 test {
-    :Input = bytes_stream("foo\r\nbar\r\nbaz\r\n".bytes)
-    Input.lines.check(["foo\r\n" "bar\r\n" "baz\r\n"])
+    :Input = bytes_stream("foo\r\nbar\r\nbaz\r\n".encode)
+    Input.read_lines.check(["foo\r\n" "bar\r\n" "baz\r\n"])
 }
 
 test {
-    :Input = bytes_stream("foo\r\nbar\r\nbaz".bytes)
-    Input.lines.check(["foo\r\n" "bar\r\n" "baz"])
+    :Input = bytes_stream("foo\r\nbar\r\nbaz".encode)
+    Input.read_lines.check(["foo\r\n" "bar\r\n" "baz"])
 }
 
 test {
-    :Input = bytes_stream("foo\nbar\nbaz\n".bytes('UTF-16'))
-    Input.lines('UTF-16').check(["foo\n" "bar\n" "baz\n"])
+    :Input = bytes_stream("foo\nbar\nbaz\n".encode('UTF-16'))
+    Input.read_lines('UTF-16').check(["foo\n" "bar\n" "baz\n"])
 }
 
 test {
-    :Input = bytes_stream("foo\nbar\nbaz".bytes('UTF-16'))
-    Input.lines('UTF-16').check(["foo\n" "bar\n" "baz"])
+    :Input = bytes_stream("foo\nbar\nbaz".encode('UTF-16'))
+    Input.read_lines('UTF-16').check(["foo\n" "bar\n" "baz"])
 }
 
 test {
-    :Input = bytes_stream("foo\nbar\nbaz\n".bytes)
-    Input.line.check("foo\n")
-    Input.line.check("bar\n")
-    Input.line.check("baz\n")
+    :Input = bytes_stream("foo\nbar\nbaz\n".encode)
+    Input.read_line.check("foo\n")
+    Input.read_line.check("bar\n")
+    Input.read_line.check("baz\n")
 }
 
 test {
-    :Input = bytes_stream("foo\nbar\nbaz\n".bytes('UTF-8'))
-    Input.line('UTF-8').check("foo\n")
-    Input.line('UTF-8').check("bar\n")
-    Input.line('UTF-8').check("baz\n")
+    :Input = bytes_stream("foo\nbar\nbaz\n".encode('UTF-8'))
+    Input.read_line('UTF-8').check("foo\n")
+    Input.read_line('UTF-8').check("bar\n")
+    Input.read_line('UTF-8').check("baz\n")
 }
 
 test {
-    :Input = bytes_stream("foo\nbar\nbaz".bytes)
-    Input.line.check("foo\n")
-    Input.line.check("bar\n")
-    Input.line.check("baz")
+    :Input = bytes_stream("foo\nbar\nbaz".encode)
+    Input.read_line.check("foo\n")
+    Input.read_line.check("bar\n")
+    Input.read_line.check("baz")
 }
 
 test {
-    :Input = bytes_stream("foo\nbar\nbaz".bytes('UTF-8'))
-    Input.line('UTF-8').check("foo\n")
-    Input.line('UTF-8').check("bar\n")
-    Input.line('UTF-8').check("baz")
+    :Input = bytes_stream("foo\nbar\nbaz".encode('UTF-8'))
+    Input.read_line('UTF-8').check("foo\n")
+    Input.read_line('UTF-8').check("bar\n")
+    Input.read_line('UTF-8').check("baz")
 }
 
 test {
-    :Stream = bytes_stream("foo\nbar\nbaz\n".bytes)
-    :Seq = Stream.line_seq
+    :Stream = bytes_stream("foo\nbar\nbaz\n".encode)
+    :Seq = Stream.read_line_seq
     Seq.to_list.check(["foo\n" "bar\n" "baz\n"])
 }
 
 test {
-    :Stream = bytes_stream("foo\nbar\nbaz\n".bytes('UTF-8'))
-    :Seq = Stream.line_seq('UTF-8')
+    :Stream = bytes_stream("foo\nbar\nbaz\n".encode('UTF-8'))
+    :Seq = Stream.read_line_seq('UTF-8')
     Seq.to_list.check(["foo\n" "bar\n" "baz\n"])
 }
 
 test {
-    :Stream = bytes_stream("foo\nbar\nbaz".bytes)
-    :Seq = Stream.line_seq
+    :Stream = bytes_stream("foo\nbar\nbaz".encode)
+    :Seq = Stream.read_line_seq
     Seq.to_list.check(["foo\n" "bar\n" "baz"])
 }
 
 test {
-    :Stream = bytes_stream("foo\nbar\nbaz".bytes('UTF-8'))
-    :Seq = Stream.line_seq('UTF-8')
+    :Stream = bytes_stream("foo\nbar\nbaz".encode('UTF-8'))
+    :Seq = Stream.read_line_seq('UTF-8')
     Seq.to_list.check(["foo\n" "bar\n" "baz"])
 }

src/test/kink/enhancertest/OutputStream_test.kn

 test {
     using(_byte_stream) { (:Stream)
         Stream.print('ping!')
-        Stream.toByteArray.check( 'ping!'.bytes )
+        Stream.toByteArray.check( 'ping!'.encode )
     }
 }
 
 test {
     using(_byte_stream) { (:Stream)
         Stream.print('ping!' 'UTF-16BE')
-        Stream.toByteArray.check('ping!'.bytes('UTF-16BE'))
+        Stream.toByteArray.check('ping!'.encode('UTF-16BE'))
     }
 }
 
 test {
     using(_byte_stream) { (:Stream)
         Stream.print(42)
-        Stream.toByteArray.check('42'.bytes)
+        Stream.toByteArray.check('42'.encode)
     }
 }
 
 test {
     using(_byte_stream) { (:Stream)
         Stream.print_line('ping!')
-        Stream.toByteArray.check(("ping!" + System.getProperty('line.separator')).bytes)
+        Stream.toByteArray.check(("ping!" + System.getProperty('line.separator')).encode)
     }
 }
 
 test {
     using(_byte_stream) { (:Stream)
         Stream.print_line('ping!' 'UTF-16BE')
-        Stream.toByteArray.check(("ping!" + System.getProperty('line.separator')).bytes('UTF-16BE'))
+        Stream.toByteArray.check(("ping!" + System.getProperty('line.separator')).encode('UTF-16BE'))
     }
 }
 
 test {
     using(_byte_stream) { (:Stream)
         Stream.print_line(42)
-        Stream.toByteArray.check(("42" + System.getProperty('line.separator')).bytes)
+        Stream.toByteArray.check(("42" + System.getProperty('line.separator')).encode)
     }
 }

src/test/kink/enhancertest/Path_test.kn

         File.file?.check(false)
         File.make_file
         File.file?.check(true)
-        File.bytes.check(byte.array())
+        File.read_bytes.check(byte.array())
     }
 }
 
             :Link = Work_dir + 'link'
             File.write_bytes(Bytes)
             Link.make_link(File)
-            Link.bytes.check(Bytes)
+            Link.read_bytes.check(Bytes)
             File.delete
-            Link.bytes.check(Bytes)
+            Link.read_bytes.check(Bytes)
         }
     }
 }
             Symlink.make_symlink(Paths.get('target_file'))
             Symlink.symlink?.check(true)
             Symlink.symlink_target.check(Paths.get('target_file'))
-            Symlink.bytes.check(Bytes)
+            Symlink.read_bytes.check(Bytes)
             File.delete
-            check_thrown { Symlink.bytes }
+            check_thrown { Symlink.read_bytes }
         }
     }
 }
             File.write_bytes(Bytes)
             File.toFile.setReadable(true)
             File.readable?.check(true)
-            File.bytes.check(Bytes)
+            File.read_bytes.check(Bytes)
             File.toFile.setReadable(false)
             File.readable?.check(false)
-            check_thrown { File.bytes }
+            check_thrown { File.read_bytes }
         }
     }
 }
             File.toFile.setWritable(true)
             File.writable?.check(true)
             File.write_bytes_appending(Bytes)
-            File.bytes.check(Bytes)
+            File.read_bytes.check(Bytes)
             File.toFile.setWritable(false)
             check_thrown { File.write_bytes_appending(Bytes) }
             File.toFile.setWritable(true)
         using(File.output_stream) { (:Out)
             Out.write(First)
         }
-        File.bytes.check(First)
+        File.read_bytes.check(First)
         using(File.output_stream) { (:Out)
             Out.write(Second)
         }
-        File.bytes.check(Second)
+        File.read_bytes.check(Second)
     }
 }
 
         using(File.output_stream_appending) { (:Out)
             Out.write(First)
         }
-        File.bytes.check(First)
+        File.read_bytes.check(First)
         using(File.output_stream_appending) { (:Out)
             Out.write(Second)
         }
-        File.bytes.check(byte.array(*** First.to_list *** Second.to_list))
+        File.read_bytes.check(byte.array(*** First.to_list *** Second.to_list))
     }
 }
 
         :File = Work_dir + 'file'
         File.write_bytes(Bytes)
         using(File.input_stream) { (:In)
-            In.bytes.check(Bytes)
+            In.read_bytes.check(Bytes)
         }
     }
 }
         # Create a new file
         :Result = File.write_bytes(First)
         Result.check(File)
-        File.bytes.check(First)
+        File.read_bytes.check(First)
         # The content is truncated
         :Result = File.write_bytes(Second)
         Result.check(File)
-        File.bytes.check(Second)
+        File.read_bytes.check(Second)
     }
 }
 
         # Create a new file
         :Result = File.write_bytes_appending(First)
         Result.check(File)
-        File.bytes.check(First)
+        File.read_bytes.check(First)
         # The content is truncated
         :Result = File.write_bytes_appending(Second)
         Result.check(File)
-        File.bytes.check(byte.array(*** First.to_list *** Second.to_list))
+        File.read_bytes.check(byte.array(*** First.to_list *** Second.to_list))
     }
 }
 
         # Create a new file
         :Result = File.write_bytes(Bytes)
         Result.check(File)
-        File.bytes(5).check(Bytes.slice(0 5))
-        File.bytes(20).check(Bytes)
+        File.read_bytes(5).check(Bytes.slice(0 5))
+        File.read_bytes(20).check(Bytes)
     }
 }
 
         :File = Work_dir + 'file'
         File.print('twift')
         File.print_appending('voxxx')
-        File.text.check('twift' + 'voxxx')
+        File.read_text.check('twift' + 'voxxx')
         File.print('bazbaz' 'UTF-8')
         File.print_appending('zigzig' 'UTF-8')
-        File.text('UTF-8').check('bazbaz' + 'zigzig')
+        File.read_text('UTF-8').check('bazbaz' + 'zigzig')
     }
 }
 
         File.print_line('twift')
         File.print_line_appending('voxxx')
         File.print_line_appending('peng')
-        File.lines.map { \0.chomp } .check(['twift' 'voxxx' 'peng'])
+        File.read_lines.map { \0.chomp } .check(['twift' 'voxxx' 'peng'])
         File.print_line('bazbaz' 'UTF-8')
         File.print_line_appending('zigzig' 'UTF-8')
-        File.lines('UTF-8').map { \0.chomp } .check(['bazbaz' 'zigzig'])
+        File.read_lines('UTF-8').map { \0.chomp } .check(['bazbaz' 'zigzig'])
     }
 }
 
         :Program_kn = Work_dir + 'program.kn'
         :Text = 'print_line("Hello!")'
         Program_kn.print(Text 'UTF-8')
-        :Pg = Program_kn.program
-        Pg.check(Text.program(Program_kn.name))
+        :Pg = Program_kn.to_program
+        Pg.check(Text.to_program(Program_kn.name))
     }
 }
 

src/test/kink/enhancertest/Program_test.kn

 use('CHECK.check_thrown')
 
 test {
-    :Program = '10 + 20'.program('add.kn')
+    :Program = '10 + 20'.to_program('add.kn')
     Program.compile.call.check(10 + 20)
     Program.name.check('add.kn')
     Program.text.check('10 + 20')
 }
 
 test {
-    :Program = '(==)'.program('error.kn')
+    :Program = '(==)'.to_program('error.kn')
     check_thrown { Program.compile }
     Program.valid?.check(false)
     Program.error_message.check(any)
 }
 
 test {
-    :Program = '10 + 20'.program('add.kn')
+    :Program = '10 + 20'.to_program('add.kn')
     :Area = Program.area(3)
     Area.program.check(Program)
     Area.start.check(3)
 }
 
 test {
-    :Program = '10 + 20'.program('add.kn')
+    :Program = '10 + 20'.to_program('add.kn')
     :Area = Program.area(3 5)
     Area.program.check(Program)
     Area.start.check(3)
 
 # Test PROGRAM.program??
 test {
-    :Program = '10 + 20'.program('add.kn')
+    :Program = '10 + 20'.to_program('add.kn')
     Program.program??.check(true)
 }
 
 test {
-    :Program = '10 + 20'.program('add.kn')
+    :Program = '10 + 20'.to_program('add.kn')
     :Proto = Program.parent
     Proto.program??.check(false)
 }

src/test/kink/enhancertest/Reader_test.kn

 test {
     use('java.io.StringReader')
     :Reader = StringReader.new("voxxx\ntwift\nrez")
-    Reader.line.check("voxxx\n")
-    Reader.line.check("twift\n")
-    Reader.line.check("rez")
+    Reader.read_line.check("voxxx\n")
+    Reader.read_line.check("twift\n")
+    Reader.read_line.check("rez")
 }
 
 test {
     use('java.io.StringReader')
     :Reader = StringReader.new("voxxx\ntwift\nrez\n")
-    Reader.line.check("voxxx\n")
-    Reader.line.check("twift\n")
-    Reader.line.check("rez\n")
+    Reader.read_line.check("voxxx\n")
+    Reader.read_line.check("twift\n")
+    Reader.read_line.check("rez\n")
 }
 
 test {
     use('java.io.StringReader')
     :Reader = StringReader.new("voxxx\ntwift\nrez")
-    Reader.lines.check(["voxxx\n" "twift\n" "rez"])
+    Reader.read_lines.check(["voxxx\n" "twift\n" "rez"])
 }
 
 test {
     use('java.io.StringReader')
     :Reader = StringReader.new("voxxx\ntwift\nrez\n")
-    Reader.lines.check(["voxxx\n" "twift\n" "rez\n"])
+    Reader.read_lines.check(["voxxx\n" "twift\n" "rez\n"])
 }
 
 test {
     use('java.io.StringReader')
     :Reader = StringReader.new("voxxx\ntwift\nrez")
-    :Seq = Reader.line_seq
+    :Seq = Reader.read_line_seq
     Seq.to_list.check(["voxxx\n" "twift\n" "rez"])
 }
 
 test {
     use('java.io.StringReader')
     :Reader = StringReader.new("voxxx\ntwift\nrez\n")
-    :Seq = Reader.line_seq
+    :Seq = Reader.read_line_seq
     Seq.to_list.check(["voxxx\n" "twift\n" "rez\n"])
 }

src/test/kink/enhancertest/Trace_test.kn

 }
 
 test {
-    :Program = '10 + 20'.program('TraceTest_indicator.kn')
+    :Program = '10 + 20'.to_program('TraceTest_indicator.kn')
     :Area = Program.area(3)
     :Trace = trace('op_add' Area)
     Trace.indicator.check('[TraceTest_indicator.kn:1:op_add] 10 ==>+ 20')

src/test/kink/enhancertest/byte_array_test.kn

 }
 
 test {
-    '10 + 20'.getBytes.program('foo.kn').check('10 + 20'.program('foo.kn'))
+    '10 + 20'.encode.to_program('foo.kn').check('10 + 20'.to_program('foo.kn'))
 }
 
 test {
     :Text = "'\u3044\u308d\u306f'"
-    :Bytes = Text.bytes('UTF-8')
-    :Program = Bytes.program('default_charset_is_utf8.kn')
-    Program.check(Text.program('default_charset_is_utf8.kn'))
+    :Bytes = Text.encode('UTF-8')
+    :Program = Bytes.to_program('default_charset_is_utf8.kn')
+    Program.check(Text.to_program('default_charset_is_utf8.kn'))
 }
 
 test {

src/test/kink/issue/issue_0010_test.kn

 
     :File = Work_dir + 'file.txt'
     File.print("foo\nbar\nbaz\n")
-    using(File.input_stream) { (:Reader)
-        Reader.line_seq.to_list.check(["foo\n" "bar\n" "baz\n"])
+    using(File.input_stream) { (:Input_stream)
+        Input_stream.read_line_seq.to_list.check(["foo\n" "bar\n" "baz\n"])
     }
 
     Work_dir.delete_recursively

src/test/kink/issue/issue_0063_test.kn

 use('java.io.ByteArrayInputStream')
 
 test {
-    :In = ByteArrayInputStream.new( "foo\nbar\r\nbaz".bytes( 'UTF-8' ) )
-    In.line( 'UTF-8' ).check( "foo\n" )
-    In.line( 'UTF-8' ).check( "bar\r\n" )
-    In.line( 'UTF-8' ).check( "baz" )
-    In.line( 'UTF-8' ).check( "" )
-    In.line( 'UTF-8' ).check( "" )
+    :In = ByteArrayInputStream.new( "foo\nbar\r\nbaz".encode( 'UTF-8' ) )
+    In.read_line( 'UTF-8' ).check( "foo\n" )
+    In.read_line( 'UTF-8' ).check( "bar\r\n" )
+    In.read_line( 'UTF-8' ).check( "baz" )
+    In.read_line( 'UTF-8' ).check( "" )
+    In.read_line( 'UTF-8' ).check( "" )
 }
 
 test {
-    :In = ByteArrayInputStream.new( "foo\nbar\r\nbaz".bytes( 'UTF-8' ) )
-    In.lines.check( [ "foo\n"  "bar\r\n"  "baz" ] )
+    :In = ByteArrayInputStream.new( "foo\nbar\r\nbaz".encode( 'UTF-8' ) )
+    In.read_lines.check( [ "foo\n"  "bar\r\n"  "baz" ] )
 }
 
 test {
-    :In = ByteArrayInputStream.new( "foo\nbar\r\nbaz".bytes( 'UTF-8' ) )
-    In.line_seq.to_list.check( [ "foo\n"  "bar\r\n"  "baz" ] )
+    :In = ByteArrayInputStream.new( "foo\nbar\r\nbaz".encode( 'UTF-8' ) )
+    In.read_line_seq.to_list.check( [ "foo\n"  "bar\r\n"  "baz" ] )
 }
 
 test {

src/test/kink/issue/issue_0106_test.kn

 test {
     use('java.io.StringReader')
     :Reader = StringReader.new("voxxx\ntwift\nrez")
-    Reader.line.check("voxxx\n")
-    Reader.line.check("twift\n")
-    Reader.line.check("rez")
+    Reader.read_line.check("voxxx\n")
+    Reader.read_line.check("twift\n")
+    Reader.read_line.check("rez")
 }
 
 test {
     use('java.io.StringReader')
     :Reader = StringReader.new("voxxx\ntwift\nrez\n")
-    Reader.line.check("voxxx\n")
-    Reader.line.check("twift\n")
-    Reader.line.check("rez\n")
+    Reader.read_line.check("voxxx\n")
+    Reader.read_line.check("twift\n")
+    Reader.read_line.check("rez\n")
 }
 
 test {
     use('java.io.StringReader')
     :Reader = StringReader.new("voxxx\ntwift\nrez")
-    Reader.lines.check(["voxxx\n" "twift\n" "rez"])
+    Reader.read_lines.check(["voxxx\n" "twift\n" "rez"])
 }
 
 test {
     use('java.io.StringReader')
     :Reader = StringReader.new("voxxx\ntwift\nrez\n")
-    Reader.lines.check(["voxxx\n" "twift\n" "rez\n"])
+    Reader.read_lines.check(["voxxx\n" "twift\n" "rez\n"])
 }
 
 test {
     use('java.io.StringReader')
     :Reader = StringReader.new("voxxx\ntwift\nrez")
-    :Seq = Reader.line_seq
+    :Seq = Reader.read_line_seq
     Seq.to_list.check(["voxxx\n" "twift\n" "rez"])
 }
 
 test {
     use('java.io.StringReader')
     :Reader = StringReader.new("voxxx\ntwift\nrez\n")
-    :Seq = Reader.line_seq
+    :Seq = Reader.read_line_seq
     Seq.to_list.check(["voxxx\n" "twift\n" "rez\n"])
 }