Last active
August 29, 2015 13:57
-
-
Save BitPuffin/9718515 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 TFoo* = object | |
| yatamo*: string | |
| proc yo*(a: TFoo, wa: int): string | |
| proc ha*(a: TFoo, woo: string): int | |
| when defined(macosx): | |
| TFoo.bar = TMacBar # Works iff the code is ran statically | |
| TFoo.baz = TMacBaz | |
| proc yo(a: TFoo, wa: int): string = | |
| a.bar.str | |
| proc ha(a: TFoo, woo: string): int= | |
| a.baz.int | |
| elif defined(windows): | |
| TFoo.bar = TWindowsBar | |
| TFoo.bar = TWindowsBaz | |
| # and so on | |
| else: | |
| TFoo.bar = TUnixBar | |
| # Unix has no UnixBaz | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment