rumble: fix some type checks in bytes.ss

This commit is contained in:
Gustavo Massaccesi 2018-11-19 14:57:06 -03:00
parent 940e46df6c
commit b4e3030a0d

View File

@ -81,12 +81,14 @@
[(a b . l)
(check who bytes? a)
(check who bytes? b)
(and (bytevector=? a b)
(for-each (lambda (arg)
(check who byte? arg))
l)
(and (do-name a b)
(let loop ([a b] [l l])
(cond
[(null? l) #t]
[else (let ([b (car l)])
(check who bytes? b)
(and (do-name a b)
(loop b (cdr l))))])))])))
@ -145,14 +147,17 @@
c))]
[(a)
(check who bytes? a)
a]
(#2%bytevector-copy a)]
[() #vu8()]
[args
(let* ([size (let loop ([args args])
(cond
[(null? args) 0]
[else (+ (bytevector-length (car args))
(loop (cdr args)))]))]
[else
(let ([arg (car args)])
(check who bytes? arg)
(+ (bytevector-length arg)
(loop (cdr args))))]))]
[c (make-bytevector size)])
(let loop ([args args] [pos 0])
(cond