1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 11:50:28 +02:00
Commit graph

7322 commits

Author SHA1 Message Date
Jim Blandy
32f7b3a1b1 * throw.h, throw.c: Use SCM_P instead of #if hair.
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.
1996-09-28 00:01:40 +00:00
Gary Houston
b59b97ba3a * load.c (scm_sys_try_load): don't check whether value returned
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).
1996-09-24 07:21:17 +00:00
Mikael Djurfeldt
a0c976972a *** empty log message *** 1996-09-22 22:51:18 +00:00
Mikael Djurfeldt
8ab4a274e8 * print.h: Modified prototypes for scm_iprlist, scm_prin1 and
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.
1996-09-22 22:47:10 +00:00
Mikael Djurfeldt
c62fbfe1a8 * * print.c (scm_iprin1, scm_prin1, scm_iprlist): Circular
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.
1996-09-22 22:46:31 +00:00
Mikael Djurfeldt
9882ea1991 * arbiters.c (prinarb),
async.c (print_async),
debug.c (prindebugobj, prinmemoized),
eval.c (prinprom, prinmacro),
filesys.c (scm_fd_print, scm_dir_print),
kw.c (print_kw),
mallocs.c (prinmalloc),
numbers.c, numbers.h (scm_floprint, scm_bigprint),
smob.h (scm_smobfuns),
srcprop.c (prinsrcprops),
throw.c (prinjb),
unif.c, unif.h (scm_raprin1, rapr1),
variable.c (prin_var): Changed argument `int writing' to
`scm_print_state *pstate'.
1996-09-22 22:41:40 +00:00
Mikael Djurfeldt
1940267936 * eval.c, numbers.h, unif.h, smob.h, srcprop.c: Added #include
"print.h"

* arbiters.c (prinarb),
async.c (print_async),
debug.c (prindebugobj, prinmemoized),
eval.c (prinprom, prinmacro),
filesys.c (scm_fd_print, scm_dir_print),
kw.c (print_kw),
mallocs.c (prinmalloc),
numbers.c, numbers.h (scm_floprint, scm_bigprint),
smob.h (scm_smobfuns),
srcprop.c (prinsrcprops),
throw.c (prinjb),
unif.c, unif.h (scm_raprin1, rapr1),
variable.c (prin_var): Changed argument `int writing' to
`scm_print_state *pstate'.
1996-09-22 22:41:10 +00:00
Mikael Djurfeldt
2c36c351d0 * struct.c (scm_make_struct_layout, init_struct, scm_struct_ref,
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.)
1996-09-22 22:38:56 +00:00
Mikael Djurfeldt
90b826c925 * init.c (scm_boot_guile): Moved scm_init_struct upwards so
that it will be called before scm_init_print.
1996-09-22 22:33:44 +00:00
Mikael Djurfeldt
ad75306c4f * struct.c (scm_make_struct_layout, init_struct, scm_struct_ref,
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.)
1996-09-22 22:33:09 +00:00
Mikael Djurfeldt
ec98b5046c *** empty log message *** 1996-09-22 22:28:11 +00:00
Mikael Djurfeldt
bf39f34275 * read.c (scm_init_read): Removed #ifdef READER_EXTENSIONS 1996-09-19 14:17:27 +00:00
Mikael Djurfeldt
84f6a34a80 * 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.
1996-09-19 14:17:01 +00:00
Mikael Djurfeldt
d99bcec4ac *** empty log message *** 1996-09-19 14:16:25 +00:00
Gary Houston
f5bf2977c6 * filesys.c (scsm_sys_stat): don't SIGSEGV if argument is an
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.
1996-09-19 09:08:07 +00:00
Mikael Djurfeldt
9fec1f77c3 * srcprop.h: Name changes: tc16_srcprops --> scm_tc16_srcprops,
_scm_make_srcprops --> scm_make_srcprops; Remove one layer of
function calls in the definition of the whash access macros.
1996-09-18 19:36:44 +00:00
Mikael Djurfeldt
5c5549cbca * srcprop.c (scm_finish_srcprop): Bugfix: update ptr.
(scm_init_srcprop): Adjusted size of initial source-whash.  Name
changes: tc16_srcprops --> scm_tc16_srcprops, _scm_make_srcprops
--> scm_make_srcprops
1996-09-18 19:36:29 +00:00
Mikael Djurfeldt
7e763bfcba * read.h: Added prototype for scm_lreadrecparen 1996-09-18 19:36:09 +00:00
Mikael Djurfeldt
09a4f0393d * read.c: Added code for recording of positions of source code
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
1996-09-18 19:35:48 +00:00
Mikael Djurfeldt
dbef8851ac * print.c: Added #include "alist.h" 1996-09-18 19:35:21 +00:00
Mikael Djurfeldt
d14af9f2d3 * ports.c, ports.h: Name change: scm_\(line\|column\)_number -->
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).
1996-09-18 19:34:58 +00:00
Mikael Djurfeldt
a0fcb30863 * options.c: Documentation fixes. 1996-09-18 19:34:14 +00:00
Mikael Djurfeldt
65fddfc000 * gdbint.c: scm_lread now has one more argument. 1996-09-18 19:33:58 +00:00
Mikael Djurfeldt
96937708a9 * fports.c (scm_open_file): Don't call scm_makfrom0str on a scheme
object.
1996-09-18 19:33:43 +00:00
Mikael Djurfeldt
ac46ab165a * eval.c: Added #include "hash.h" 1996-09-18 19:33:22 +00:00
Mikael Djurfeldt
f23641a9d3 * eq.c: Added #include "ramap.h" 1996-09-18 19:32:40 +00:00
Mikael Djurfeldt
7dd604b948 *** empty log message *** 1996-09-18 19:32:24 +00:00
Gary Houston
ebf7394e72 * ports.h (scm_port_table): put back file_name, it will be used to
support debugging.  Undo related changes in fports.c, ioext.c,
ports.c, gc.c.
1996-09-17 02:09:50 +00:00
Gary Houston
19639113d1 * ports.h (scm_port_table): remove file_name member for now, it seems
undesirable.
	* fports.c (scm_open_file): don't set file_name in PTAB.
	(prinfport): don't use file_name in PTAB.
	* ioext.c (scm_sys_duplicate_port): don't set file_name in PTAB.
	* ports.c (scm_add_to_port_table): don't intialize file_name.
	(scm_port_file_name): remove for now.
	* gc.c (scm_gc_mark): don't mark PTAB file_name.

	* fports.h (scm_mkfile): prototype deleted.
	* fports.c (scm_mkfile): merged into scm_open_file to simplify.
1996-09-16 03:32:26 +00:00
Gary Houston
52859adfb9 * debug.c, unif.c: use scm_out_of_range instead of
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.
1996-09-15 06:41:31 +00:00
Gary Houston
e1724d200d * numbers.c: use SCM_NUM_OVERFLOW instead of scm_wta or ASSERT.
* 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.
1996-09-14 07:47:50 +00:00
Mikael Djurfeldt
05f9286947 *** empty log message *** 1996-09-13 13:32:46 +00:00
Mikael Djurfeldt
08b5b88cdf * __scm.h, chars.c, debug.c, eval.c, eval.h, extchrs.c, extchrs.h,
fdsocket.c, feature.c, mbstrings.c, mbstrings.h, numbers.c,
numbers.h, print.c, scmhob.h, simpos.h, symbols.c, symbols.h,
tags.h, throw.c, variable.h: Name cleanup.  Lots of xxxSCM_yyy
removed.  (These were introduced by unsupervised name
substitution.)
1996-09-13 13:31:50 +00:00
Mikael Djurfeldt
e2806c1000 * __scm.h, chars.c, debug.c, eval.c, eval.h, extchrs.c, extchrs.h,
fdsocket.c, feature.c, mbstrings.c, mbstrings.h, numbers.c,
numbers.h, print.c, scmhob.h, simpos.h, symbols.c, symbols.h,
tags.h, throw.c, variable.h: Name cleanup.  Lots of xxxSCM_yyy
removed.  (These were introduced by unsupervised name
substitution.)
1996-09-13 11:07:24 +00:00
Mikael Djurfeldt
9a15c164c9 *** empty log message *** 1996-09-12 23:44:46 +00:00
Mikael Djurfeldt
a25840f95d * error.c (err_head): scm_iprin1 --> scm_prin1 1996-09-12 23:44:21 +00:00
Mikael Djurfeldt
c88edfaf17 * gscm.c (gscm_portprint_obj): scm_iprin1 --> scm_prin1 1996-09-12 23:44:12 +00:00
Mikael Djurfeldt
439791ec7b * gscm.h (gscm_print_obj): scm_iprin1 --> scm_prin1 1996-09-12 23:44:00 +00:00
Mikael Djurfeldt
a51ea417ba * print.c: Added code for detection of circular references during
printing.  (init_ref_stack, grow_ref_stack): New functions.  Added
a hook for printing of closures (accessible via print options).
This leads to a split of calls to scm_iprin1 into two classes:
elementary print operations (e. g. the code which prints a smob)
still use scm_iprin1 while top level calls (like scm_display) use
scm_prin1.  scm_prin1 begins by clearing the data structure used
to record reference information.
1996-09-12 23:43:47 +00:00
Mikael Djurfeldt
864f03aba4 * print.h: Added declarations of scm_prin1 and scm_prlist. 1996-09-12 23:43:34 +00:00
Mikael Djurfeldt
8781806909 * strports.c (scm_strprint_obj): scm_iprin1 --> scm_prin1 1996-09-12 23:43:18 +00:00
Mikael Djurfeldt
ee34012038 * debug.c: Adjusted header comment. 1996-09-12 23:39:37 +00:00
Mikael Djurfeldt
c6c790ed69 * tags.h: Typo. 1996-09-12 23:39:23 +00:00
Jim Blandy
1de1828496 . 1996-09-11 22:56:24 +00:00
Jim Blandy
dffa93b1b2 Doc fix. 1996-09-11 22:55:24 +00:00
Mikael Djurfeldt
7dc4b37a68 *** empty log message *** 1996-09-11 22:05:14 +00:00
Mikael Djurfeldt
380b6b4c32 * gdbint.c (gdb_read): Now possible to run during GC.
(unmark_port, remark_port): New functions.
1996-09-11 22:04:45 +00:00
Mikael Djurfeldt
85ab994756 * read.c (scm_grow_tok_buf): Use scm_vector_set_length_x instead
of allocating a new string object.  Also, increase size by
the factor 2 instead of 1.5.
1996-09-11 22:04:13 +00:00
Mikael Djurfeldt
836669b8eb * symbols.h (SCM_SETLENGTH): Use SCM_SETCAR. 1996-09-11 22:03:44 +00:00
Jim Blandy
d92b2b8972 *** empty log message *** 1996-09-11 20:30:27 +00:00