1
2
3
4
5
6
7
8
9
10
11
proc boolToInt* (value: bool): int =
if value != true: return 0
else: return 1
proc intToBool* (value: int): bool =
if value != 1: return false
else: return true
proc invertBool* (value: bool): bool =
if value != true: return true
else: return false