Skip to content

Instantly share code, notes, and snippets.

@misterpah
Created May 28, 2014 14:52
Show Gist options
  • Save misterpah/25c0d74e098631f44cc3 to your computer and use it in GitHub Desktop.
Save misterpah/25c0d74e098631f44cc3 to your computer and use it in GitHub Desktop.
import haxe.macro.Context;
import haxe.macro.Expr;
class ClassNameHelper {
macro static public function getClassName():ExprOf<String> {
return { expr: EConst(CString(Context.getLocalClass().toString())), pos: Context.currentPos() }
}
}
class Test {
public static function main() {
trace(ClassNameHelper.getClassName()); //Test
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment