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.
string->number and number->string functions and more
r4rs test modified for tinyscheme
r5rs test modified for tinyscheme
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)))
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.
just the changes for optional radix
OK, the tiny scheme_80.diff has only the changes required to add optional radix to the string->number and number->string procedures.
Applied 2012-12-14 15:17:37 -0500 (Fri, 14 Dec 2012) as revision 92.
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.