* Added flonum fasl reader.
This commit is contained in:
parent
f147e391eb
commit
b6779a0f87
BIN
bin/ikarus
BIN
bin/ikarus
Binary file not shown.
|
@ -514,8 +514,15 @@ static ikp do_read(ikpcb* pcb, fasl_port* p){
|
||||||
ref(pt, off_cdr) = do_read(pcb, p);
|
ref(pt, off_cdr) = do_read(pcb, p);
|
||||||
return pair;
|
return pair;
|
||||||
}
|
}
|
||||||
|
else if(c == 'f'){
|
||||||
|
ikp x = ik_alloc(pcb, flonum_size) + vector_tag;
|
||||||
|
ref(x, -vector_tag) = flonum_tag;
|
||||||
|
fasl_read_buf(p, x+disp_flonum_data-vector_tag, 8);
|
||||||
|
if(put_mark_index){
|
||||||
|
p->marks[put_mark_index] = x;
|
||||||
|
}
|
||||||
|
return x;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
fprintf(stderr, "invalid type '%c' (0x%02x) found in fasl file\n", c, c);
|
fprintf(stderr, "invalid type '%c' (0x%02x) found in fasl file\n", c, c);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
|
|
BIN
src/ikarus.boot
BIN
src/ikarus.boot
Binary file not shown.
|
@ -170,14 +170,14 @@
|
||||||
m]
|
m]
|
||||||
[(flonum? x)
|
[(flonum? x)
|
||||||
(write-char #\f p)
|
(write-char #\f p)
|
||||||
(write-byte ($flonum-u8-ref x 0) p)
|
|
||||||
(write-byte ($flonum-u8-ref x 1) p)
|
|
||||||
(write-byte ($flonum-u8-ref x 2) p)
|
|
||||||
(write-byte ($flonum-u8-ref x 3) p)
|
|
||||||
(write-byte ($flonum-u8-ref x 4) p)
|
|
||||||
(write-byte ($flonum-u8-ref x 5) p)
|
|
||||||
(write-byte ($flonum-u8-ref x 6) p)
|
|
||||||
(write-byte ($flonum-u8-ref x 7) p)
|
(write-byte ($flonum-u8-ref x 7) p)
|
||||||
|
(write-byte ($flonum-u8-ref x 6) p)
|
||||||
|
(write-byte ($flonum-u8-ref x 5) p)
|
||||||
|
(write-byte ($flonum-u8-ref x 4) p)
|
||||||
|
(write-byte ($flonum-u8-ref x 3) p)
|
||||||
|
(write-byte ($flonum-u8-ref x 2) p)
|
||||||
|
(write-byte ($flonum-u8-ref x 1) p)
|
||||||
|
(write-byte ($flonum-u8-ref x 0) p)
|
||||||
m]
|
m]
|
||||||
[(ratnum? x)
|
[(ratnum? x)
|
||||||
(write-char #\r p)
|
(write-char #\r p)
|
||||||
|
|
|
@ -880,7 +880,7 @@
|
||||||
(if ($bignum-positive? x) x (- x))]
|
(if ($bignum-positive? x) x (- x))]
|
||||||
[(flonum? x)
|
[(flonum? x)
|
||||||
(if ($flnegative? x)
|
(if ($flnegative? x)
|
||||||
($fl* x (exact->inexact -1))
|
($fl* x -1.0)
|
||||||
x)]
|
x)]
|
||||||
[(ratnum? x)
|
[(ratnum? x)
|
||||||
(let ([n ($ratnum-n x)])
|
(let ([n ($ratnum-n x)])
|
||||||
|
|
Loading…
Reference in New Issue