Simplest way I usually use for global variables:
I thought about this, but would that set it to 0 every time?
No, since the second expression will only be evaluated if the first evaluates to
nil.
OR : Evaluates expressions until an expression returns a
non-nil value (at which
OR returns
T), or until there are no more expressions (at which
OR returns
nil)
AND: Evaluates expressions until an expression returns a
nil value (at which
AND returns
nil), or until there are no more expressions (at which
AND returns
T)
That said, although the use of
or is more concise, I personally think an
if statement preserves readability and intent.