https://github.com/JuliaLang/julia
Raw File
Tip revision: ecae6e9edab66673e7449f76142b77d0be4a9ba5 authored by d-netto on 14 December 2023, 03:33:24 UTC
gc: count bytes allocated for thread stacks
Tip revision: ecae6e9
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