lua-users home
lua-l archive

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


Hello, everyone, Mike!

Please consider the following code snippet:

$ cat t.lua 

require 'bit'

function f()
    return function (x)
        return bit.band(x)
    end
end

local f = f()
f()

....and the output:

$ lua t.lua 
lua: t.lua:6: bad argument #1 to 'band' (number expected, got nil)
stack traceback:
        [C]: in function 'band'
        t.lua:6: in function 'f'
        t.lua:11: in main chunk
        [C]: ?

$ luajit-2.0.0-beta6 t.lua 
luajit-2.0.0-beta6: t.lua:11: bad argument #1 to 'f' (number expected, got nil)
stack traceback:
        [C]: in function 'f'
        t.lua:11: in main chunk
        [C]: ?


Please note the wrong function name in the argument misuse message. Hope this will be helpful.

// Seny