[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-janitors] #674: ##sys#string->number gets called without prefix
From: |
Chicken Trac |
Subject: |
[Chicken-janitors] #674: ##sys#string->number gets called without prefixes in the reader |
Date: |
Fri, 26 Aug 2011 13:04:50 -0000 |
#674: ##sys#string->number gets called without prefixes in the reader
-----------------------------+----------------------------------------------
Reporter: sjamaan | Owner: felix
Type: defect | Status: new
Priority: major | Milestone: 4.8.0
Component: core libraries | Version: 4.7.x
Keywords: reader, numbers |
-----------------------------+----------------------------------------------
Chicken core's reader calls ##sys#string->number on the number without the
radix&exactness prefix.
This causes issues when for example you're reading something like the
following: "#e1e500". The reader passes on "1.0e500" and then converts it
to an exact number using inexact->exact, but that fails because flonums
can't represent a number that large. I know it's probably a bit of an
edge case, but this is more convenient input syntax than typing a 1
followed by 500 zeroes, which AFAIK is the only other way to enter an
exact number like that.
Another approach would be to do like I now do in numbers trunk itself;
string->number first analyses the prefix like Chicken core does, and then
passes the radix *and* an extra argument indicating whether to force
exactness (or inexactness?) to the procedure that handles the actual
number parsing. This would be an easier fix, but I think this can't be
done in a backwards-compatible way.
--
Ticket URL: <http://bugs.call-cc.org/ticket/674>
Chicken Scheme <http://www.call-with-current-continuation.org/>
Chicken Scheme is a compiler for the Scheme programming language.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Chicken-janitors] #674: ##sys#string->number gets called without prefixes in the reader,
Chicken Trac <=