Skip to content

Instantly share code, notes, and snippets.

View jasononeil's full-sized avatar

Jason O'Neil jasononeil

View GitHub Profile
@jasononeil
jasononeil / JS Callback to Future
Last active November 10, 2015 23:14 — forked from kevinresol/ JS Callback to Future
Convert js-style callback to Future, with macro
Convert js-style callback to Future, with macro
@jasononeil
jasononeil / Builder.hx
Last active December 11, 2015 08:08 — forked from Simn/Builder.hx
import haxe.macro.Context;
import haxe.macro.Expr;
class Builder {
// Build macros are called using @:build() or @:autoBuild() metadata
// They must return an array containing all of the fields of the new type
macro static function build():Array<Field> {
// Create expression representing the test() function
var funcExpr = macro function():String {
return "test";