[Rear-users] two-state vs. tri-state configuration variables

Schlomo Schapiro schlomo at schapiro.org
Mon May 30 18:28:50 CEST 2011


so far most variables in ReaR have been booleans. This means that we
only check if the variable contains something, not what it contains.

The last two commits changed that (and possible others before, but now
I paid attention) and introduced tri-state variables:
* Yes
* No
* I don't know, ReaR should do something intelligent

>From my work I know how much trouble tri-state variables can give,
especially if they are used like a boolean. I therefore would recommend
for us to handle tri-state variables different and also using special
checker functions instead of [[ ]] constructs to check the state of the

An alternative would be to use tri-states like this:

VAR=		means off
VAR=auto	means ReaR can decide
VAR=yes		any other string means on

Still a tri-state but maybe more obvious what auto is and backwards
compatible with the old boolean thinking. An empty value keeps the Off
meaning and we extend the On meaning with one that adds new
functionality (auto detection).

Kind Regards,

More information about the rear-users mailing list