5 (when (args) (write-line 2 (join (map string (args)) " ")))
9 ;; Print binary byte as octal or as ASCII character [32-126]
10 (define (octal-byte x)
11 (if (and (> x 31) (< x 127)) (char x) (format "\\%o" x)))
13 ;; Print string as binary octals
14 (define (octals-string S)
15 (join (map octal-byte (unpack (dup "b" (length S)) S))))
17 ;; Return byte code as printable or as code.
18 (define (human-byte B)
19 (if (and (> B 32) (< B 127)) (char B) B))
21 ;; Return a packed encoding of a list of bytes, joining string elements
22 (define (human-bytes BL)
23 (let ((OUT '()) (X nil))
24 (dolist (B (map human-byte BL))
25 (if (string? B) (if X (extend X B) (setf X B))
26 (begin (when (string? X) (push X OUT -1))
29 (when (string? X) (push X OUT -1))
32 (global 'octals-string 'octal-byte 'human-byte 'human-bytes)