seqlua
diff seqlua_c_example.c @ 52:3362ec36cb09
Do not automatically assume that functions passed to ipairs are iterators
but require ipairs(func, mode) to have an explicit mode set to "call" or "generator"
but require ipairs(func, mode) to have an explicit mode set to "call" or "generator"
author | jbe |
---|---|
date | Tue Aug 26 21:10:03 2014 +0200 (2014-08-26) |
parents | 45855c3e5cb8 |
children | 92ce3958aca7 |
line diff
1.1 --- a/seqlua_c_example.c Mon Aug 25 12:12:46 2014 +0200 1.2 +++ b/seqlua_c_example.c Tue Aug 26 21:10:03 2014 +0200 1.3 @@ -5,7 +5,7 @@ 1.4 1.5 int seqlua_c_example_printcsv(lua_State *L) { 1.6 seqlua_Iterator iter; 1.7 - seqlua_iterloop(L, &iter, 1) { 1.8 + seqlua_iterloop(L, &iter, SEQLUA_MODE_CALL, 1) { 1.9 if (seqlua_itercount(&iter) > 1) fputs(",", stdout); 1.10 fputs(luaL_tolstring(L, -1, NULL), stdout); 1.11 // two values need to be popped (the value pushed by