summaryrefslogtreecommitdiffstats
path: root/lib.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-11-07 06:38:26 -0800
committerKaz Kylheku <kaz@kylheku.com>2018-11-07 06:38:26 -0800
commitb0828e2dd7540651aa6863c8bc7814d86ad9401e (patch)
tree533b5cea87558792b8cd43f88e623e9c213c0106 /lib.h
parent01d9bb460e8eb76c47cdf3982dd235fe370ff137 (diff)
downloadtxr-b0828e2dd7540651aa6863c8bc7814d86ad9401e.tar.gz
txr-b0828e2dd7540651aa6863c8bc7814d86ad9401e.tar.bz2
txr-b0828e2dd7540651aa6863c8bc7814d86ad9401e.zip
type_check: take function name arg.
* arith.c (flo_int): Pass down name to type_check. * eval.c (copy_env, env_fbind, env_vbind, env_vb_to_fb, func_get_name, lexical_var_p, lexical_fun_p, lexical_lisp1_binding, squash_menv_deleting_range, op_upenv): Pass relevant Lisp function name to type_check. (lookup_global_var, lookup_sym_lisp1, lookup_fun, lookup_mac, lookup_symac, lookup_symac_lisp1): For these widely used functions, pass situational prefix in place of function name. They may get a funtion name argument in the future. * gc.c (gc_finalize): Pass function name to type_check. * lib.c (throw_mismatch): Take function nme argument, incorporate into mesage. (lcons_fun, c_flo, string_extend, symbol_name, symbol_package, get_package, package_name, func_get_form, func_get_env, func_set_env, vec_set_length, length_vec, size_vec, list_vec, lay_str_force, lay_str_force_upto, lazy_str_get_trailing_list, from, too, set_from, set_to): Pass relevant Lisp function name to type_check. (symbol_setname, symbol_visible): Pass indication of internal error into type_check, since this doesn't pertain to any Lisp function being wrong. * lib.h (throw_mismatch): Declaration updated. (type_check): Take new parameter and pass down to throw_mismatch. * signal.c (set_sig_handler): Pass name down to type_check.
Diffstat (limited to 'lib.h')
-rw-r--r--lib.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib.h b/lib.h
index 0868d31c..11228ced 100644
--- a/lib.h
+++ b/lib.h
@@ -508,11 +508,11 @@ val typeof(val obj);
val subtypep(val sub, val sup);
val typep(val obj, val type);
seq_info_t seq_info(val cobj);
-val throw_mismatch(val obj, type_t);
-INLINE val type_check(val obj, type_t typecode)
+val throw_mismatch(val self, val obj, type_t);
+INLINE val type_check(val self, val obj, type_t typecode)
{
if (type(obj) != typecode)
- throw_mismatch(obj, typecode);
+ throw_mismatch(self, obj, typecode);
return t;
}
val type_check2(val obj, int, int);