1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-10 14:00:21 +02:00

add back support for #y bitvector read syntax

* module/ice-9/deprecated.scm (#\y): Add deprecated support for
  #y(1 0 1 ...) bitvectors.
This commit is contained in:
Andy Wingo 2009-10-15 15:05:36 +02:00
parent e7acfa88bc
commit 10fab72449

View file

@ -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))))))