* added flonum?, string->flonum, and flonum->string.

This commit is contained in:
Abdulaziz Ghuloum
2007-01-20 17:49:25 -05:00
parent c6bc77bc9d
commit de910a3544
6 changed files with 31 additions and 2 deletions
BIN
View File
Binary file not shown.
+19
View File
@@ -1,4 +1,23 @@
(let ()
(define (flonum? x)
(foreign-call "ikrt_is_flonum" x))
(define (flonum->string x)
(or (foreign-call "ikrt_flonum_to_string" x)
(error 'flonum->string "~s is not a flonum" x)))
(define (string->flonum x)
(cond
[(string? x) (foreign-call "ikrt_string_to_flonum" x)]
[else
(error 'string->flonum "~s is not a string" x)]))
(primitive-set! 'flonum? flonum?)
(primitive-set! 'flonum->string flonum->string)
(primitive-set! 'string->flonum string->flonum)
)
(let ()
(define bignum?
+2
View File
@@ -92,6 +92,8 @@
char-downcase max min complex? real? rational?
exact? inexact? integer?
string->number
flonum? flonum->string string->flonum
))
(define system-primitives