Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#30 string->number and number->string optional base

closed
nobody
Enhancement (1)
5
2012-12-14
2011-08-27
Doug Currie
No

The string->number and number->string functions do not provide the required optional base argument.

The attached diff contains an implementation for tinyscheme along with some fixes for other recently reported bugs.

Discussion

1 2 > >> (Page 1 of 2)
  • Doug Currie
    Doug Currie
    2011-08-27

    string->number and number->string functions and more

     
    Attachments
  • Doug Currie
    Doug Currie
    2011-08-27

    r4rs test modified for tinyscheme

     
    Attachments
  • Doug Currie
    Doug Currie
    2011-08-27

    r5rs test modified for tinyscheme

     
    Attachments
  • Doug Currie
    Doug Currie
    2011-08-29

    The r5rstest.ss in sxm found a defect in my string->number implementation; here's the fixed version:

    (define (string->number str . base)
    (let ((n (string->atom str (if (null? base) 10 (car base)))))
    (if (number? n) n #f)))

     
  • Kevin Cozens
    Kevin Cozens
    2011-08-30

    • status: open --> pending
     
  • Kevin Cozens
    Kevin Cozens
    2011-08-30

    The tinyscheme_75.diff file has too many change sets in it. I can't tell which ones are for this bug report. Please attach a patch file that includes only the changes required to add optional radix to the string->number and number->string procedures.

     
  • Doug Currie
    Doug Currie
    2011-08-30

    just the changes for optional radix

     
    Attachments
  • Doug Currie
    Doug Currie
    2011-08-30

    OK, the tiny scheme_80.diff has only the changes required to add optional radix to the string->number and number->string procedures.

     
  • Doug Currie
    Doug Currie
    2011-08-30

    • status: pending --> open
     
  • Kevin Cozens
    Kevin Cozens
    2012-11-06

    • labels: --> Enhancement
     
1 2 > >> (Page 1 of 2)