Skip to content

Instantly share code, notes, and snippets.

@stisa
Last active September 23, 2016 08:56
Show Gist options
  • Save stisa/deb4d14f3a7ac769224483f97bb04ce6 to your computer and use it in GitHub Desktop.
Save stisa/deb4d14f3a7ac769224483f97bb04ce6 to your computer and use it in GitHub Desktop.
## first.nim ###
proc test*(): string = "test1"
echo test()
## second.nim ###
from first import test
proc test2*(): string = "test2"
echo test2()
# nim c -r second.nim
# Outputs:
# test1
# test2
@stisa
Copy link
Author

stisa commented Sep 23, 2016

Use when isMainModule to avoid the imported module from outputing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment