diff --git a/lib/srfi/38.scm b/lib/srfi/38.scm index a25e96f9..149d1948 100644 --- a/lib/srfi/38.scm +++ b/lib/srfi/38.scm @@ -158,11 +158,15 @@ (shared '())) (define (read-label res) (let ((c (peek-char in))) - (if (and (not (eof-object? c)) - (or (char-numeric? c) - (memv (char-downcase c) '(#\a #\b #\c #\d #\e #\f)))) - (read-label (cons (read-char in) res)) - (list->string (reverse res))))) + (cond + ((and (not (eof-object? c)) + (or (char-numeric? c) + (memv (char-downcase c) '(#\a #\b #\c #\d #\e #\f)))) + (read-label (cons (read-char in) res))) + ((and (memv c '(#\+ #\-)) (null? res)) + (read-label (cons (read-char in) res))) + (else + (list->string (reverse res)))))) (define (read-number base) (let* ((str (read-label '())) (n (string->number str base))