Haxe macros are said by many to be "black magic", and in some ways they are—macros in Haxe are actual Haxe code (rather than macros in C/C++ for example, which are just fancy pre-processor directives). Macros are undoubtedly the most advanced feature of Haxe and probably the hardest to grasp, however I think a major reason for that is a lack of really solid documentation on the subject. To me, the Haxe docs regarding macros are somewhat obfuscated and leave something to be desired, and unfortunately there's not a lot of other resources online. This is what led me to embark on my own journey of learning Haxe macros, and hopefully starting to shed a little more light on their mystery.
I had some trouble getting this example off the ground, so I would like to thank ousado for helping me out on the Haxe IRC. Haxe is truly a great and supportive community, and if you're ever stuck with something I strongly encourage you to pop on the IRC—you're bound to have someone help you out!Read More