3
$\begingroup$

I've seen this idiom used in different programs but never fully understand why it is necessary. Could someone explain? Is it still the recommended way to replace some part of a held expression to its evaluated value? Is there an alternative method that uses more built-in functionality?

heldExpression /: lhs_ :> evaluate[rhs_] := lhs :> With[{tmp = rhs}, tmp /; True]
$\endgroup$