Skip to content

Instantly share code, notes, and snippets.

@susisu
Created January 6, 2015 15:06
Show Gist options
  • Save susisu/73d5c5e4b164dee26bd7 to your computer and use it in GitHub Desktop.
Save susisu/73d5c5e4b164dee26bd7 to your computer and use it in GitHub Desktop.
class Test {
static function main() {
trace("Haxe is great!");
var nya : Foo = new Foo(function (x : String) : Void {
trace(x);
// btw
nya;
});
nya.say();
}
}
class Foo {
private var func : String -> Void;
public function new(func : String -> Void) {
this.func = func;
}
public function say() : Void {
this.func("foo");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment