summaryrefslogtreecommitdiff
path: root/libguile/print.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2012-01-09 17:24:57 +0100
committerAndy Wingo <wingo@pobox.com>2012-01-09 17:50:56 +0100
commitb2637c985ce93bc15e0378b8120d04a98ebdd212 (patch)
treebde14a0e946c1a9e165284b75e91d17b6dca5aa1 /libguile/print.c
parent017eb4a6be938c50df7fe6a27ca38486e75e02d5 (diff)
downloadguile-b2637c985ce93bc15e0378b8120d04a98ebdd212.tar.gz
allocate a tc7 to arrays
* libguile/tags.h (scm_tc7_array): Allocate a tag for arrays. * libguile/arrays.h (SCM_I_ARRAYP): Change to use scm_tc7_array. The previous definition was not externally usable because scm_i_tc16_array was internal. (scm_i_print_array): Declare, though internally. * libguile/arrays.c (scm_i_make_array): Use scm_cell with the tc7 instead of NEWSMOB. (scm_i_print_array): Make not static. (SCM_ARRAY_IMPLEMENTATION): Adapt. (scm_init_arrays): Remove array smob declaration. * libguile/eq.c (scm_equal_p): Refactor to put the string, pointer, and bytevector cases in the switch. Add a case for arrays. * libguile/goops.c: Add <array> declarations. * libguile/print.c (iprin1): Call scm_i_print_array as needed. * libguile/evalext.c (scm_self_evaluating_p): Add a case for arrays.
Diffstat (limited to 'libguile/print.c')
-rw-r--r--libguile/print.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libguile/print.c b/libguile/print.c
index 2551bdf91..e0a6daa52 100644
--- a/libguile/print.c
+++ b/libguile/print.c
@@ -646,6 +646,13 @@ iprin1 (SCM exp, SCM port, scm_print_state *pstate)
case scm_tc7_with_fluids:
scm_i_with_fluids_print (exp, port, pstate);
break;
+ case scm_tc7_array:
+ ENTER_NESTED_DATA (pstate, exp, circref);
+ scm_i_print_array (exp, port, pstate);
+ break;
+ case scm_tc7_bytevector:
+ scm_i_print_bytevector (exp, port, pstate);
+ break;
case scm_tc7_wvect:
ENTER_NESTED_DATA (pstate, exp, circref);
if (SCM_IS_WHVEC (exp))
@@ -653,10 +660,6 @@ iprin1 (SCM exp, SCM port, scm_print_state *pstate)
else
scm_puts ("#w(", port);
goto common_vector_printer;
-
- case scm_tc7_bytevector:
- scm_i_print_bytevector (exp, port, pstate);
- break;
case scm_tc7_vector:
ENTER_NESTED_DATA (pstate, exp, circref);
scm_puts ("#(", port);