|
From: Arthur N. <ac...@ca...> - 2014-12-29 04:26:46
|
On Sun, 28 Dec 2014, Kostas Oikonomou wrote:
> On 12/28/2014 02:55, Arthur Norman wrote:
>> If you read the manual you will find that BYE or QUIT is the command
>> to exit reduce.=
> Yes, I was aware of "quit". However, "quit" exits the whole Reduce
> process, which is not what I had in mind. My notion of stop() or abort()
> was that it would stop the currently running procedure and return to the
> top level of Reduce.
>> Note also the flag ERRCONT, because not everybody wishes to have the
>> system unconditionally exit at the first error.
>
> Yes, neither do I. Perhaps I misunderstand 'errcont', but 'on
> errcont;' doesn't make a difference in the behavior of quit.
No not at all. This is me misunderstanding your use of the words "stop"
and "abort". What happens in Reduce is that a (symbolic level) function
erroser is used to catch errors. When something is evaluated via errorset
then errors within that evaluation do not quite the system - they just
unwind to the next enclosing. Based on a flag (also passed to errorset,
which is often called with the value of !*backtrace for that flag) the
unwinding optionally displays a backtrace.
>
> Yes, having access to all of the low level is both "good" and "bad". My
> problem is to terminate an algebraic-mode procedure when some condition
> is detected. So my solution is
>
> procedure xxxx(....);
> begin;
> <stuff>
> if <error> then <<
> write <error message, expressions, etc>;
> rederr "";
> >>;
> <stuff>
> end;
>
The definition of rederr is
symbolic procedure rederr u;
begin if not !*protfg then lprie u; error1() end;
and the definition of lprie is
symbolic procedure lprie u;
begin scalar x;
if !*int then go to a;
x:= !*defn;
!*defn := nil;
a: erfg!* := t;
lpriw ("*****",u);
if null !*int then !*defn := x
end;
so to get an effect as of rederr but without that call actually
displaying anything you could define your own function as
symbolic procedure myerror();
begin
erflg!* := t;
error1()
end;
Then you just call
lisp myerror();
When you trace through the source code to lpriw you will observe that is
is concerned that an error may be raised when the user has selected an
alterative output destination, so it arranges to select the standard
output on a temporary basis so that error messages go there. I do not know
if you are concerned about that sort of things for the diagnostics you
wish to generate.
>
>>
>> Arthur
>
>
|