mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-16 17:27:33 +02:00
More compatibility for integer value types
This commit is contained in:
parent
104ee22b5f
commit
d0efac2035
1 changed files with 5 additions and 4 deletions
|
@ -810,8 +810,8 @@ object Cyc_is_null(object o){
|
|||
return boolean_f;}
|
||||
|
||||
object Cyc_is_number(object o){
|
||||
if (!nullp(o) && !is_value_type(o) &&
|
||||
(type_of(o) == integer_tag || type_of(o) == double_tag))
|
||||
if (!nullp(o) && (obj_is_int(o) ||
|
||||
(!is_value_type(o) && (type_of(o) == integer_tag || type_of(o) == double_tag))))
|
||||
return boolean_t;
|
||||
return boolean_f;}
|
||||
|
||||
|
@ -819,7 +819,8 @@ object Cyc_is_real(object o){
|
|||
return Cyc_is_number(o);}
|
||||
|
||||
object Cyc_is_integer(object o){
|
||||
if (!nullp(o) && !is_value_type(o) && type_of(o) == integer_tag)
|
||||
if (!nullp(o) && (obj_is_int(o) ||
|
||||
(!is_value_type(o) && type_of(o) == integer_tag)))
|
||||
return boolean_t;
|
||||
return boolean_f;}
|
||||
|
||||
|
@ -930,7 +931,7 @@ object Cyc_vector_set(void *data, object v, object k, object obj) {
|
|||
int idx;
|
||||
Cyc_check_vec(data, v);
|
||||
Cyc_check_int(data, k);
|
||||
idx = ((integer_type *)k)->value;
|
||||
idx = obj_is_int(k) ? obj_obj2int(k) : ((integer_type *)k)->value;
|
||||
|
||||
if (idx < 0 || idx >= ((vector)v)->num_elt) {
|
||||
Cyc_rt_raise2(data, "vector-set! - invalid index", k);
|
||||
|
|
Loading…
Add table
Reference in a new issue