summaryrefslogtreecommitdiff
path: root/libguile/arrays.c
diff options
context:
space:
mode:
authorDaniel Llorens <daniel.llorens@bluewin.ch>2015-02-18 09:32:30 +0100
committerDaniel Llorens <daniel.llorens@bluewin.ch>2015-02-18 09:32:30 +0100
commiteb3d623da57e6d31a58d95f932345fb761f9b701 (patch)
tree64e5c4e28ada352275d003340df60a16e08c7338 /libguile/arrays.c
parentc4c21de44f0108c5721fe0991da3a050d3c12677 (diff)
downloadguile-eb3d623da57e6d31a58d95f932345fb761f9b701.tar.gz
Non-vector 1D arrays print as #1()
* libguile/arrays.c (scm_i_print_array): Print the dimension whenever the array is a true scm_tc7_array. * test-suite/tests/arrays.test: Check that non-vector 1D arrays print as expected.
Diffstat (limited to 'libguile/arrays.c')
-rw-r--r--libguile/arrays.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libguile/arrays.c b/libguile/arrays.c
index 9e5715cf1..4c1b824f2 100644
--- a/libguile/arrays.c
+++ b/libguile/arrays.c
@@ -1,5 +1,6 @@
/* Copyright (C) 1995,1996,1997,1998,2000,2001,2002,2003,2004,2005,
- * 2006, 2009, 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc.
+ * 2006, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Free Software Foundation,
+ * Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@@ -760,7 +761,7 @@ scm_i_print_array (SCM array, SCM port, scm_print_state *pstate)
scm_array_get_handle (array, &h);
scm_putc_unlocked ('#', port);
- if (h.ndims != 1 || h.dims[0].lbnd != 0)
+ if (SCM_I_ARRAYP (array))
scm_intprint (h.ndims, 10, port);
if (h.element_type != SCM_ARRAY_ELEMENT_TYPE_SCM)
scm_write (scm_array_handle_element_type (&h), port);