- (dotimes (i length)
- (let ((weight (ascii-digit char)))
- (cond
- ((and weight (not decimalp)) ;; before decimal point
- (setq before-decimal (+ weight (* 10 before-decimal)))
- (setq char (read-byte socket)))
- ((and weight decimalp) ;; after decimal point
- (setq after-decimal (+ weight (* 10 after-decimal)))
- (incf decimal-count)
- (setq char (read-byte socket)))
- ((and (= char +char-code-period+))
- (setq decimalp t)
- (setq char (read-byte socket)))
- ((or (= char +char-code-lower-e+) ;; E is for exponent
- (= char +char-code-upper-e+))
- (setq exponent (read-integer-from-socket socket (- length i)))
- (setq exponent (or exponent 0))
- (setq i length))
+ (block loop
+ (dotimes (i length)
+ (setq char (read-byte socket))
+ ;; (format t "~&len:~D, i:~D, char:~D, minusp:~A, decimalp:~A" length i char minusp decimalp)
+ (let ((weight (ascii-digit char)))
+ (cond
+ ((and weight (not decimalp)) ;; before decimal point
+ (setq before-decimal (+ weight (* 10 before-decimal))))
+ ((and weight decimalp) ;; after decimal point
+ (setq after-decimal (+ weight (* 10 after-decimal)))
+ (incf decimal-count))
+ ((and (= char +char-code-period+))
+ (setq decimalp t))
+ ((or (= char +char-code-lower-e+) ;; E is for exponent
+ (= char +char-code-upper-e+))
+ (setq exponent (read-integer-from-socket socket (- length i 1)))
+ (setq exponent (or exponent 0))
+ (return-from loop))