472 |
set_type_of((a_),t_fixnum);\ |
set_type_of((a_),t_fixnum);\ |
473 |
(a_)->FIX.FIXVAL=(b_);} |
(a_)->FIX.FIXVAL=(b_);} |
474 |
|
|
475 |
#define TYPE_ERROR(a_,b_) {stack_string(tp_err,"~S is not of type ~S.");\ |
/*FIXME the stack stuff is dangerous It works for error handling, but |
476 |
|
simple errors may evan pass the format tring up the stack as a slot |
477 |
|
in ansi*/ |
478 |
|
/* #define TYPE_ERROR(a_,b_) {stack_string(tp_err,"~S is not of type ~S.");\ */ |
479 |
|
/* Icall_error_handler(sKwrong_type_argument,tp_err,2,(a_),(b_));} */ |
480 |
|
|
481 |
|
#define TYPE_ERROR(a_,b_) {object tp_err=make_simple_string("~S is not of type ~S.");\ |
482 |
Icall_error_handler(sKwrong_type_argument,tp_err,2,(a_),(b_));} |
Icall_error_handler(sKwrong_type_argument,tp_err,2,(a_),(b_));} |
483 |
|
|
484 |
#define CONTROL_ERROR(a_) {stack_string(tp_err,a_);\ |
#define CONTROL_ERROR(a_) {object tp_err=make_simple_string(a_);\ |
485 |
Icall_error_handler(sKcontrol_error,tp_err,0);} |
Icall_error_handler(sKcontrol_error,tp_err,0);} |
486 |
|
|
487 |
#define READER_ERROR(a_,b_) {stack_string(tp_err,b_);\ |
#define READER_ERROR(a_,b_) {object rd_err=make_simple_string("Read error on stream ~S: " b_);\ |
488 |
{stack_string(rd_err,"Read error on stream ~S: ~S.");\ |
Icall_error_handler(sKreader_error,rd_err,1,(a_));} |
489 |
Icall_error_handler(sKreader_error,rd_err,2,(a_),(b_));}} |
|
490 |
|
#define NERROR(a_) {object fmt=make_simple_string(a_ ": line ~a, file ~a, function ~a");\ |
491 |
#define NERROR(a_) {stack_string(fmt,a_ ": line ~a, file ~a, function ~a");\ |
{object line=make_fixnum(__LINE__);\ |
492 |
{stack_fixnum(line,__LINE__);\ |
{object file=make_simple_string(__FILE__);\ |
493 |
{stack_string(file,__FILE__);\ |
{object function=make_simple_string(__FUNCTION__);\ |
|
{stack_string(function,__FUNCTION__);\ |
|
494 |
Icall_error_handler(sKerror,fmt,3,line,file,function);}}}} |
Icall_error_handler(sKerror,fmt,3,line,file,function);}}}} |
495 |
|
|
496 |
#define ASSERT(a_) if (!(a_)) NERROR("The assertion " #a_ " failed") |
#define ASSERT(a_) if (!(a_)) NERROR("The assertion " #a_ " failed") |