// LISP Error functions. // // File: error.cc (LISP Version) // Author: course // Version: 1 // // This file contains the error processing functions for // the LISP interpreter. // // This version of error prints error messages to *out // and does a lisp_throw of NIL to the tag TOP_LEVEL. #include "lisp.h" // Error message is of the general form: // // \nERROR: .\n // void error (char * s) { *out << "\nERROR: " << s << ".\n"; lisp_throw (TOP_LEVEL, NIL); } void error (char * s, char * v) { *out << "\nERROR: " << s << v << ".\n"; lisp_throw (TOP_LEVEL, NIL); } void error (char * s, char v) { *out << "\nERROR: " << s << v << ".\n"; lisp_throw (TOP_LEVEL, NIL); } void error (char * s, int v) { *out << "\nERROR: " << s << v << ".\n"; lisp_throw (TOP_LEVEL, NIL); } void error (char * s, long v) { *out << "\nERROR: " << s << v << ".\n"; lisp_throw (TOP_LEVEL, NIL); } void error (char * s, object * ob) { *out << "\nERROR: " << s << ob << ".\n"; lisp_throw (TOP_LEVEL, NIL); }