summaryrefslogtreecommitdiff
path: root/libguile/print.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2025-05-05 16:07:30 +0200
committerAndy Wingo <wingo@pobox.com>2025-05-05 16:29:24 +0200
commitc63f9101f8e6e02a1f034e202d8caa50183992d2 (patch)
treed7bfe85bcf2189d592063f4cd8968f53ad4c753b /libguile/print.c
parent96589bd303ab0fd778ebf2824f642e5b4528882d (diff)
downloadguile-wip-whippet.tar.gz
Reimplement weak vectors in Scheme using ephemeronswip-whippet
* module/ice-9/weak-vector.scm: New implementation, same interface. * doc/ref/api-memory.texi (Weak vectors): Default weak vector value was documented as empty list when it was actually unspecified, but #f is most useful, so we change documentation and code to match. * libguile/Makefile.am (libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES): (DOT_X_FILES): (DOT_DOC_FILES): (noinst_HEADERS): (modinclude_HEADERS): * libguile.h: * libguile/deprecated.c: * libguile/deprecated.h: * libguile/init.c: * libguile/weak-vector.c: * libguile/weak-vector.h: Remove C weak vector implementation, replaced with deprecation stubs that call out to Scheme. * libguile/weak-set.c: * libguile/weak-table.c: * libguile/weak-list.h: Remove unused internal header. * libguile/eq.c: * libguile/evalext.c: * libguile/goops.c: * libguile/hash.c: * libguile/scm.h: * module/system/base/types.scm: * module/system/base/types/internal.scm: * module/system/vm/assembler.scm: Remove wvect tc7.
Diffstat (limited to 'libguile/print.c')
-rw-r--r--libguile/print.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/libguile/print.c b/libguile/print.c
index 937454158..17153ba8f 100644
--- a/libguile/print.c
+++ b/libguile/print.c
@@ -70,7 +70,6 @@
#include "vm.h"
#include "weak-set.h"
#include "weak-table.h"
-#include "weak-vector.h"
#include "print.h"
@@ -564,8 +563,8 @@ scm_iprin1 (SCM exp, SCM port, scm_print_state *pstate)
}
static void
-print_vector_or_weak_vector (SCM v, size_t len, SCM (*ref) (SCM, size_t),
- SCM port, scm_print_state *pstate)
+print_vector (SCM v, size_t len, SCM (*ref) (SCM, size_t),
+ SCM port, scm_print_state *pstate)
{
long i;
long last = len - 1;
@@ -710,8 +709,8 @@ iprin1 (SCM exp, SCM port, scm_print_state *pstate)
break;
case scm_tc7_values:
scm_puts ("#<values (", port);
- print_vector_or_weak_vector (exp, scm_i_nvalues (exp),
- scm_c_value_ref, port, pstate);
+ print_vector (exp, scm_i_nvalues (exp), scm_c_value_ref, port,
+ pstate);
scm_puts (">", port);
break;
case scm_tc7_program:
@@ -771,18 +770,11 @@ iprin1 (SCM exp, SCM port, scm_print_state *pstate)
case scm_tc7_thread:
scm_i_print_thread (exp, port, pstate);
break;
- case scm_tc7_wvect:
- ENTER_NESTED_DATA (pstate, exp, circref);
- scm_puts ("#w(", port);
- print_vector_or_weak_vector (exp, scm_c_weak_vector_length (exp),
- scm_c_weak_vector_ref, port, pstate);
- EXIT_NESTED_DATA (pstate);
- break;
case scm_tc7_vector:
ENTER_NESTED_DATA (pstate, exp, circref);
scm_puts ("#(", port);
- print_vector_or_weak_vector (exp, SCM_SIMPLE_VECTOR_LENGTH (exp),
- scm_c_vector_ref, port, pstate);
+ print_vector (exp, SCM_SIMPLE_VECTOR_LENGTH (exp), scm_c_vector_ref,
+ port, pstate);
EXIT_NESTED_DATA (pstate);
break;
case scm_tc7_port: