Still not working, but I have increasing confidence I'm on the right track.

This commit is contained in:
Simon Brooke 2026-02-28 18:09:48 +00:00
parent a1c377bc7c
commit bcb227a5f9
10 changed files with 110 additions and 108 deletions

View file

@ -114,9 +114,8 @@ struct cons_pointer add_ratio_ratio( struct cons_pointer arg1,
cell1->payload.ratio.divisor ) );
r = make_ratio( dividend, divisor, true );
} else {
r = throw_exception( c_string_to_lisp_symbol( L"+"),
make_cons(
c_string_to_lisp_string
r = throw_exception( c_string_to_lisp_symbol( L"+" ),
make_cons( c_string_to_lisp_string
( L"Shouldn't happen: bad arg to add_ratio_ratio" ),
make_cons( arg1,
make_cons( arg2, NIL ) ) ),
@ -156,8 +155,8 @@ struct cons_pointer add_integer_ratio( struct cons_pointer intarg,
dec_ref( ratio );
} else {
result =
throw_exception( c_string_to_lisp_symbol( L"+"),
make_cons( c_string_to_lisp_string
throw_exception( c_string_to_lisp_symbol( L"+" ),
make_cons( c_string_to_lisp_string
( L"Shouldn't happen: bad arg to add_integer_ratio" ),
make_cons( intarg,
make_cons( ratarg,
@ -237,8 +236,8 @@ struct cons_pointer multiply_ratio_ratio( struct
release_integer( divisor );
} else {
result =
throw_exception( c_string_to_lisp_symbol( L"*"),
c_string_to_lisp_string
throw_exception( c_string_to_lisp_symbol( L"*" ),
c_string_to_lisp_string
( L"Shouldn't happen: bad arg to multiply_ratio_ratio" ),
NIL );
}
@ -273,8 +272,8 @@ struct cons_pointer multiply_integer_ratio( struct cons_pointer intarg,
release_integer( one );
} else {
result =
throw_exception( c_string_to_lisp_symbol( L"*"),
c_string_to_lisp_string
throw_exception( c_string_to_lisp_symbol( L"*" ),
c_string_to_lisp_string
( L"Shouldn't happen: bad arg to multiply_integer_ratio" ),
NIL );
}
@ -342,8 +341,8 @@ struct cons_pointer make_ratio( struct cons_pointer dividend,
}
} else {
result =
throw_exception( c_string_to_lisp_symbol( L"make_ratio"),
c_string_to_lisp_string
throw_exception( c_string_to_lisp_symbol( L"make_ratio" ),
c_string_to_lisp_string
( L"Dividend and divisor of a ratio must be integers" ),
NIL );
}