Skip to content

Instantly share code, notes, and snippets.

@judofyr
Created January 12, 2015 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save judofyr/fc152264ae1c4f0932c7 to your computer and use it in GitHub Desktop.
Save judofyr/fc152264ae1c4f0932c7 to your computer and use it in GitHub Desktop.
type Foo = distinct int
template `&`(a: Foo, b: Foo): expr =
debugEcho "anding"
const x = a
Foo(int(a) + int(b))
echo int(Foo(1) & Foo(2) & Foo(3) & Foo(4) & Foo(5))
Hint: used config file '/Users/magnus/.nims/0.10.2/nim/config/nim.cfg' [Conf]
Hint: system [Processing]
Hint: mbug [Processing]
anding
anding
anding
anding
anding
anding
anding
anding
anding
anding
anding
anding
anding
anding
anding
anding
anding
anding
CC: mbug
[Linking]
Hint: operation successful (8761 lines compiled; 0.180 sec total; 14.148MB) [SuccessX]
/Users/magnus/Programming/nimventure/horm/mbug
anding
anding
anding
anding
15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment