state as nested data while they are printed.
(print_state_fluid, print_state_fluid_num): New variables.
(scm_init_print): Initialize them.
(scm_iprin): If print_state_fluid carries a print_state, use that
instead of creating a new one.
(scm_printer_apply, apply_stub, struct apply_data): New
definitions to help with calling printer functions written in
Scheme.
* print.h (scm_printer_apply): New prototype.
scm_struct_i_n_words to get the number of fields, not
-scm_struct_n_extra_words.
On the route to fancier struct printing:
* struct.c (scm_print_struct): New function to print a structure.
Include "genio.h" to support it. This function doesn't do
anything interesting right now, but I think it should be here
anyway.
* struct.h: Include "print.h" and add prototype for
scm_print_struct.
* print.c (scm_iprin1): Call scm_print_struct instead of trying to
print structures ourself.
gdb_interface.h, gdbint.c, gdbint.h, gh_data.c, gh_init.c,
gh_io.c, gh_list.c, gh_predicates.c, gh_test_c.c, gh_test_repl.c,
init.c, net_db.c, options.c, options.h, ports.c, print.c, read.c,
script.h, snarf.h, srcprop.c, srcprop.h, stacks.c, stacks.h,
throw.c: Update copyright years; these files have been worked on
significantly in 1997, but only had copyright years for 1996.
Also, change name of copyright holder on some from Mikael
Djurfeldt to Free Software Foundation; he has signed papers
assigning the changes to the FSF.
ANSI declarations combined with K&R definitions. We'll
appease it a little bit. But when it invades France, we fight.
* print.c (scm_iprlist): Change 'tlr' argument to an int.
* print.h (scm_iprlist): Here too.
* numbers.c (scm_divbigdig): Change definition to match
declaration in numbers.h.
* unif.c (scm_makflo): Change definition to match declaration in
unif.h.
figure that out; this usually happens when one variable is only
initialized and used when a particular condition holds true, and
we know that condition will never change within a given invocation
of the function. In this case, we simply initialize the variables
to placate the compiler, hopefully to a value which will cause a
crash if it is ever actually used.
* print.c (scm_iprin1): Initialize mw_pos.
* read.c (scm_lreadrecparen): Initialize tl2, ans2.
* throw.c (scm_ithrow): Initialize dynpair.
* unif.c (scm_uniform_vector_ref): Initialize cra.
* struct.c (init_struct): Initialize prot.
* mbstrings.c (scm_print_mb_symbol): Initialize mw_pos and inc.
the print state representation: Don't use a tail array for
recording of circular references. Resizing of the print state
structure invalidates the print state pointer. To avoid passing
around an indirect print state reference to all printing
functions, we instead let the print state reference a resizable
vector.
returning it to pool. It is better to do it here than in
scm_prin1 since scm_prin1 is called often.
* print.c (make_print_state): Bugfix: Initialize pstate->ceiling.
* print.c: New functions: scm_make_print_state,
scm_free_print_state.
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.
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.