Skip to content

Instantly share code, notes, and snippets.

@fowlmouth
Created November 30, 2013 02:34
Show Gist options
  • Save fowlmouth/7714680 to your computer and use it in GitHub Desktop.
Save fowlmouth/7714680 to your computer and use it in GitHub Desktop.
{.emit: """
struct Foo {
union {
int x;
float y;
};
} Foo;
""".}
type TFoo {.importc: "struct Foo".} = object
x: cint
y: cfloat
var f: TFoo
f.y = 42.0
echo f.x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment