lua-users home
lua-l archive

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


On Sat, Dec 1, 2012 at 11:50 AM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> 1. To convert a Lua value to boolean:
>
>     bool = not not x
>
> 2. Exclusive or of Lua values x and y
>
>     xor = not x == not y
>
> Anything better?
>

Convert to boolean as opposed to just use as boolean? I can't think of
anything better, no. That's the same idiom I use in C/C++.

/s/ Adam