Established intern bug is in getting, not setting; improved exceptions.

This commit is contained in:
Simon Brooke 2026-02-28 15:15:42 +00:00
parent 54f6f023c6
commit a1c377bc7c
9 changed files with 241 additions and 97 deletions

View file

@ -296,7 +296,8 @@ struct cons_pointer add_2( struct stack_frame *frame,
to_long_double( arg2 ) );
break;
default:
result = throw_exception( c_string_to_lisp_string
result = throw_exception( c_string_to_lisp_symbol( L"+"),
c_string_to_lisp_string
( L"Cannot add: not a number" ),
frame_pointer );
break;
@ -319,7 +320,8 @@ struct cons_pointer add_2( struct stack_frame *frame,
to_long_double( arg2 ) );
break;
default:
result = throw_exception( c_string_to_lisp_string
result = throw_exception( c_string_to_lisp_symbol( L"+"),
c_string_to_lisp_string
( L"Cannot add: not a number" ),
frame_pointer );
break;
@ -332,7 +334,8 @@ struct cons_pointer add_2( struct stack_frame *frame,
break;
default:
result = exceptionp( arg2 ) ? arg2 :
throw_exception( c_string_to_lisp_string
throw_exception( c_string_to_lisp_symbol( L"+"),
c_string_to_lisp_string
( L"Cannot add: not a number" ),
frame_pointer );
}
@ -428,7 +431,8 @@ struct cons_pointer multiply_2( struct stack_frame *frame,
break;
default:
result =
throw_exception( make_cons
throw_exception( c_string_to_lisp_symbol( L"*"),
make_cons
( c_string_to_lisp_string
( L"Cannot multiply: argument 2 is not a number: " ),
c_type( arg2 ) ),
@ -454,7 +458,8 @@ struct cons_pointer multiply_2( struct stack_frame *frame,
break;
default:
result =
throw_exception( make_cons
throw_exception( c_string_to_lisp_symbol( L"*"),
make_cons
( c_string_to_lisp_string
( L"Cannot multiply: argument 2 is not a number" ),
c_type( arg2 ) ),
@ -467,7 +472,8 @@ struct cons_pointer multiply_2( struct stack_frame *frame,
to_long_double( arg2 ) );
break;
default:
result = throw_exception( make_cons( c_string_to_lisp_string
result = throw_exception( c_string_to_lisp_symbol( L"*"),
make_cons( c_string_to_lisp_string
( L"Cannot multiply: argument 1 is not a number" ),
c_type( arg1 ) ),
frame_pointer );
@ -620,7 +626,8 @@ struct cons_pointer subtract_2( struct stack_frame *frame,
to_long_double( arg2 ) );
break;
default:
result = throw_exception( c_string_to_lisp_string
result = throw_exception( c_string_to_lisp_symbol( L"-"),
c_string_to_lisp_string
( L"Cannot subtract: not a number" ),
frame_pointer );
break;
@ -650,7 +657,8 @@ struct cons_pointer subtract_2( struct stack_frame *frame,
to_long_double( arg2 ) );
break;
default:
result = throw_exception( c_string_to_lisp_string
result = throw_exception( c_string_to_lisp_symbol( L"-"),
c_string_to_lisp_string
( L"Cannot subtract: not a number" ),
frame_pointer );
break;
@ -661,7 +669,8 @@ struct cons_pointer subtract_2( struct stack_frame *frame,
make_real( to_long_double( arg1 ) - to_long_double( arg2 ) );
break;
default:
result = throw_exception( c_string_to_lisp_string
result = throw_exception( c_string_to_lisp_symbol( L"-"),
c_string_to_lisp_string
( L"Cannot subtract: not a number" ),
frame_pointer );
break;
@ -732,7 +741,8 @@ struct cons_pointer lisp_divide( struct
to_long_double( frame->arg[1] ) );
break;
default:
result = throw_exception( c_string_to_lisp_string
result = throw_exception( c_string_to_lisp_symbol( L"/"),
c_string_to_lisp_string
( L"Cannot divide: not a number" ),
frame_pointer );
break;
@ -762,7 +772,8 @@ struct cons_pointer lisp_divide( struct
to_long_double( frame->arg[1] ) );
break;
default:
result = throw_exception( c_string_to_lisp_string
result = throw_exception( c_string_to_lisp_symbol( L"/"),
c_string_to_lisp_string
( L"Cannot divide: not a number" ),
frame_pointer );
break;
@ -774,7 +785,8 @@ struct cons_pointer lisp_divide( struct
to_long_double( frame->arg[1] ) );
break;
default:
result = throw_exception( c_string_to_lisp_string
result = throw_exception( c_string_to_lisp_symbol( L"/"),
c_string_to_lisp_string
( L"Cannot divide: not a number" ),
frame_pointer );
break;