Re: Re: Re: Full text of the current warning message(s)
- To: mathgroup at smc.vnet.net
- Subject: [mg33531] Re: Re: Re: Full text of the current warning message(s)
- From: Vladimir Bondarenko <vvb at mail.strace.net>
- Date: Fri, 29 Mar 2002 06:13:14 -0500 (EST)
- Reply-to: Vladimir Bondarenko <vvb at mail.strace.net>
- Sender: owner-wri-mathgroup at wolfram.com
Dear Mr Ersek, Having read your new lines, I had the only comment: most impressive (!) Your piece of code showed again what I had learnt from http://www.verbeia.com/mathematica/tips/Tricks.html a year ago: you are a top-notch Mathematica expert. Your solution looks very nice, and it *does* reproduce all the required messages (and shows none spurious ones). However, it looks like that your piece of code sometimes reports only the denominators of the concrete expressions shown as a part of the messages while the numerators are missed. I am very interested in the exact values of these expressions. Could you possibly make a minor correction (obviously, it would be for you a matter of a minute or two) so I could see both numerators and denominators? In fact, my original intention is to ask Mathematica about these messages from within my code. Thank you very much for your willingness to show me what is the true Art of programming. Regards, Vladimir Bondarenko P.S. Here is my input of your new code, cell by cell. ***************************************************************************************** (* Cell # 1 *) Unprotect[Message]; MyMessageList[_Integer]:= Hold[]; $ModifyMessage=True; Message[name_,args__]/;$ModifyMessage:= Block[{$ModifyMessage}, (* If the message isn't Off it will be displayed due to evaluating the begining of the If statement. *) If[(Message[name,args]=!=$Off[])&&(Count[MyMessageList[$Line],Unevaluated[na me],-1]<3), If[ MyMessageList[$Line]===Hold[], MyMessageList[$Line]=Hold[Message[name,args];], (* else *) MyMessageList[$Line]= Insert[MyMessageList[$Line],Unevaluated[Message[name,args]],{1,-2}] ]; ] ] Protect[Message]; FullMessageList[n_]:= Module[{s1,s2,s3,posn,TempHold1,TempHold2,result}, Attributes[HoldTemp1]=Attributes[HoldTemp2]={HoldAll}; s1=MyMessageList[n]/.m_MessageName:>HoldTemp1[m]; s2=Apply[HoldTemp1,MessageList[n],1,Heads->False]; s3=Map[{#,Count[s2,#]}&,Union[s2],Heads->False]; posn=Apply[Position[s1,#1,-1,#2]&,s3,1,Heads->True]; posn=Map[Drop[#,-1]&,Flatten[posn,1],Heads->False]; result=Extract[MyMessageList[n]/.Message->HoldTemp2,Sort[posn] ]; result=Apply[Hold,result ,Heads->False]; result=Apply[HoldForm, {result}/.HoldTemp2->Message, Heads->False]; Part[result,1,0]=CompoundExpression; result ] ......................................................................................... (* Cell # 2 *) In[7] := Integrate[ArcTan[1 - Sqrt[1 - z^(-1)]], {z, -1, 1}]; Out[8] := Message[$MaxExtraPrecision::meprec, NUMERATOR1/(-9 - (82/55)*(41 - 8*Sqrt[34]) + (1/55)*(41 - 8*Sqrt[34])^2]), 50.] Message[$MaxExtraPrecision::meprec, NUMERATOR2/(-9 - (82/55)*(41 - 8*Sqrt[34]) + (1/55)*(41 - 8*Sqrt[34])^2]), 50.] Message[$MaxExtraPrecision::meprec, NUMERATOR1/(-9 - (82/55)*(41 - 8*Sqrt[34]) + (1/55)*(41 - 8*Sqrt[34])^2]), 50.] ......................................................................................... (* Cell # 3 *) In[8] := FullMessageList[7] Out[8] := Message[$MaxExtraPrecision::meprec, -9 - (82/55)*(41 - 8*Sqrt[34]) + (1/55)*(41 - 8*Sqrt[34])^2], 50.] Message[$MaxExtraPrecision::meprec, -9 - (82/55)*(41 - 8*Sqrt[34]) + (1/55)*(41 - 8*Sqrt[34])^2], 50.] Message[$MaxExtraPrecision::meprec, -9 - (82/55)*(41 - 8*Sqrt[34]) + (1/55)*(41 - 8*Sqrt[34])^2], 50.] .........................................................................................