Why Message is not always traced?
I am still puzzled by the fact that Message
is not always traced when switching On[Message]
while surely this function is called through the evaluator.
Consider:
In[1]:= On[Message,Plus];
1+1
Sin[1,1]
During evaluation of In[1]:开发者_JAVA百科= Plus::trace: 1+1 --> 2. >>
Out[2]= 2
During evaluation of In[1]:= Sin::argx: Sin called with 2 arguments; 1 argument is expected. >>
During evaluation of In[1]:= Message::trace: Message[Sin::argx,Sin,2] --> Null. >>
Out[3]= Sin[1,1]
In[4]:= Unprotect[Message];
Message:=Print[List[##]]&
1+1
During evaluation of In[4]:= {Plus::trace,1+1,2}
Out[6]= 2
It is obvious that Message
is called in both cases through the evaluator because the call can be intercepted on the top level. But it is not traced in the case of 1+1
. Why?
精彩评论