lua-users home
lua-l archive

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

I'm pretty sure i havent changed the source in that sense....  the error says it is expecting a number not a string. Could it be that i missed something somewhere where the bitop functions are strings instead of numbers??

On Tue, Oct 5, 2010 at 9:29 AM, Joe Andresen <> wrote:
I tried those two lines and got the exact same error.

I'm using lua source 5.1.4

and latest bit op (source) version 1.0.1

i am compiling with visual studio 2008.

I was sure to add the two chunks of code in the install part of the website and recompiled several times.

the first couple of asserts work in the test code but the pcall's do not.

i use pcall from c in other parts of code and it works fine.

On Tue, Oct 5, 2010 at 2:42 AM, Mike Pall <> wrote:
Joe Andresen wrote:
> anyone else get this using the source?
> bad argument #1 to '?' (number expected, got no value)
> line 22 of the test file:
> if pcall(f) or pcall(f, "z") or pcall(f, true) then
> where f is the function "tobit"

This shouldn't happen. This test is checking proper error
handling. So it does throw an error, but pcall ought to catch it

Try the following test:

 pcall(error, "test")

This should give no error and no output. Similarly:

 local bit = require("bit")

This should give no error and no output, too.

If any of the two tests fail, then your Lua VM has broken error
handling. Have you compiled Lua yourself or where have you
obtained a binary of it? Which version of Lua? Compiled with which
compiler version and running on which operating system?