lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I must be doing something very wrong.  A large Lua program is failing
in a for loop, and I don't understand why.

The stack trace is:

/usr/local/bin/lua5.1: invalid key to 'next'
stack traceback:
        [C]: in function '(for generator)'
        ./assign:961: in function 'elim_nx'
        ./assign:1131: in function 'go'
        ./assign:1135: in function 'run'
        ./assign:1153: in main chunk
        [C]: ?



Here is a fragment of the source code:

      assert(type(rset) == 'table')
      for r in pairs(rset) do --- this is line 961
        assert(papers[r][pnum], 'reviewed-by and papers are inconsistent')

I don't see how this can possibly be wrong, but evidently the compiler
sees something that I don't.  Can anyone suggest what I might do?


Norman