Welcome to the CHICKEN Scheme pasting service

write-u8vector added by iterrogo on Mon Oct 20 18:01:09 2014

(define (write-u8vector v #!optional (port ##sys#standard-output) (from 0) to)
  (##sys#check-structure v 'u8vector 'write-u8vector)
  (##sys#check-output-port port #t 'write-u8vector)
  (when from (##sys#check-exact from 'write-u8vector))
  (when to (##sys#check-exact to 'write-u8vector))
  (let ((len (optional to (##core#inline "C_u_i_8vector_length" v))))
    ((##sys#slot (##sys#slot port 2) 3) ; write-string                                                                                                                                           
     port
     (if (and (fx= from 0) (or (not to) (fx>= to len)))
         (##sys#slot v 1)
         (##sys#slot (subu8vector v from (or to len) 1))))))

$ (write-u8vector #u8(97 98 99))
; abc

$ (write-u8vector #u8(97 98 99) (current-output-port))
; Error: (car) bad argument type: #f

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
Which egg implements the CHICKEN wiki?
Visually impaired? Let me spell it for you (wav file) download WAV