# Is ClearAttributes built-in functon work in current cell only?

I have a question. Is ClearAttributes the built-in functon work in current cell only? This is my code:

In first cell:

Set[a, 6]


In second cell:

ClearAttributes[Set, HoldFirst]
Attributes[Set]
Set[a, 7]


As you can see in the second cell there is no attribute HoldFirst of Set function.

However, if I make a call in the third cell:

Attributes[Set]


It turns out that the Set function has a HoldFirst attribute.

So does the ClearAttributes function only work in the cell in which it is called?

• No. ClearAttributes happens at the kernel level. Cells are a front-end construct. If this doesn't make sense this will help. You're omitting the fact that your Set[a, 7] causes a huge string of failures. Clearly Set resets itself, restoring its HoldFirst state. – b3m2a1 Jan 7 '18 at 18:40
• You cannot reliably change the attributes or definitions of core system functions like Set. These functions have certain optimizations that insulate them from the full generality of the langage. This often means that any user-assigned attributes and definitions are either ignored or reset without warning. – Oleksandr R. Jan 7 '18 at 18:46