int main() { equality_test(); ordering_test(); return boost::report_errors(); }
static value_t *e_equals(env_t *env, expr_t *l, expr_t *r) { value_t *result; result = alloc_value(v_bool); bool_val(result) = equality_test(e_expr(env, l), e_expr(env, r)); return result; }
static int equality_test_i(void *data_l, void *data_r, void *info) { int *equal = (int *)info; value_t *l = (value_t *)data_l; value_t *r = (value_t *)data_r; if (*equal) { *equal = equality_test(l, r); } return 1; }
static int equality_test_i(void *data_l, void *data_r, void *info) { int *equal = (int *)info; value_t *l = (value_t *)data_l; value_t *r = (value_t *)data_r; if (*equal) { // Careful: we might be in the middle of a data structure, so force the thunks. *equal = equality_test(thunk_force(l), thunk_force(r)); } return 1; }