diff options
Diffstat (limited to '')
-rw-r--r-- | gem/ex3.lua | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/gem/ex3.lua b/gem/ex3.lua deleted file mode 100644 index a43fefa..0000000 --- a/gem/ex3.lua +++ /dev/null | |||
@@ -1,15 +0,0 @@ | |||
1 | local function chainpair(f1, f2) | ||
2 | return function(chunk) | ||
3 | local ret = f2(f1(chunk)) | ||
4 | if chunk then return ret | ||
5 | else return (ret or "") .. (f2() or "") end | ||
6 | end | ||
7 | end | ||
8 | |||
9 | function filter.chain(...) | ||
10 | local f = select(1, ...) | ||
11 | for i = 2, select('#', ...) do | ||
12 | f = chainpair(f, select(i, ...)) | ||
13 | end | ||
14 | return f | ||
15 | end | ||