without comment, and even though it seems unnecessary for the specific task at hand. This leads me to believe that at least in some cases it is simply good practice to do so. Is that the case? If so, why? Are there instances in which it would not be the best practice?
My understanding of the situation is that if, for example, I have
x=5 and then pass
1+x to my function
f, the argument as seen internally by
f will still be represented as
1+x instead of
6. But it seems to me that in most cases if this were true I'd simply want to
Evaluate[1+x] before proceeding. This would lead me to conclude that setting
HoldAll would be the exception, not the rule.
My question is not whether the two examples I provided actually require
HoldAll to work, but rather
How do I determine, when writing a new function, whether or not to set
What I am concerned about is the possibility of creating a function which behaves as desired without the
HoldAll setting (or with it, for that matter) for the test cases I throw at it, but which misbehaves later if something else gets passed to it. What possibilities and issues must I consider to ensure I make the correct choice? What are explicit use cases for each of the two options?