chicken-janitors
[Top][All Lists]
Advanced

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

Re: [Chicken-janitors] #674: ##sys#string->number gets called without pr


From: Chicken Trac
Subject: Re: [Chicken-janitors] #674: ##sys#string->number gets called without prefixes in the reader
Date: Fri, 23 Sep 2011 19:08:06 -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          
Resolution:                  |    Keywords:  reader, numbers
-----------------------------+----------------------------------------------

Comment(by sjamaan):

 This patch works; numbers now passes all its tests. It doesn't fix the
 reader accepting syntax like "#e#x#e10", but that's arguabling a separate
 problem.

 I don't know about the hooks. The complete list of hooks being used is:

 {{{
 ##sys#number->string
 ##sys#string->number
 ##sys#number?
 ##sys#integer?
 ##sys#exact?
 ##sys#inexact?
 ##sys#inexact->exact
 ##sys#exact->inexact
 }}}

 I tried removing them, but this causes the tests to fail; apparently
 because the "test" egg is using {{{inexact?}}} and {{{number?}}} to check
 if the expression results in a flonum or a fixnum. It just happens to work
 because it's not really relying on the number type otherwise.

 Also, the core system itself relies on {{{number?}}} being hooked to
 dispatch when printing an object (it shows {{{#<bignum>}}} when printing a
 bignum when {{{number?}}} isn't hooked. I could of course define a record
 printer for bignums, ratnums and compnums instead, but who knows what else
 relies on {{{number?}}} returning #t for all numbers?)

 I don't know about the others, but I expect similar hairy issues to arise
 when we just rip them out.

-- 
Ticket URL: <http://bugs.call-cc.org/ticket/674#comment:2>
Chicken Scheme <http://www.call-with-current-continuation.org/>
Chicken Scheme is a compiler for the Scheme programming language.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]