Mercurial Hosting > luan
view core/src/luan/modules/Io.luan @ 360:cbb94a7c7a9e
allow mail attachments;
add String.to_binary and Binary.to_string;
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Wed, 15 Apr 2015 11:32:30 -0600 |
parents | 7f7708e8fdd4 |
children | 8668f3799ad9 |
line wrap: on
line source
java() local IoLuan = require "java:luan.modules.IoLuan" local System = require "java:java.lang.System" read_console_line = IoLuan.read_console_line schemes = IoLuan.newSchemes() Uri = IoLuan.Uri stdin = IoLuan.defaultStdin.table() socket_server = IoLuan.socket_server stdout = IoLuan.textWriter(System.out) stderr = IoLuan.textWriter(System.err) local Luan = require "luan:Luan" local to_string = Luan.to_string local Table = require "luan:Table" function print_to(out,...) local list = {} for _,v in Luan.values(...) do list[#list+1] = to_string(v) list[#list+1] = '\t' end if #list == 0 then out.write( '\n' ) else list[#list] = '\n' out.write( Table.unpack(list) ) end end function print(...) print_to(stdout,...) end