Just to clarify -- the point of considering heredoc-type macros is that brackets inside the macro body don't have to balance -- the only thing that can close the macro is the heredoc-marker. Thus we can use them to emit constructs with unbalanced %( %) brackets.