lua-users home
lua-l archive

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

It seems the two functions are only used when encoding if/else statements, which is exactly where you'd want numeric 0 to be false. ;)

What about for the and/or operators?

And the == and ~= operators?

Also keep in mind this precludes doing and/or style ternary code with 0 as one of the values:

   x = bool_var and 0 or 1  -- won't work 'as expected' any more.

This may be acceptable in your own dialect, but do keep in mind with any of these changes, it pretty much means no Lua modules are going to work (you'll have to reinvent them all), and you'll never get LuaJIT to work with these changes (unless you want to rewrite chunks of the JIT compiler...). These may or may not be important for future versions of your engine, of course.

- Claire.