lua-users home
lua-l archive

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


Personally, the standard Lua idiom works well for me:

assert( ( true and 'a' or 'b' ) == 'a' )

one subtle gotcha with this idiom (i think it has been mentioned on
the list a few times before) is that, in general, the assertion (true
and a or b)==a is false if a==false or a==nil.