1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-07-02 15:40:38 +02:00
guile/module
Andy Wingo 3cf4ca187c Remove print state objects, and ports-with-print-state
The goal was that, as part of a print operation, all nested prints of
contained data would be able to use the same parameters (e.g. write or
not), and also detect cycles, highlight objects, etc.  The mechanism was
a heap-allocated data structure.  However, given that:

  1. Nobody accessed print states from Scheme

  2. `write` and `display` should move to Scheme anyway, in order to be
     suspendable

  3. The "fancyp" and "highlight" options were unused

  4. A simple stack-allocated data structure with a per-thread key could
     do the trick just as well, without needing the weird freelist
     structure

  5. Ports-with-print-states were a source of bugs

In the end we switch print states to be something completely internal to
print.c.  There are no more SCM print-state objects, and no more
ports-with-print-state.

* libguile/print.h: Remove print state from API.
* libguile/print.c (struct scm_print_state): Move definition here.
(scm_print_opts): Remove "highlight-prefix" and "highlight-suffix"
options, as they were not used.
(ENTER_NESTED_DATA): Remove "fancyp" case.
(init_print_state_key, get_print_state, push_print_state)
(maybe_push_print_state, pop_print_state): New facility to manage stack
of active print states.
(scm_iprin1, print_vector): No more fancyp.
(iprin1): Access "writingp" member directly.  Don't make ports with
print states.
(scm_prin1): Manage print state stack.
(scm_iprlist): No more fancyp.
(scm_valid_oport_value_p): Remove; valid outports are SCM_OPOUTPORTP.
* libguile/backtrace.c:
* libguile/filesys.c:
* libguile/fports.c:
* libguile/goops.c:
* libguile/ioext.c:
* libguile/ports.c:
* libguile/posix.c:
* libguile/promises.c:
* libguile/socket.c:
* libguile/struct.c: Remove cases that dealt with
ports-with-print-states.
* libguile/private-options.h: Remove highlight options.
* module/ice-9/ports.scm (inherit-print-state): Deprecate.
* libguile/deprecated.c:
* libguile/deprecated.h: Add deprecation shims for print states, as far
as that is possible.
2025-06-17 09:38:46 +02:00
..
ice-9 Remove print state objects, and ports-with-print-state 2025-06-17 09:38:46 +02:00
language Deprecate srfi-14 in default environment 2025-06-13 09:03:20 +02:00
oop Move implementation of hooks to Scheme module 2025-06-16 13:11:28 +02:00
rnrs Deprecate srfi-14 in default environment 2025-06-13 09:03:20 +02:00
scheme Update set of decimal zeroes for Unicode 15.1.0 2023-11-02 11:31:32 +01:00
scripts Move implementation of hooks to Scheme module 2025-06-16 13:11:28 +02:00
srfi Move char-set-cursor implementation to Scheme 2025-06-13 11:13:54 +02:00
sxml Deprecate srfi-14 in default environment 2025-06-13 09:03:20 +02:00
system Move implementation of hooks to Scheme module 2025-06-16 13:11:28 +02:00
texinfo Deprecate srfi-14 in default environment 2025-06-13 09:03:20 +02:00
web Deprecate srfi-14 in default environment 2025-06-13 09:03:20 +02:00
Makefile.am Rework bootstrap to be reproducible 2022-02-01 14:50:40 +01:00
rnrs.scm Remove all deprecated code from Scheme files 2025-05-05 12:33:37 +02:00
statprof.scm Replace after-gc-hook with {add,remove}-after-gc-callback! 2025-06-16 11:36:07 +02:00
texinfo.scm texinfo: Add basic support for @w{...}. 2020-06-18 00:30:30 +02:00