boot2

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

048-display-write.scm (801B)


      1 ; Verify display and write across the value spaces.
      2 ;
      3 ; display emits human-readable output: bytevectors as raw bytes, no
      4 ; quotes; symbols as their name; pairs in list syntax; immediates in
      5 ; their reader form. write is identical except bytevectors are quoted
      6 ; "..." (treated as strings).
      7 (define (newline) (display (make-bytevector 1 10)))
      8 
      9 (define hi (make-bytevector 2 0))
     10 (bytevector-u8-set! hi 0 104)
     11 (bytevector-u8-set! hi 1 105)
     12 
     13 (display 42) (newline)
     14 (display -7) (newline)
     15 (display 'foo) (newline)
     16 (display '()) (newline)
     17 (display #t) (newline)
     18 (display #f) (newline)
     19 (display '(1 2 3)) (newline)
     20 (display '(1 . 2)) (newline)
     21 (display '(a (b c) d)) (newline)
     22 (display hi) (newline)
     23 
     24 (write 42) (newline)
     25 (write 'foo) (newline)
     26 (write '(1 2 3)) (newline)
     27 (write hi) (newline)
     28 
     29 (sys-exit 0)