I am frustrated by the following:
{1, 2, 3.0} /. a_Integer -> a + 1
The a
on the left side of the arrow is localized and appears in green whereas its sibling on the right side is blue. Consequently, I have to write:
Block[{a}, {1, 2, 3.0} /. a_Integer -> a + 1]
to avoid naming conflicts.
It doesn't make sense to me that, within one inbuilt function, a variable is treated differently. I already got some hard to find errors because I forgot to block.
What did I overlook here?