I wish to temporarily rename a built-in symbol and use it with different name while block the main name of this symbol. For example, I wish the following code to print only "2" but not "1" and "3":
Block[{print = Print, Print}, Print[1]; print[2]; Print[3];]
In really the above code prints nothing.
Is it possible to make print
working inside such code while completely block symbol Print
?
Solutions like
With[{Print = f, print = Print}, Print[1]; print[2]; Print[3];]
are not suitable since Print
is not really blocked inside such code.
The question appeared while thinking on a way to disable tracing of Message
internals.