diff options
author | Ludovic Courtes <ludovic.courtes@laas.fr> | 2006-05-02 21:30:58 +0000 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2008-09-05 00:48:05 +0200 |
commit | c367c4b44eb9a20137930ec8771c69da9cec50a3 (patch) | |
tree | a4bda1b335965cad05d1512ea54a9e6ad108dd27 /libguile/print.c | |
parent | d525e4f9a21d1c483bc23fb047cb35edae2997ae (diff) | |
download | guile-c367c4b44eb9a20137930ec8771c69da9cec50a3.tar.gz |
Fixed printing of weak vectors.
* libguile/print.c (iprin1): When displaying a weak vector, access
elements via `scm_c_vector_ref ()', not via the macro.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-14
Diffstat (limited to 'libguile/print.c')
-rw-r--r-- | libguile/print.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/libguile/print.c b/libguile/print.c index d81127da4..605a84a5b 100644 --- a/libguile/print.c +++ b/libguile/print.c @@ -625,16 +625,30 @@ iprin1 (SCM exp, SCM port, scm_print_state *pstate) last = pstate->length - 1; cutp = 1; } - for (i = 0; i < last; ++i) + if (SCM_I_WVECTP (exp)) { - /* CHECK_INTS; */ - scm_iprin1 (SCM_SIMPLE_VECTOR_REF (exp, i), port, pstate); - scm_putc (' ', port); + /* Elements of weak vectors may not be accessed via the + `SIMPLE_VECTOR_REF ()' macro. */ + for (i = 0; i < last; ++i) + { + scm_iprin1 (scm_c_vector_ref (exp, i), + port, pstate); + scm_putc (' ', port); + } + } + else + { + for (i = 0; i < last; ++i) + { + scm_iprin1 (SCM_SIMPLE_VECTOR_REF (exp, i), port, pstate); + scm_putc (' ', port); + } } + if (i == last) { /* CHECK_INTS; */ - scm_iprin1 (SCM_SIMPLE_VECTOR_REF (exp, i), port, pstate); + scm_iprin1 (scm_c_vector_ref (exp, i), port, pstate); } if (cutp) scm_puts (" ...", port); |