lua-users home
lua-l archive

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


On Wed, Nov 17, 2010 at 07:42, HyperHacker <hyperhacker@gmail.com> wrote:
> On Tue, Nov 16, 2010 at 21:38, Alexander Gladysh <agladysh@gmail.com> wrote:

>> Anyone have a module to work with 3-state boolean logic (true, false,
>> indeterminate) in Lua?

>> Otherwise: any suggestions on module design?

> I've been known to do "if x == false then foo() end"-type constructs
> to handle false and nil differently. Is that the kind of thing you're
> looking for?

I'm looking for the Lua equivalent for this:

http://www.boost.org/doc/libs/1_44_0/doc/html/tribool.html

(Not sure if using "nil" as indeterminate value is a good thing --
perhaps it is.)

Alexander.