From: Chris Hanson Date: Fri, 27 Oct 1989 04:42:59 +0000 (+0000) Subject: When parsing a badly-formed number with a #i prefix, don't blindly X-Git-Tag: 20090517-FFI~11736 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=6dab46b2d38e8a35724a8a0c1a277e7b943188cb;p=mit-scheme.git When parsing a badly-formed number with a #i prefix, don't blindly attempt to map the result to inexact; test to see if the number is well-formed first. --- diff --git a/v7/src/runtime/numpar.scm b/v7/src/runtime/numpar.scm index 8c0a61a5c..5d6e41dfc 100644 --- a/v7/src/runtime/numpar.scm +++ b/v7/src/runtime/numpar.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/numpar.scm,v 14.3 1989/10/26 06:50:33 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/numpar.scm,v 14.4 1989/10/27 04:42:59 cph Exp $ Copyright (c) 1989 Massachusetts Institute of Technology @@ -46,7 +46,9 @@ MIT in each case. |# (with-values (lambda () (parse-prefix (string->list string))) (lambda (chars radix-prefix exactness) ((if (eq? exactness 'INEXACT) - exact->inexact + (lambda (number) + (and number + (exact->inexact number))) identity-procedure) (let ((radix (or radix-prefix radix-default))) (with-values (lambda () (parse-sign chars))