Mercurial Hosting > luan
comparison core/src/luan/modules/Io.luan @ 392:8668f3799ad9 0.5
add Io.dont_write_when_no
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Fri, 24 Apr 2015 14:16:03 -0600 |
parents | 7f7708e8fdd4 |
children | 62b457c50594 |
comparison
equal
deleted
inserted
replaced
391:2f5cc9c2cbf0 | 392:8668f3799ad9 |
---|---|
30 end | 30 end |
31 | 31 |
32 function print(...) | 32 function print(...) |
33 print_to(stdout,...) | 33 print_to(stdout,...) |
34 end | 34 end |
35 | |
36 | |
37 -- useful for SimplyHTML responsiveness | |
38 | |
39 NO = {} | |
40 | |
41 function dont_write_when_no(write_fn) | |
42 return function(...) | |
43 for v in Luan.values(...) do | |
44 if v == NO then | |
45 return | |
46 end | |
47 end | |
48 write_fn(...) | |
49 end | |
50 end |