https://github.com/JuliaLang/julia
Raw File
Tip revision: 1d8379ecb9e023fdf283345bdee8f2ab292a2748 authored by Shuhei Kadowaki on 29 January 2024, 02:18:25 UTC
concrete-eval sortable `Union` only
Tip revision: 1d8379e
bin2hex.scm
(define (read-u8) (io.read *input-stream* 'uint8))
(define modulo mod)
(define display princ)
(let loop ((b (read-u8))
           (i 0))
  (if (not (eof-object? b))
      (begin
        (if (> i 0)
            (display ", "))
        (display "0x") (display (number->string b 16))
        (if (= 0 (modulo (+ 1 i) 16))
            (newline))
        (loop (read-u8) (+ 1 i)))))
(newline)
back to top