diff --git a/include/cyclone/runtime.h b/include/cyclone/runtime.h index d575e26e..5511f941 100644 --- a/include/cyclone/runtime.h +++ b/include/cyclone/runtime.h @@ -73,6 +73,7 @@ void gc_init_heap(long heap_size); #define Cyc_check_pair(d,obj) Cyc_check_type(d,Cyc_is_pair, pair_tag, obj); #define Cyc_check_proc(d,obj) Cyc_check_type2(d,Cyc_is_procedure, closureN_tag, obj); #define Cyc_check_num(d,obj) Cyc_check_type(d,Cyc_is_number, integer_tag, obj); +#define Cyc_check_fixnum(d,obj) Cyc_check_type(d,Cyc_is_fixnum, integer_tag, obj); #define Cyc_check_int(d,obj) Cyc_check_type(d,Cyc_is_integer, integer_tag, obj); #define Cyc_check_str(d,obj) Cyc_check_type(d,Cyc_is_string, string_tag, obj); #define Cyc_check_sym(d,obj) Cyc_check_type(d,Cyc_is_symbol, symbol_tag, obj); @@ -359,6 +360,7 @@ object Cyc_is_null(object o); object Cyc_is_number(object o); object Cyc_is_real(object o); object Cyc_is_integer(object o); +object Cyc_is_fixnum(object o); object Cyc_is_bignum(object o); object Cyc_is_vector(object o); object Cyc_is_bytevector(object o); diff --git a/runtime.c b/runtime.c index bd811299..f73eefc9 100644 --- a/runtime.c +++ b/runtime.c @@ -1465,6 +1465,13 @@ object Cyc_is_real(object o) return Cyc_is_number(o); } +object Cyc_is_fixnum(object o) +{ + if (obj_is_int(o)) + return boolean_t; + return boolean_f; +} + object Cyc_is_integer(object o) { if ((o != NULL) && (obj_is_int(o) ||