[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Scheme-reports] Unintended consequences of #319



Ticket #319, which requires that `string->number`, `read`, and the program
reader used by the implementation all impose the same restrictions,
if any, on reading numbers, was adopted by the WG on the fifth ballot.

On my reading of it, this means that the R5RS permission for
`string->number` to return #f if its argument has a radix prefix is
inconsistent with this decision (since "#x10" must work in code, it must
work in `string->number` as well), and I have withdrawn it accordingly:

    The rules used by a particular implementation for string->number
    must also be applied toread and to the routine that reads programs,
    in order to maintain consistency between internal numeric processing,
    I/O, and the processing of programs. As a consequence, the R5RS
    permission to return #f whenstring has an explicit radix prefix has
    been withdrawn.

I tested `(string->number "#x10")` against my usual test suite.
Racket, Gauche, MIT, Gambit, Chicken (with or without the numbers egg),
Scheme48/scsh, Guile, SISC, Chibi, Chez, SCM, Ikarus/Vicare, Larceny,
Ypsilon, Mosh, IronScheme, NexJ, STklos, TinyScheme, Scheme 7, Rep,
Elk, UMB, SXI, Sizzle, Spark, Inlab, Owl Lisp all return 16.  Bigloo,
Kawa, KSi, SigScheme, Dream, BDC, XLisp, Schemik, VX return #f.  (Shoe,
Oaklisp, MScheme, Bus don't support `string->number'.)

However, as I don't think the WG foresaw this, I'm posting this advisory
to see if there are any comments.

-- 
I now introduce Professor Smullyan,             John Cowan
who will prove to you that either               cowan@x
he doesn't exist or you don't exist,            http://www.ccil.org/~cowan
but you won't know which.                               --Melvin Fitting

_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports