Macro ordering question

33 views
Skip to first unread message

Timothy Farrell

unread,
Jul 7, 2015, 12:44:21 PM7/7/15
to haxe...@googlegroups.com
I have a function macro that takes a convenience function and converts it to something more run-time friendly.  I also have a build macro on the parent class that is intended to work with the output of the original function macro.  In essence, I need the function macro to run first and the the build macro second.

Is there a convention for how this might happen?  Just putting it in there indicates that the function macro runs second or is somehow ignored by the build macro.

Thanks

Simon Krajewski

unread,
Jul 7, 2015, 12:53:20 PM7/7/15
to haxe...@googlegroups.com
Expression macros (what you call function macros) are executed when the
call expression is typed, which obviously happens after build macros.
Generally the order is

1. build type (build macros may run here)
2. build fields (expression macros may run here)

You cannot "expand" a macro without typing its expression.

Simon
Reply all
Reply to author
Forward
0 new messages