Home
The Toolkit for Online Communities
17465 Community Members, 0 members online, 2135 visitors today
Log In Register
OpenACS Home : Forums : OpenACS Development : Is there a right way to deal with booleans? : One Message

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

Collapse
Posted by Tilmann Singer on
A grep for _p@ (ne|eq) (0|1|t|f) matches 250 lines in more then 20 different packages - I'll start my find-and-replace engine and send one patch for all of those to you Don, alright?

But before that I'd like to ask if the change to the templating code mentioned above would be considered useful. I suggest to change the behaviour of <if> so that a non-defined variable in a boolean comparison will be interpreted as false instead of throwing an error as it would do currently, and also define true as default operator when only one variable and no operator is given.

Then template writers could say <if @bool_p@> instead of <if @bool_p@ not nil and @bool_p@ true>, which does not only look better and saves some typing, but is also a lot easier to explain to not-so-technical template writers.

Do you think this is useful and harmless enough to be added before the beta release?