0

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 231-1 (at least in Guile 1.6.*).

chqrlie
  • 131,814
  • 10
  • 121
  • 189
Omer Zak
  • 1,147
  • 2
  • 8
  • 25

1 Answers1

3

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

C. K. Young
  • 219,335
  • 46
  • 382
  • 435
  • 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. – C. K. Young Sep 29 '08 at 09:40
  • 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 Sep 29 '08 at 09:51