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:
parent
e7acfa88bc
commit
10fab72449
1 changed files with 17 additions and 0 deletions
|
@ -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))))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue