Files
mercury/library/error.nl
Fergus Henderson 0aeb6864ee Remove call to spy(error), since it didn't work if error.nl
library/error.nl:
	Remove call to spy(error), since it didn't work if error.nl
	was compiled rather than interpreted, and it's not really
	necessary anyway.
1995-07-29 08:10:36 +00:00

26 lines
718 B
Plaintext

%---------------------------------------------------------------------------%
% Copyright (C) 1995 University of Melbourne.
% This file may only be copied under the terms of the GNU Library General
% Public License - see the file COPYING.LIB in the Mercury distribution.
%---------------------------------------------------------------------------%
% This version is for debugging with np.
error(Message) :-
format("<Software Error: ~s>\n", [Message]),
ancestors(Anc),
( Anc \= [] ->
write('Stack trace:'), nl,
stack_trace(Anc),
interactive_display(1, Anc)
;
write('Stack trace unavailable.'), nl
),
fail.
stack_trace([]).
stack_trace([Anc|Ancs]) :-
print(Anc), write('.'), nl,
stack_trace(Ancs).