Mercurial Hosting > luan
comparison core/src/luan/modules/Io.luan @ 319:f6db49c294a7
rename Basic to Luan
git-svn-id: https://luan-java.googlecode.com/svn/trunk@320 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Thu, 05 Feb 2015 21:55:49 +0000 |
parents | 9fb523472035 |
children | fed1893821bf |
comparison
equal
deleted
inserted
replaced
318:4fe6c9fed486 | 319:f6db49c294a7 |
---|---|
10 stdout = IoLuan.textWriter(System.out) | 10 stdout = IoLuan.textWriter(System.out) |
11 stderr = IoLuan.textWriter(System.err) | 11 stderr = IoLuan.textWriter(System.err) |
12 | 12 |
13 | 13 |
14 import "luan:Package" | 14 import "luan:Package" |
15 import "luan:Basic" | 15 import "luan:Luan" |
16 import "luan:Table" | 16 import "luan:Table" |
17 | 17 |
18 function print_to(out,...) | 18 function print_to(out,...) |
19 local list = {} | 19 local list = {} |
20 for _,v in Basic.values(...) do | 20 for _,v in Luan.values(...) do |
21 list[#list+1] = to_string(v) | 21 list[#list+1] = to_string(v) |
22 list[#list+1] = '\t' | 22 list[#list+1] = '\t' |
23 end | 23 end |
24 if #list == 0 then | 24 if #list == 0 then |
25 out.write( '\n' ) | 25 out.write( '\n' ) |
27 list[#list] = '\n' | 27 list[#list] = '\n' |
28 out.write( Table.unpack(list) ) | 28 out.write( Table.unpack(list) ) |
29 end | 29 end |
30 end | 30 end |
31 | 31 |
32 function Basic.print(...) | 32 function Luan.print(...) |
33 print_to(stdout,...) | 33 print_to(stdout,...) |
34 end | 34 end |
35 Package.global(Basic,"print") | 35 Package.global(Luan,"print") |