I don’t understand how you can return a non-expression from a macro.
Oh no, macros shouldn’t interfere in this usage. And I am afraid to make speculations with the existence of macro usage.
Typically I would only write one kind of macro myself in practice which is like
macro get_int_decision(model, expr) return esc(quote
...
end) end
So it fundamentally lacks the body part—only having one return, and one all-including esc—so I can write code “safely” within that—which is familiar to me. An example is Adding set_integer(::AffExpr)? · Issue #4073 · jump-dev/JuMP.jl · GitHub.
The julia doc’s comment about this is
This kind of manipulation of variables should be used judiciously, but is occasionally quite handy.
I only see its handy aspect. Am I missing anything? I want to ask. e.g. Will this style still be of normal performance?