Mercurial Hosting > luan
comparison core/src/luan/modules/Io.luan @ 298:2ce23c7e2342
remove init.luan
git-svn-id: https://luan-java.googlecode.com/svn/trunk@299 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Tue, 16 Dec 2014 03:51:56 +0000 |
parents | 899253043270 |
children | 9fb523472035 |
comparison
equal
deleted
inserted
replaced
297:899253043270 | 298:2ce23c7e2342 |
---|---|
6 Uri = IoLuan.Uri | 6 Uri = IoLuan.Uri |
7 stdin = IoLuan.defaultStdin.table() | 7 stdin = IoLuan.defaultStdin.table() |
8 socket_server = IoLuan.socket_server | 8 socket_server = IoLuan.socket_server |
9 stdout = IoLuan.textWriter(System.out) | 9 stdout = IoLuan.textWriter(System.out) |
10 stderr = IoLuan.textWriter(System.err) | 10 stderr = IoLuan.textWriter(System.err) |
11 | |
12 | |
13 import "luan:Package" | |
14 import "luan:Basic" | |
15 import "luan:Table" | |
16 | |
17 function print_to(out,...) | |
18 local list = {} | |
19 for _,v in Basic.values(...) do | |
20 list[#list+1] = to_string(v) | |
21 list[#list+1] = '\t' | |
22 end | |
23 if #list == 0 then | |
24 out.write( '\n' ) | |
25 else | |
26 list[#list] = '\n' | |
27 out.write( Table.unpack(list) ) | |
28 end | |
29 end | |
30 | |
31 function Basic.print(...) | |
32 print_to(stdout,...) | |
33 end | |
34 Package.global(Basic,"print") |