On Nov. 3, 2011, Leo wrote
-----------------
>Edwin Woollett <woollett at charter.net> writes:
>> Is there anything simple I can do (in nint.mac) to
>> surpress the message Principal Value which integrate
>> issues to the console screen in, for example,
>>
>> (%i13) integrate(sin(x)*(sin(x^2)*(sin(x^3)+1/x)+1/x),x,0,inf);
>>
>> Principal Value
>>
>> (%o13) 'integrate(sin(x)*(sin(x^2)*(sin(x^3)+1/x)+1/x),x,0,inf)
>>
>Redirect stdout:
>
>(%i5) with_stdout("/dev/null",
>integrate(sin(x)*(sin(x^2)*(sin(x^3)+1/x)+1/x),x,0,inf) );
>
>(%o5) 'integrate(sin(x)*(sin(x^2)*(sin(x^3)+1/x)+1/x),x,0,inf)
>
------------------------------------
Thanks for the suggestion, but if I use this inside shared
packaged code, as in Ch. 8, I have the problem that the
specification of the dump file name appears to be system
dependent (at least unix vs. windows):
(%i53) integrate(sin(x)*(sin(x^2)*(sin(x^3)+1/x)+1/x),x,0,inf);
Principal Value
(%o53) 'integrate(sin(x)*(sin(x^2)*(sin(x^3)+1/x)+1/x),x,0,inf
/* using my windows 5.25.1gcl hardware/software combo
leads to error: */
(%i54) with_stdout("/dev/null",
integrate(sin(x)*(sin(x^2)*(sin(x^3)+1/x)+1/x),x,0,inf) );
Maxima encountered a Lisp error:
Error in LET [or a callee]: Cannot create the file /dev/null.
Automatically continuing.
To enable the Lisp debugger set *debugger-hook* to nil.
/* redirecting output to c:/null.txt works for my system: */
(%i55) with_stdout("c:/null.txt",
integrate(sin(x)*(sin(x^2)*(sin(x^3)+1/x)+1/x),x,0,inf));
(%o55) 'integrate(sin(x)*(sin(x^2)*(sin(x^3)+1/x)+1/x),x,0,inf)
So is there a refinement which detects unix, windows, mac
and does the appropriate redirection of output??
Ted