Fix implementation of string->number to include radix

Issue #44 new
Katie Burke created an issue

According to the scheme.com examples, any radix specifier within string, e.g., #x, overrides the radix argument. Also, string->number should allow for two arguments, the second being the radix.
http://www.scheme.com/tspl4/objects.html#./objects:s147

(string->number "#x#e-2e2")

Traceback (most recent call last):
System.FormatException: Input string was not in the correct format

(string->number "#e-2e2" 16)

Traceback (most recent call last):
File "stdin", line 1, col 1, calling 'string->number'
File "stdin", line 1, col 1
RunTimeError: incorrect number of arguments to string->number

Each of these examples should return -738.

Comments (1)

  1. Log in to comment