boot2

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

128-bv-copy-overlap.scm (362B)


      1 ; bytevector-copy! behaves as though the source range were copied first.
      2 (define right (bytevector 0 1 2 3 4))
      3 (bytevector-copy! right 1 right 0 4)
      4 (if (bytevector=? right (bytevector 0 0 1 2 3)) 0 (sys-exit 1))
      5 
      6 (define left (bytevector 0 1 2 3 4))
      7 (bytevector-copy! left 0 left 1 5)
      8 (if (bytevector=? left (bytevector 1 2 3 4 4)) 0 (sys-exit 2))
      9 
     10 (sys-exit 0)