Added Cyc_check_argc macro to help w/new functions

This commit is contained in:
Justin Ethier 2021-01-21 23:03:55 -05:00
parent 2afd1b48b7
commit 23249133af

View file

@ -76,6 +76,15 @@ void gc_init_heap(long heap_size);
} \
}
#define Cyc_check_argc(data, fnc_name, argc, expected) { \
if (expected > argc) { \
char buf[128]; \
snprintf(buf, 127, "Expected %d arguments to %s but received %ld", \
expected, fnc_name, argc); \
Cyc_rt_raise_msg(data, buf); \
} \
}
#define Cyc_verify_mutable(data, obj) { \
if (immutable(obj)) Cyc_immutable_obj_error(data, obj); }
#define Cyc_verify_immutable(data, obj) { \