Unevaluated is a function that I never truly understand, and here's one of the cases confusing me:
Unevaluated[1 + 1] -> 3 (* 2 -> 3 *)
Same thing happens on right side of
Rule and left side of
RuleDelayed (:>) i.e.
Unevaluated affects none of the unheld sides of
2 -> Unevaluated[1 + 2] (* 2 -> 3 *) Unevaluated[1 + 1] :> 3 (* 2 :> 3 *)
Trace shows that
Unevaluated does seem to work for once, but after that,
Rule evaluates its left side again:
Unevaluated[1 + 1] -> 3 // Trace
No matter how many
Rule will tenaciously evaluate again and again, until the
Unevaluateds are all killed:
Unevaluated@Unevaluated@Unevaluated@Unevaluated[1 + 1] -> 3 // Trace
My questions are:
Is this just a individual case i.e. a special behavior of
RuleDelayed, or there's a class of function that shares the same behavior?
RuleDelayedis designed to behave like this? Is there any deep meaning?