Haxe Code Cookbook

build macro

Overview of Haxe snippets and tutorials tagged with build macro.

  • This snippet demonstrates how to add a map field to a type.‥

  • Virtually adds this property to a class: public var myVar(get, null):Float; private inline function get_myVar():Float { return 1.5; }‥

  • Virtually adds this static variable to a class: public inline static var STATIC_VAR:Float = 1.5;‥

  • This example generates a constructor-function for each field of a class to easily create value object classes.‥

  • This example will load an URL, scrape all id's from the HTML page and use them for auto-completion.‥

  • Automatically generate dispatch functions as:‥