Dynamic SRFI-4 vector construction added by sjamaan on Fri Sep 18 16:11:27 2015

(define (blob->number-vector type blob)
  (unless (memq type '(u8vector s8vector u16vector s16vector u32vector s32vector))
    (error "Unknown SRFI-4 vector type!"))
  ;; TODO: Check that the length is a multiple of the chosen type
  (##sys#make-structure type blob))

;; Usage:
;; (blob->number-vector 'u8vector #${1 2 3 4})
;; => #u8(1 2 3 4)