1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 03:30:27 +02:00

Fix truncated-print for uniform vectors

* module/ice-9/pretty-print.scm (truncated-print): Use bytevector?
  instead of uniform-vector?; the latter could be true for shared arrays
  with non-zero lower bounds.
This commit is contained in:
Andy Wingo 2014-02-07 18:04:20 +01:00
parent 85d3339d7e
commit 2f3b7e9a41

View file

@ -1,7 +1,7 @@
;;;; -*- coding: utf-8; mode: scheme -*-
;;;;
;;;; Copyright (C) 2001, 2004, 2006, 2009, 2010,
;;;; 2012 Free Software Foundation, Inc.
;;;; 2012, 2014 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
@ -20,6 +20,7 @@
(define-module (ice-9 pretty-print)
#:use-module (ice-9 match)
#:use-module (srfi srfi-1)
#:use-module (rnrs bytevectors)
#:export (pretty-print
truncated-print))
@ -422,12 +423,12 @@ sub-expression, via the @var{breadth-first?} keyword argument."
(display ")"))
(else
(display "#"))))
((uniform-vector? x)
((bytevector? x)
(cond
((>= width 9)
(format #t "#~a(" (uniform-vector-element-type x))
(print-sequence x (- width 6) (uniform-vector-length x)
uniform-vector-ref identity)
(format #t "#~a(" (array-type x))
(print-sequence x (- width 6) (array-length x)
array-ref identity)
(display ")"))
(else
(display "#"))))