diff --git a/include/cyclone/runtime.h b/include/cyclone/runtime.h index 690cb0b2..52c90ef7 100644 --- a/include/cyclone/runtime.h +++ b/include/cyclone/runtime.h @@ -440,9 +440,8 @@ int equal(object, object); object equalp(object, object); object Cyc_has_cycle(object lst); object Cyc_is_boolean(object o); -//object Cyc_is_pair(object o); #define Cyc_is_pair(o) ((is_object_type(o) && ((list) o)->tag == pair_tag) ? boolean_t : boolean_f) -object Cyc_is_null(object o); +#define Cyc_is_null(o) make_boolean(o == NULL) object Cyc_is_number(object o); object Cyc_is_complex(object o); object Cyc_is_real(object o); diff --git a/include/cyclone/types.h b/include/cyclone/types.h index 8a36c383..1d5fdcdf 100644 --- a/include/cyclone/types.h +++ b/include/cyclone/types.h @@ -626,6 +626,8 @@ typedef boolean_type *boolean; #define boolean_desc(x) (((boolean_type *) x)->desc) +#define make_boolean(x) (x ? boolean_t : boolean_f) + /** * @brief Symbols are similar to strings, but only one instance of each * unique symbol is created, so comparisons are O(1). diff --git a/runtime.c b/runtime.c index 791934f9..58b9e32b 100644 --- a/runtime.c +++ b/runtime.c @@ -1557,13 +1557,13 @@ object Cyc_is_boolean(object o) // return boolean_t; // return boolean_f; //} - -object Cyc_is_null(object o) -{ - if (o == NULL) - return boolean_t; - return boolean_f; -} +// +//object Cyc_is_null(object o) +//{ +// if (o == NULL) +// return boolean_t; +// return boolean_f; +//} object Cyc_is_number(object o) {