summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2021-02-25 10:27:22 +0100
committerAndy Wingo <wingo@pobox.com>2021-02-25 16:07:47 +0100
commita758ba075a589b688c07384ab8282dc703f9364d (patch)
tree47ce25bd9d61b3e93d7ff0f1fb026c3cf4c8a604
parent0cc799185576712d69f11fc794454f2f5447bef7 (diff)
downloadguile-a758ba075a589b688c07384ab8282dc703f9364d.tar.gz
Fix read-syntax on vectors and arrays
* module/ice-9/read.scm (%read): Strip annotations from reading the array elements.
-rw-r--r--module/ice-9/read.scm6
1 files changed, 3 insertions, 3 deletions
diff --git a/module/ice-9/read.scm b/module/ice-9/read.scm
index 5b375e193..0724c6664 100644
--- a/module/ice-9/read.scm
+++ b/module/ice-9/read.scm
@@ -403,7 +403,7 @@
(error "unknown character name ~a" tok))))))))
(define (read-vector)
- (list->vector (read-parenthesized #\))))
+ (list->vector (map strip-annotation (read-parenthesized #\)))))
(define (read-srfi-4-vector ch)
(read-array ch))
@@ -438,7 +438,7 @@
(expect #\u)
(expect #\8)
(expect #\()
- (u8-list->bytevector (read-parenthesized #\))))
+ (u8-list->bytevector (map strip-annotation (read-parenthesized #\)))))
;; FIXME: We should require a terminating delimiter.
(define (read-bitvector)
@@ -532,7 +532,7 @@
(define (read-elements ch rank)
(unless (eqv? ch #\()
(error "missing '(' in vector or array literal"))
- (let ((elts (read-parenthesized #\))))
+ (let ((elts (map strip-annotation (read-parenthesized #\)))))
(if (zero? rank)
(begin
;; Handle special print syntax of rank zero arrays; see