Function body macros

@Douglas_Gregor That would be a very cool feature. I would like to invite you to consider my suggestion for the result builders extension as a partial alternative. This could cover the "Logged" and "Traced" cases from your examples. Of course, in the general case, you would need to provide more information in the result builder, such as the signature of the called function and its arguments.

Even the "Remote" case could be covered if we assume that a result builder is capable of building the resulting function in the absence of the original one.

Certainly, the macro approach is a much more versatile mechanism, providing more control and allowing for additional checks at compile time. However, extending the result builders API might be easier to implement in the compiler and more user-friendly for programmers.

I can write roughly what the API should look like if you're interested.