I want to generate some expressions. The expression is not evaluated expect some parts will evaluate first.
A simple example is
Defer[1+1+1] and in this expression I need the last puls operation is evaluated.
Some thing like Defer[1+ Evaluate[1+1]].
However this do not work and return 1+Evaluate[1+1]. The Evaluate is shadowed by Defer.
How can I get 1+2 as the result.
I will use this method to generate WhenEvent[ ] in NDSolve.
Evaluatework on the first level of a held expression. Here it is deeper. you can useWithor something likeDefer[1+#]&[1+1]– Kuba Jun 01 '16 at 05:40