;;; -*-Scheme-*-
;;;
-;;; $Id: nntp.scm,v 1.15 1997/11/01 19:33:58 cph Exp $
+;;; $Id: nntp.scm,v 1.16 1997/11/04 11:02:07 cph Exp $
;;;
;;; Copyright (c) 1995-97 Massachusetts Institute of Technology
;;;
(define (token->number token)
(or (substring->nonnegative-integer token 0 (string-length token))
(error:bad-range-argument token #f)))
-
-(define (substring->nonnegative-integer line start end)
- (let loop ((index start) (n 0))
- (if (fix:= index end)
- n
- (let ((k (fix:- (vector-8b-ref line index) (char->integer #\0))))
- (and (fix:>= k 0)
- (fix:< k 10)
- (loop (fix:+ index 1) (+ (* n 10) k)))))))
\f
(define (substring-skip-leading-space string start end)
(let loop ((index start))
;;; -*-Scheme-*-
;;;
-;;; $Id: utils.scm,v 1.41 1997/11/04 09:27:31 cph Exp $
+;;; $Id: utils.scm,v 1.42 1997/11/04 11:01:25 cph Exp $
;;;
;;; Copyright (c) 1986, 1989-97 Massachusetts Institute of Technology
;;;
(cond ((string-null? x) y)
((string-null? y) x)
(else (string-append x " " y))))
+
+(define (substring->nonnegative-integer line start end)
+ (let loop ((index start) (n 0))
+ (if (fix:= index end)
+ n
+ (let ((k (fix:- (vector-8b-ref line index) (char->integer #\0))))
+ (and (fix:>= k 0)
+ (fix:< k 10)
+ (loop (fix:+ index 1) (+ (* n 10) k)))))))
\f
(define char-set:null
(char-set))