no title pasted by anonymous on Thu Oct 26 17:39:53 2017

;uses (use loops)
(define (list->bytevector arr)
  (define flat (gu:make-bytevector (length arr) 0))
  (do-for j (0 (length arr))
          (gu:bytevector-u8-set! flat j (list-ref arr j))
          )
  flat)

Something like this (untested) added by sjamaan on Thu Oct 26 17:49:52 2017


(define (list->bytevector arr)
  (do ((j 0 (add1 j))
       (arr arr (cdr arr))
       (flat (gu:make-bytevector (length arr) 0) flat))
      ((null? arr) flat)
    (gu:bytevector-u8-set! flat j (car arr))))