/******************************************************************* * * A Common Lisp compiler/interpretor, written in Prolog * * (xxxxx.pl) * * * Douglas'' Notes: * * (c) Douglas Miles, 2017 * * The program is a *HUGE* common-lisp compiler/interpreter. * *******************************************************************/ :- module(errs, []). :- include('./header'). wl:declared_as(f_error,inline(error)). wl:init_args(0,error). f_error(Args,Res):- f_format(t,"~a",Args,Res),throw(f_error(Args,Res)). % Connection to LPA's built-in error handler '?ERROR?'(Error, Form):- lisp_error_description(_, Error, Description), !, write('LISP ERROR '), write(Description), write(Form), nl. '?ERROR?'(Error, Goal):- wl:error_hook(Error, Goal). lisp_error_description(unbound_atom, 100, 'No value found for atom: '). lisp_error_description(atom_does_not_exist, 101, 'SetQ: Variable does not exist: '). lisp_error_description(first_not_cons, 102, 'Form1: This is not a cons cell: '). lisp_error_description(rest_not_cons, 103, 'Rest: This is not a cons cell: '). :- fixup_exports. end_of_file.