From 10fab724492cac9e2aaf0ae456e84a85e01ada3d Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Thu, 15 Oct 2009 15:05:36 +0200 Subject: [PATCH] add back support for #y bitvector read syntax * module/ice-9/deprecated.scm (#\y): Add deprecated support for #y(1 0 1 ...) bitvectors. --- module/ice-9/deprecated.scm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/module/ice-9/deprecated.scm b/module/ice-9/deprecated.scm index c8d762143..c55e13b28 100644 --- a/module/ice-9/deprecated.scm +++ b/module/ice-9/deprecated.scm @@ -185,3 +185,20 @@ `(begin *unspecified* . ,exps))) (else `(begin)))) + +(read-hash-extend + #\y + (lambda (c port) + (issue-deprecation-warning + "The `#y' bitvector syntax is deprecated. Use `#*' instead.") + (let ((x (read port))) + (cond + ((list? x) + (list->bitvector + (map (lambda (x) + (cond ((zero? x) #f) + ((eqv? x 1) #t) + (else (error "invalid #y element" x)))) + x))) + (else + (error "#y needs to be followed by a list" x))))))