add bytevector function

This commit is contained in:
Yuichi Nishiwaki 2013-11-14 18:01:44 +09:00
parent 819a2e6a96
commit 26bf0970f9
1 changed files with 11 additions and 0 deletions

View File

@ -325,3 +325,14 @@
((< i len)
v)
(vector-set! v i (car l))))))
;;; 6.9 bytevector
(define (bytevector . objs)
(let ((len (length objs)))
(let ((v (make-bytevector len)))
(do ((i 0 (+ i 1))
(l objs (cdr l)))
((< i len)
v)
(bytevector-u8-set! v i (car l))))))