(scm_catch): Changed SCM_DEFER_INTS --> SCM_REDEFER_INTS and
SCM_ALLOW_INTS --> SCM_REALLOW_INTS. This is so that scm_catch
can be used in scm_call_with_new_root; Added reenabling of stack
checking when catching a throw.
(cwdr, scm_call_with_new_root, scm_dynamic_root, scm_app_wdr): New
functions: Implements dynamic roots mostly according to spec in
SCM manual. Main difference is that the second argument is a
throw handler rather than an error "thunk".
* root.h: Added declaration of scm_init_root.
SCM_THREAD_CRITICAL_SECTION_END. Moved marking of root data to
root.c:mark_root.
* * root.c, root.h: Added root smob.
(cwdr, scm_call_with_new_root, scm_dynamic_root, scm_app_wdr): New
functions: Implements dynamic roots mostly according to spec in
SCM manual. Main difference is that the second argument is a
throw handler rather than an error "thunk".
* root.c: Added #include "genio.h", #include "smob.h", #include
"pairs.h", #include "throw.h", #include "dynwind.h", #include
"eval.h"
(scm_init_root): Added #include "root.x".
declare the char * to be const. Avoids a warning in rgx.c.
* ports.h: spelling fix.
* filesys.c (scm_sys_stat, scm_sys,lstat): include file name in
error messages.
* load.c (scm_sys_try_load_path): throw an error if file not found
(like it says it in NEWS).
Remove special support for uncaught throws; see throw.c for
rationale.
* throw.c (unhandled_throw): New function.
(scm_ithrow): Call unhandled_throw if we don't find a throw
target; don't mess with scm_bad_throw_vcell.
(scm_bad_throw_vcell): Variable deleted.
(scm_init_throw): Don't initialize it.
* throw.c (scm_ithrow): Don't let outer key matches shadow inner
#t catches.
by scm_open_file is #f, it won't be. Always return SCM_UNSPECIFIED.
Change the Scheme name from %try-load to primitive-load.
* error.c (scm_error): convert a NULL message to SCM_BOOL_F.
Can avoid passing a message, allowing it to be derived in the
error handler (e.g., if we want to throw to the key both from
Scheme and C).
scm_iprin1. Removed prototype for scm_prlist.
* print.c, print.h: Closures now print like #<procedure foo (x)>.
People who whish to see the source can do `(print-enable 'source)'.
Removed #ifdef DEBUG_EXTENSIONS.
references now have a new appearance which is more compact and
also gives a clue about what the target of the reference is.
By setting parameters in the print state, more fancy printing can
be achieved. This is used by the (not yet commited) backtrace
code.
* print.c: Added #include "struct.h". Removed function
scm_prlist.
* print.c (scm_prin1): Print states are now allocated when calling
scm_prin1 and then passed around to all printing functions as an
argument. A cache `print_state_pool' enables reuse of print
states.
(scm_make_print_state): New function.
(scm_iprin1): Adaption to print states.
(scm_iprlist): An initial "hare and tortoise" scan brings down
time complexity to O (depth * N). (Better time complexity will be
achieved when the printing code is completely rewritten.)
* print.c, print.h: Closures now print like #<procedure foo (x)>.
People who whish to see the source can do `(print-enable 'source)'.
Removed #ifdef DEBUG_EXTENSIONS.
scm_struct_set_x), struct.h, gc.c (scm_gc_mark): Completed Tom
Lord's implementation of structs, allowing for tail arrays as
described in the manual. Also fixed some bugs. (Both the interface
and the implementation should be improved.)
scm_struct_set_x), struct.h, gc.c (scm_gc_mark): Completed Tom
Lord's implementation of structs, allowing for tail arrays as
described in the manual. Also fixed some bugs. (Both the interface
and the implementation should be improved.)
integer (assuming for now accepting an integer is a good thing).
* error.c, fports.c: replace use of %S in lgh_error args with %s.
%S will be used instead for write'ing arguments.
* unif.c (scm_transpose_array): change arguments in the SCM_WNA
asserts. fix a few other asserts.
(scm_aind, scm_enclose_array, scm_array_in_bounds_p,
scm_uniform_vector_ref, scm_array_set_x,
scm_dimensions_to_unform_array): change args in
SCM_WNA SCM_ASSERTS and change scm_wta's to scm_wrong_num_args.
strop.c (scm_substring_move_left_x, scm_substring_move_right_x,
scm_substring_fill_x): likewise.
gsubr.c (scm_gsubr_apply): likewise.
eval.c (SCM_APPLY): likewise.
* eval.c (4 places): replace scm_everr with lgh_error or
scm_wrong_num_args.
* error.c, error.h (scm_wrong_num_args, scm_wrong_type_arg,
scm_memory_error): new procedures.
* scm_everr: deleted. can use scm_wta, dropping first two args.
scm_error: convert NULL subr to SCM_BOOL_F.
* __scm.h: don't define SCM_STACK_OVFLOW, SCM_EXIT, SCM_ARG6, SCM_ARG7,
SCM_ARGERR.
* stackchk.c (scm_report_stack_overflow): use lgh_error instead
of scm_wta.
* error.c, error.h: new error keys: scm_arg_type_key,
scm_args_number_key, scm_memory_alloc_key, scm_stack_overflow_key,
scm_misc_error_key.
scm_wta: reimplement using lgh_error instead of scm_everr.
expressions; New functions: recsexpr, scm_lreadrecparen;
_scm_make_srcprops --> scm_make_srcprops
(scm_flush_ws): Removed updating of positions counters. This work
is already done by scm_gen_getc
scm_port_\1; Added mutator scm_set_port_filename_x (used when
loading source from non-file ports, which, e. g., happens when
using the Emacs interface).
wta for range errors (ASSERT still needs work).
* error.c, error.h (scm_out_of_range): new procedure.
* error.c, error.h (scm_out_of_range_key): new key.
* posix.c (scm_sync): #else was missing.
* error.c, error.h: append _key to names scm_num_overflow and
scm_system_error.
* __scm.h (SCM_SYSMISSING, SCM_NUM_OVERFLOW): use SCM_BOOL_F instead
of consing an empty list.
(SCM_SYSERROR etc.): move into error.c, make them procedures instead
of macros, saves code and string space.
error.c, fports.c, numbers.c, posix.c, ioext.c, filesys.c, socket.c,
fdsocket.c, simpos.c: change names of SCM_SYSERROR etc., to
lower case. Rename scm_syserror_m to scm_syserror_msg.
error.h: prototypes for new procedures.
* error.c, error.h: setup scm_num_overflow key.
* __scm.h: SCM_NUM_OVERFLOW: macro for reporting numerical overflow.
Remove definition of SCM_OVSCM_FLOW.
* fports.c (scm_open_file): use SCM_SYSERROR_M.
* __scm.h: SCM_SYSERROR_M: new macro for system errors with an
explicit message and args.
* error.c, error.h, __scm.h: change system_error_sym to
scm_system_error.
* error.c (system_error_sym): remove leading %% from the Scheme name
"%%system-error".
* __scm.h (SCM_SYSMISSING): Redefine using lgh_error.
* boot-9.scm: remove leading %% from references to '%%system-error.
(%%handle-system-error): don't pass all the thrown arguments when
aborting, just the key and subr.
Remove the code to "Install default handlers for built-in errors."
Remove the definition of the syserror procedure.
Associate 'numerical-overflow with default handler.