Mercurial Hosting > luan
comparison core/src/luan/modules/Io.luan @ 435:5b36f663a1b8
make members lower case
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 03 May 2015 21:28:49 -0600 |
parents | 750a68eceb1d |
children | 92c3d22745b8 |
comparison
equal
deleted
inserted
replaced
434:472fc70853cd | 435:5b36f663a1b8 |
---|---|
2 local IoLuan = require "java:luan.modules.IoLuan" | 2 local IoLuan = require "java:luan.modules.IoLuan" |
3 local System = require "java:java.lang.System" | 3 local System = require "java:java.lang.System" |
4 | 4 |
5 read_console_line = IoLuan.read_console_line | 5 read_console_line = IoLuan.read_console_line |
6 schemes = IoLuan.newSchemes() | 6 schemes = IoLuan.newSchemes() |
7 Uri = IoLuan.Uri | 7 uri = IoLuan.uri |
8 stdin = IoLuan.defaultStdin.table() | 8 stdin = IoLuan.defaultStdin.table() |
9 socket_server = IoLuan.socket_server | 9 socket_server = IoLuan.socket_server |
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 |
77 else | 77 else |
78 %><<%=obj%>><% | 78 %><<%=obj%>><% |
79 end | 79 end |
80 end | 80 end |
81 | 81 |
82 local uri = uri -- make local | |
83 | |
82 function repr(obj) | 84 function repr(obj) |
83 local old_out = stdout | 85 local old_out = stdout |
84 return try { | 86 return try { |
85 function() | 87 function() |
86 local string_uri = Uri "string:" | 88 local string_uri = uri "string:" |
87 stdout = string_uri.text_writer() | 89 stdout = string_uri.text_writer() |
88 do_repr(obj,{}) | 90 do_repr(obj,{}) |
89 stdout.close() | 91 stdout.close() |
90 return string_uri.read_text() | 92 return string_uri.read_text() |
91 end; | 93 end; |