today we have a bunch of places that look like this:
switch (OBJECT_TYPE(callee)) {
case OBJECT_CLOSURE: {
#ifdef DEBUG_TRACE_EXECUTION
if (vm->trace_execution) {
debug__print_callframe_divider(vm);
}
#endif
bool result = call(AS_CLOSURE(callee), args_count, vm);
#ifdef DEBUG_TRACE_EXECUTION
if (vm->trace_execution) {
debug__show_callframe_names(vm);
#endif
return result;
}
one possibility might to follow the way of assert and make debug__ functions macros which hide all the ugliness behind them and which are compiled away when DEBUG_TRACE_EXECUTION is not defined.
today we have a bunch of places that look like this:
one possibility might to follow the way of
assert
and makedebug__
functions macros which hide all the ugliness behind them and which are compiled away whenDEBUG_TRACE_EXECUTION
is not defined.