* added flonum?, string->flonum, and flonum->string.
This commit is contained in:
parent
c6bc77bc9d
commit
de910a3544
|
@ -7,12 +7,12 @@ all: ikarus
|
|||
|
||||
ikarus: ikarus-collect.o ikarus-runtime.o ikarus-main.o ikarus-fasl.o \
|
||||
ikarus-exec.o ikarus-print.o ikarus-enter.o ikarus-symbol-table.o \
|
||||
ikarus-weak-pairs.o ikarus-numerics.o
|
||||
ikarus-weak-pairs.o ikarus-numerics.o ikarus-flonums.o
|
||||
$(CC) $(LDFLAGS) -o ikarus \
|
||||
ikarus-main.o ikarus-runtime.o \
|
||||
ikarus-fasl.o ikarus-exec.o ikarus-print.o ikarus-enter.o \
|
||||
ikarus-symbol-table.o ikarus-collect.o ikarus-weak-pairs.o \
|
||||
ikarus-numerics.o
|
||||
ikarus-numerics.o ikarus-flonums.o
|
||||
|
||||
ikarus-main.o: ikarus-main.c ikarus.h
|
||||
$(CC) $(CFLAGS) -c ikarus-main.c
|
||||
|
@ -45,6 +45,9 @@ ikarus-symbol-table.o: ikarus-symbol-table.c ikarus.h
|
|||
ikarus-numerics.o: ikarus-numerics.c ikarus.h
|
||||
$(CC) $(CFLAGS) -c ikarus-numerics.c
|
||||
|
||||
ikarus-flonums.o: ikarus-flonums.c ikarus.h
|
||||
$(CC) $(CFLAGS) -c ikarus-flonums.c
|
||||
|
||||
ikarus.h: ikarus-data.h
|
||||
touch ikarus.h
|
||||
|
||||
|
|
BIN
bin/ikarus
BIN
bin/ikarus
Binary file not shown.
|
@ -196,4 +196,9 @@
|
|||
#define disp_bignum_data wordsize
|
||||
#define off_bignum_data (disp_bignum_data - vector_tag)
|
||||
|
||||
#define flonum_tag ((ikp)0xFF)
|
||||
#define flonum_size 16
|
||||
#define disp_flonum_data 8
|
||||
#define off_flonum_data (disp_flonum_data - vector_tag)
|
||||
|
||||
#endif
|
||||
|
|
BIN
src/ikarus.boot
BIN
src/ikarus.boot
Binary file not shown.
|
@ -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?
|
||||
|
|
|
@ -92,6 +92,8 @@
|
|||
char-downcase max min complex? real? rational?
|
||||
exact? inexact? integer?
|
||||
string->number
|
||||
|
||||
flonum? flonum->string string->flonum
|
||||
))
|
||||
|
||||
(define system-primitives
|
||||
|
|
Loading…
Reference in New Issue