boot2

Playing with the boostrap
git clone https://git.ryansepassi.com/git/boot2.git
Log | Files | Refs | README

13-vector.scm (364B)


      1 ;; Vector core: make-vector vector-ref vector-set! vector-length
      2 ;; vector->list list->vector.
      3 (define v (make-vector 3 0))
      4 (vector-set! v 1 7)
      5 (if (= (vector-length v) 3)
      6   (if (= (vector-ref v 1) 7)
      7     (if (equal? (vector->list v) (list 0 7 0))
      8       (if (equal? (vector->list (list->vector (list 1 2 3)))
      9                   (list 1 2 3))
     10         42 0) 0) 0) 0)