# Customise a combination of Quiet and Block [duplicate]

I would like to define a function that shuts up all warnings.

My first go was:

Silence[x_] := Block[{}, Quiet[x]];


I have also tried working with pure functions:

Silence = Block[{},Quiet[#]]&;


But neither of them seem to work when applied as a function (Silence), whereas they work when I write them down explicitly. Why?

## marked as duplicate by xzczd, Mr.Wizard♦Jan 3 '17 at 12:57

• Specifically speaking, just use Attributes@Silence = HoldAll; Silence[x_] := Block[{}, Quiet[x]]; or Silence = Function[x, Block[{}, Quiet[x]], HoldAll]; :) – xzczd Jan 3 '17 at 12:54