Mercurial Hosting > luan
comparison src/luan/modules/Io.luan @ 1288:8432d20a2729
minor
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 31 Dec 2018 18:39:04 -0700 |
parents | 781ec0a92bb5 |
children | 70eecde81820 |
comparison
equal
deleted
inserted
replaced
1287:d9b86675be24 | 1288:8432d20a2729 |
---|---|
64 function Io.output_to(out,fn,...) | 64 function Io.output_to(out,fn,...) |
65 local old_out = Io.stdout | 65 local old_out = Io.stdout |
66 return try( { | 66 return try( { |
67 function(...) | 67 function(...) |
68 Io.stdout = out | 68 Io.stdout = out |
69 fn(...) | 69 return fn(...) |
70 end; | 70 end; |
71 finally = function() | 71 finally = function() |
72 Io.stdout = old_out | 72 Io.stdout = old_out |
73 end; | 73 end; |
74 }, ... ) | 74 }, ... ) |