Not, is a operator, but not is a function
These are all very interesting solutions, especially this last one. SP I will recommend you use what ever is the most readable. All these fancy tricks are nice but are all no-no's in coding practices. Things such as a=1-a are not easy for others (or even yourself 6 months later) to see what a=1-a actually is intended to do (invert a boolean value). I recommend doing whatever is most straight forward to read or write some good comments for yourself about what the semantics of the particular line is.
The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents. (Nathaniel Borenstein)
http://www.wirednerd.com
http://www.wirednerd.com