This commit is contained in:
Justin Ethier 2019-11-25 14:20:26 -05:00
parent 6f10ee73ef
commit acb50614ee
3 changed files with 7 additions and 2 deletions

View file

@ -7,6 +7,10 @@ Features
- Faster record type constructors
- During compilation, validate the number of arguments passed to local function calls.
Bug Fixes
- Fixed `integer?` such that if `x` is an inexact real number, then `(integer? x)` is true if and only if `(= x (round x))`, per R7RS.
Internals
- When including an internal `.scm` file used by the compiler, check the current directory before the system directory.

View file

@ -1743,7 +1743,7 @@ object Cyc_is_integer(object o)
if ((o != NULL) && (obj_is_int(o) ||
(!is_value_type(o) && type_of(o) == integer_tag) ||
(!is_value_type(o) && type_of(o) == bignum_tag)
// || (!is_value_type(o) && type_of(o) == double_tag && double_value(o) == round(double_value(o)))
|| (!is_value_type(o) && type_of(o) == double_tag && double_value(o) == round(double_value(o)))
)) // Per R7RS
return boolean_t;
return boolean_f;

View file

@ -660,7 +660,8 @@
(list ; Allocate on the C stack
(string-append
c-make-macro "(" cvar-name ", " rnum ", " inum ");")))))
((integer? exp)
((and (integer? exp)
(exact? exp))
(c-code (string-append "obj_int2obj("
(number->string exp) ")")))
((real? exp)