1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

* print.c (scm_iprin1): Limit number of vector elements printed

according to pstate->length.
This commit is contained in:
Mikael Djurfeldt 1997-03-11 15:02:29 +00:00
parent 14de3b4206
commit 9fbaf27ccb

View file

@ -494,18 +494,29 @@ taloop:
ENTER_NESTED_DATA (pstate, exp, circref);
scm_gen_puts (scm_regular_string, "#(", port);
common_vector_printer:
for (i = 0; i + 1 < SCM_LENGTH (exp); ++i)
{
/* CHECK_INTS; */
scm_iprin1 (SCM_VELTS (exp)[i], port, pstate);
scm_gen_putc (' ', port);
}
if (i < SCM_LENGTH (exp))
{
/* CHECK_INTS; */
scm_iprin1 (SCM_VELTS (exp)[i], port, pstate);
}
scm_gen_putc (')', port);
{
int last = SCM_LENGTH (exp) - 1;
int cutp = 0;
if (pstate->fancyp && SCM_LENGTH (exp) > pstate->length)
{
last = pstate->length - 1;
cutp = 1;
}
for (i = 0; i < last; ++i)
{
/* CHECK_INTS; */
scm_iprin1 (SCM_VELTS (exp)[i], port, pstate);
scm_gen_putc (' ', port);
}
if (i == last)
{
/* CHECK_INTS; */
scm_iprin1 (SCM_VELTS (exp)[i], port, pstate);
}
if (cutp)
scm_gen_puts (scm_regular_string, " ...", port);
scm_gen_putc (')', port);
}
EXIT_NESTED_DATA (pstate);
break;
case scm_tc7_bvect: