((and (> c 96) (< c 103)) (+ (- c 97) 10))
((and (> c 47) (< c 58)) (- c 48))
(#t 0)))
- (define (read-hex c p n)
+ (define (read-hex c p s n)
(if (not (or (and (> p 64) (< p 71))
(and (> p 96) (< p 103))
- (and (> p 47) (< p 58)))) (+ (ash n 4) (calc c))
- (read-hex (read-byte) (peek-byte) (+ (ash n 4) (calc c)))))
+ (and (> p 47) (< p 58)))) (* s (+ (ash n 4) (calc c)))
+ (read-hex (read-byte) (peek-byte) s (+ (ash n 4) (calc c)))))
((lambda (c p)
- (read-hex c p 0))
+ (if (eq? c 45) (read-hex (read-byte) (peek-byte) -1 0)
+ (read-hex c p 1 0)))
(read-byte) (peek-byte)))
(define (read-string)