--- src/core/foundation.cc~ 2024-03-28 20:10:19.995704465 +0000 +++ src/core/foundation.cc 2024-03-28 20:07:23.128458389 +0000 @@ -1359,10 +1359,19 @@ [[noreturn]] void lisp_error(T_sp datum, T_sp arguments) { - if (!cl::_sym_error->fboundp()) { - stringstream ss; + static thread_local bool entered = false; + stringstream ss; ss << "Error " << _rep_(datum) << " initializers: " << _rep_(arguments) << std::endl; - printf("%s:%d lisp_error ->\n %s\n", __FILE__, __LINE__, ss.str().c_str()); + if (entered) + goto le_after_apply; + entered=true; + if (!cl::_sym_error->fboundp()) { + fprintf(stderr, "%s:%d lisp_error ->\n %s\n", __FILE__, __LINE__, ss.str().c_str()); early_debug(nil(), false); - } + }else + fprintf(stderr, "%s:%d lisp_error ->\n %s\n", ss.str().c_str()); core__apply1(coerce::calledFunctionDesignator(cl::_sym_error), arguments, datum); + entered = false; UNREACHABLE(); + le_after_apply: + fprintf(stderr, "lisp_error ->\n %s\n", ss.str().c_str()); + _exit(1); }