Skip to content

Instantly share code, notes, and snippets.

@fowlmouth
Created October 17, 2012 07:38
Show Gist options
  • Save fowlmouth/3904242 to your computer and use it in GitHub Desktop.
Save fowlmouth/3904242 to your computer and use it in GitHub Desktop.
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