* string->flonum now uses bytevectors as intermediate rep.

This commit is contained in:
Abdulaziz Ghuloum
2007-05-18 22:01:04 -04:00
parent 7ca0ddfa81
commit 691a42fe4e
4 changed files with 7 additions and 5 deletions
BIN
View File
Binary file not shown.
+4 -2
View File
@@ -13,12 +13,14 @@
(define (flonum->string x)
(utf8-bytevector->string
(or (foreign-call "ikrt_flonum_to_bytevector" x
(make-bytevector 80 0))
($make-bytevector 80))
(error 'flonum->string "~s is not a flonum" x))))
(define (string->flonum x)
(cond
[(string? x) (foreign-call "ikrt_string_to_flonum" x)]
[(string? x)
(foreign-call "ikrt_bytevector_to_flonum"
(string->utf8-bytevector x))]
[else
(error 'string->flonum "~s is not a string" x)])))