From: Vasiljevic Z. <zv...@ar...> - 2007-11-28 17:46:32
|
On Nov 28, 2007, at 6:22 PM, Stephen Deasey wrote: > Pre-change: > > > % expr !1 > 0 > % expr !0 > 1 > > % expr !true > 0 > % expr !yes > 0 > % expr !y > 0 set value [ns_config -bool /missing/section missing_parameter true] if {$value == 1} { puts "$value is true" } else { puts "$value is false" } What do you think the above will print out? The problem is that the programmer could test the value on 0/1 as well, so more defensive way is to return canonical value's of 1/0 for true/false boolean values. The code before retured whatever the value has been given (y/Y/true/Yes etc pp) which broke some of our code (that costed us *hours* to dig it out!!!) The code was broken at that place definitely. The change fixed that but broke the integer part... I will look into that now.... Cheers Zoran |