From 640281efcbc2fbeaadfb1b0b5172e45af74c38cb Mon Sep 17 00:00:00 2001 From: sperber Date: Sat, 18 Nov 2006 14:16:55 +0000 Subject: [PATCH] Emilop Lepos reported this: As stated in the subject line: Welcome to scsh 0.6.7 (R6RS) Type ,? for help. > (string->number "1e2") #f Apply his suggested fix, which is taken from Scheme 48. --- scheme/rts/numio.scm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scheme/rts/numio.scm b/scheme/rts/numio.scm index 9c6261f..e90c9e0 100644 --- a/scheme/rts/numio.scm +++ b/scheme/rts/numio.scm @@ -121,6 +121,14 @@ #f) ;inexact ((char=? (string-ref string pos) #\#) #f) + ((and (= radix 10) + (case (char-downcase (string-ref string pos)) + ;; One day, we have to include #\s #\f #\d #\l. + ;; We don't now because STRING->FLOAT actually does the + ;; wrong thing for these currently, so we'd rather barf. + ((#\e) #t) + (else #f))) + #f) (else (loop (+ pos 1)))))))))))) (define-generic really-string->number &really-string->number)