Function body macros

This sounds great, especially in the form suggested in the alternatives section: that is, if preamble macros were replaced with “wrapper” macros (maybe we could borrow from Python and call them “decorator” macros?)

Besides what others have said, it sounds like implementing the decorator style could remove the need for preamble macros entirely — it’s very possible I’m missing something but aren’t the latter effectively a subset of the former? Seems to me that if users wanted to add a preamble they could return { preamble; return h-impl }()

In summary I think the ideal state would be keeping two macro types from this proposal: decorator (can’t rewrite the body but can compose) and body (can rewrite, can’t compose).

2 Likes