The following code
Cases[Function[{x}, x + 1], a_?ValueQ :> Hold[a], ∞, Heads -> True]
unexpectedly returns
{Hold[x + 1]}
According to the manual, "ValueQ[expr] gives True if a value has been defined for expr, and gives False otherwise."
In the example above, what is the expression that was assigned the value x+1?
Traceto see thatValueQ[expr]is in fact! Hold[Evaluate[expr]] === Hold[expr], and sinceEvaluate[x+1]is1+xit passes the test. It is strange to me, maybe someone else can confirm it's desired behaviour or a bug. – Kuba Nov 07 '13 at 13:33