Skip to content

Instantly share code, notes, and snippets.

@master-q
Last active August 29, 2015 14:28
Show Gist options
  • Save master-q/1246e74be633312dbd8e to your computer and use it in GitHub Desktop.
Save master-q/1246e74be633312dbd8e to your computer and use it in GitHub Desktop.
Template scope
#include "share/atspre_define.hats"
#include "share/atspre_staload.hats"
extern fun{} base (): int
fun{} plus (a: int): int = a + base ()
implement main0 () = {
implement{} base () = 2
val () = println! (plus 1) // => 3
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment