seqlua
diff README @ 15:a95fbd16473f
Removed unnecessary creation of closures for callable values (through __call)
author | jbe |
---|---|
date | Wed Aug 20 06:33:18 2014 +0200 (2014-08-20) |
parents | 2ef6eb7d17d2 |
children | 431fa6946a61 |
line diff
1.1 --- a/README Wed Aug 20 06:08:03 2014 +0200 1.2 +++ b/README Wed Aug 20 06:33:18 2014 +0200 1.3 @@ -171,15 +171,11 @@ 1.4 printcsv(assert(io.open("testfile")):lines()) 1.5 -- prints: line1,line2,... of "testfile" 1.6 1.7 -NOTE: ``seqlua_iterinit`` will store one extra element on the stack during 1.8 -iteration. When ``seqlua_iternext`` returns 0, this extra element is popped 1.9 -from the stack automatically. 1.10 - 1.11 Additionally, ``seqlualib`` includes a function ``seqlua_iterclosure(L, idx)``, 1.12 which converts a table at a given stack index into a function closure (stored 1.13 on the same stack index) that iterates over the elements of the table. If the 1.14 -value at the given stack index is already a function, it leaves the value 1.15 -unchanged. If the value is convertible to a function using ``__call,`` then the 1.16 -value is replaced by a closure calling the ``__call`` metamethod. 1.17 +value at the given stack index is already a function (or if it is callable 1.18 +through a ``__call`` metamethod), then ``seqlua_iterclosure(L, idx)`` leaves 1.19 +the value at ``idx`` unchanged. 1.20 1.21