tags:

views:

240

answers:

1

In Guile 1.6.*, the function scm_istring2number(char *str,int strlen,int radix) does the work.

However, this function does not exist in Guile 1.8.. How can I accomplish the same task in Guile 1.8.?

This is not trivial because the function scm_string_to_number(SCM str,int radix) does not convert numbers larger than 2^31-1 (at least in Guile 1.6.*).

+3  A: 

According to the 1.8 ChangeLog, the function has been renamed scm_c_locale_stringn_to_number.

Chris Jester-Young
In 1.8, scm_string_to_number actually unpacks the SCM values and passes them to scm_c_locale_stringn_to_number, so it should handle bignums too.
Chris Jester-Young
I found out that scm_string_to_number expects also the radix argument as SCM, and once I fixed it, it worked also for bignums.
Omer Zak