Created
October 17, 2012 07:38
-
-
Save fowlmouth/3904242 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type | |
Bool32* {.size: sizeof(cint).} = enum | |
False32 = 0, True32 = 1 | |
converter toBool*(a: Bool32): bool = bool(a) | |
when isMainModule: | |
var x = False32 | |
if x: echo "hi" | |
else: echo "not x" | |
var arr: array[0..2, bool32] = [True32, false32, true32] | |
echo(repr(cast[array[0..(sizeof(bool32)*3)-1, byte]](arr))) | |
echo(false32 or false or (true32 and true)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment