exception on generic for loop
Issue #6
invalid
> table1 = {1,2,3}; for k,v in table1 do print("hi"); end
Exception: attempt to call a table value
Stack traceback:
stdin:0: in main chunk
> for k,v in _G do print(k, "->", v); end
Exception: attempt to call a table value
Stack traceback:
stdin:0: in main chunk
Comments (3)
-
-
- changed status to invalid
-
- removed version
Removing version: 2.0 (automated comment)
- Log in to comment
That is because you specified table1 and _G as the iterator function.
for exprList in iterator [[, table], start] do block end
So that should be
inext is the list iterator, next is the mapping iterator.