Forum OpenACS Development: Response to Is there a right way to deal with booleans?

Collapse
Posted by Don Baccus on
Hey, did that exist in Tcl 7.6?  I should go reread the Tcl 8 manual ... or maybe it was there all the time and none of us ever noticed.

Yes, David's suggestion's excellent, especially when dealing with database queries (there are some that return 0 or 1, using count, in total inconsistency with the normal t/f).

For efficiency reasons just doing the boolean 0/1 test within Tcl code is something we want to maintain in some contexts.  For instance the boolean parameters supported by ad_proc are guaranteed to be 0/1 and I think that's true of boolean ad_page_contract parameters, too ...