From 409125e6c1ba1a29e8c2ce68d1ae735606ced2a0 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 18 Feb 2022 21:58:48 -0800 Subject: lisplib: rename lisplib funtions to autoload prefix. * lisplib.c (lisplib_init): Follow rename, and rename try-load-fun to autoload-try-fun. (lisplib_try_load_fun, lisplib_try_load_var, lisplib_try_load_fun_var, lisplib_try_load_slot, lisplib_try_load_struct, lisplib_try_load_keyword): Renamed from `lisplib_try_load_@kind` to `autoload_try_@kind`. * lisplib.h (lisplib_try_load_fun, lisplib_try_load_var, lisplib_try_load_fun_var, lisplib_try_load_slot, lisplib_try_load_struct, lisplib_try_load_keyword): Declarations renamed. * eval.c (lookup_global_var, lookup_sym_lisp1, lookup_fun, lookup_mac, lookup_symac, lookup_symac_lisp1, special_var_p, expand_param_macro, rt_defvar, rt_defv, op_defsymacro, rt_defsymacro, rt_defun, rt_defmacro, makunbound, fmakunbound, mmakunbound): Follow rename. * struct.c (make_struct_type, find_struct_type, lookup_slot_load, lookup_static_slot_load, lookup_static_slot_desc_load, slot_types, static_slot_types): Follow rename. * stdlib/place.tl (get-place-macro): Follow rename of try-load-fun to autoload-try-fun. --- eval.c | 36 ++++++++++++++++++------------------ lisplib.c | 18 +++++++++--------- lisplib.h | 12 ++++++------ stdlib/place.tl | 2 +- struct.c | 16 ++++++++-------- 5 files changed, 42 insertions(+), 42 deletions(-) diff --git a/eval.c b/eval.c index 6432cb3c..3c456fc1 100644 --- a/eval.c +++ b/eval.c @@ -529,7 +529,7 @@ val lookup_global_var(val sym) { uses_or2; return or2(gethash(top_vb, sym), - if2(lisplib_try_load_var(sym), gethash(top_vb, sym))); + if2(autoload_try_var(sym), gethash(top_vb, sym))); } val lookup_var(val env, val sym) @@ -582,7 +582,7 @@ val lookup_sym_lisp1(val env, val sym) } return or3(gethash(top_vb, sym), - if2(lisplib_try_load_fun_var(sym), + if2(autoload_try_fun_var(sym), gethash(top_vb, sym)), gethash(top_fb, sym)); } @@ -604,7 +604,7 @@ val lookup_fun(val env, val sym) val strct = cadr(sym); val slot = caddr(sym); val type = or2(find_struct_type(strct), - if2(lisplib_try_load_struct(strct), + if2(autoload_try_struct(strct), find_struct_type(strct))); if (slot == init_k) { return cons(sym, struct_get_initfun(type)); @@ -634,7 +634,7 @@ val lookup_fun(val env, val sym) } return or2(gethash(top_fb, sym), - if2(lisplib_try_load_fun(sym), gethash(top_fb, sym))); + if2(autoload_try_fun(sym), gethash(top_fb, sym))); } val func_get_name(val fun, val env) @@ -684,7 +684,7 @@ static val lookup_mac(val menv, val sym) if (nilp(menv)) { return or2(gethash(top_mb, sym), - if2(lisplib_try_load_fun(sym), gethash(top_mb, sym))); + if2(autoload_try_fun(sym), gethash(top_mb, sym))); } else { type_check(lit("macro lookup"), menv, ENV); @@ -703,7 +703,7 @@ static val lookup_symac(val menv, val sym) if (nilp(menv)) { return or2(gethash(top_smb, sym), - if2(lisplib_try_load_var(sym), gethash(top_smb, sym))); + if2(autoload_try_var(sym), gethash(top_smb, sym))); } else { type_check(lit("symacro lookup"), menv, ENV); @@ -722,7 +722,7 @@ static val lookup_symac_lisp1(val menv, val sym) if (nilp(menv)) { return or2(gethash(top_smb, sym), - if2(lisplib_try_load_var(sym), gethash(top_smb, sym))); + if2(autoload_try_var(sym), gethash(top_smb, sym))); } else { type_check(lit("symacro lookup"), menv, ENV); @@ -755,7 +755,7 @@ static val special_var_p(val sym) { uses_or2; return or2(gethash(special, sym), - if2(lisplib_try_load_var(sym), gethash(special, sym))); + if2(autoload_try_var(sym), gethash(special, sym))); } static val lexical_var_p(val menv, val sym) @@ -1209,7 +1209,7 @@ static val expand_param_macro(val params, val body, val menv, val form) return cons(params, body); if (!pmac) { - lisplib_try_load_keyword(sym); + autoload_try_keyword(sym); pmac = gethash(pm_table, sym); if (!pmac) expand_error(form, lit("~s: keyword ~s has no param macro binding"), @@ -2031,7 +2031,7 @@ static val rt_defvarl(val sym) { val self = lit("sys:defvarl"); val new_p; - val cell = (lisplib_try_load_var(sym), + val cell = (autoload_try_var(sym), gethash_c(self, top_vb, sym, mkcloc(new_p))); if (new_p || !cdr(cell)) { @@ -2048,7 +2048,7 @@ static val rt_defv(val sym) { val self = lit("sys:defv"); val new_p; - val cell = (lisplib_try_load_var(sym), + val cell = (autoload_try_var(sym), gethash_c(self, top_vb, sym, mkcloc(new_p))); if (new_p) { @@ -2082,7 +2082,7 @@ static val op_defsymacro(val form, val env) (void) env; - lisplib_try_load_var(sym); + autoload_try_var(sym); remhash(top_vb, sym); if (!opt_compat || opt_compat > 143) remhash(special, sym); @@ -2092,7 +2092,7 @@ static val op_defsymacro(val form, val env) static val rt_defsymacro(val sym, val def) { - lisplib_try_load_var(sym); + autoload_try_var(sym); remhash(top_vb, sym); remhash(special, sym); sethash(top_smb, sym, cons(sym, def)); @@ -2114,7 +2114,7 @@ void trace_check(val name) static val rt_defun(val name, val function) { - lisplib_try_load_fun(name); + autoload_try_fun(name); sethash(top_fb, name, cons(name, function)); uw_purge_deferred_warning(cons(fun_s, name)); uw_purge_deferred_warning(cons(sym_s, name)); @@ -2123,7 +2123,7 @@ static val rt_defun(val name, val function) static val rt_defmacro(val sym, val name, val function) { - lisplib_try_load_fun(sym); + autoload_try_fun(sym); sethash(top_mb, sym, cons(name, function)); return name; } @@ -5852,7 +5852,7 @@ static val makunbound(val sym) { val env; - lisplib_try_load_var(sym); + autoload_try_var(sym); if (!opt_compat || opt_compat > 143) { for (env = dyn_env; env; env = env->e.up_env) { @@ -5875,7 +5875,7 @@ static val makunbound(val sym) static val fmakunbound(val sym) { - lisplib_try_load_var(sym); + autoload_try_var(sym); remhash(top_fb, sym); if (opt_compat && opt_compat <= 127) remhash(top_mb, sym); @@ -5885,7 +5885,7 @@ static val fmakunbound(val sym) static val mmakunbound(val sym) { - lisplib_try_load_fun(sym); + autoload_try_fun(sym); remhash(top_mb, sym); return sym; } diff --git a/lisplib.c b/lisplib.c index 32f4db64..2dbf4492 100644 --- a/lisplib.c +++ b/lisplib.c @@ -1094,7 +1094,7 @@ void lisplib_init(void) autoload_reg(pic_instantiate, pic_set_entries); autoload_reg(constfun_instantiate, constfun_set_entries); - reg_fun(intern(lit("try-load-fun"), system_package), func_n1(lisplib_try_load_fun)); + reg_fun(intern(lit("autoload-try-fun"), system_package), func_n1(autoload_try_fun)); } static val lisplib_try_load(al_ns_t ns, val sym) @@ -1115,34 +1115,34 @@ static val lisplib_try_load(al_ns_t ns, val sym) return nil; } -val lisplib_try_load_fun(val sym) +val autoload_try_fun(val sym) { return lisplib_try_load(al_fun, sym); } -val lisplib_try_load_var(val sym) +val autoload_try_var(val sym) { return lisplib_try_load(al_var, sym); } -val lisplib_try_load_fun_var(val sym) +val autoload_try_fun_var(val sym) { uses_or2; - return or2(lisplib_try_load_fun(sym), - lisplib_try_load_var(sym)); + return or2(autoload_try_fun(sym), + autoload_try_var(sym)); } -val lisplib_try_load_slot(val sym) +val autoload_try_slot(val sym) { return lisplib_try_load(al_slot, sym); } -val lisplib_try_load_struct(val sym) +val autoload_try_struct(val sym) { return lisplib_try_load(al_struct, sym); } -val lisplib_try_load_keyword(val sym) +val autoload_try_keyword(val sym) { return lisplib_try_load(al_key, sym); } diff --git a/lisplib.h b/lisplib.h index 5a364a9e..6b4a81b0 100644 --- a/lisplib.h +++ b/lisplib.h @@ -32,12 +32,12 @@ typedef enum autoload_ns { extern val trace_loaded; void lisplib_init(void); -val lisplib_try_load_fun(val sym); -val lisplib_try_load_var(val sym); -val lisplib_try_load_fun_var(val sym); -val lisplib_try_load_slot(val sym); -val lisplib_try_load_struct(val sym); -val lisplib_try_load_keyword(val sym); +val autoload_try_fun(val sym); +val autoload_try_var(val sym); +val autoload_try_fun_var(val sym); +val autoload_try_slot(val sym); +val autoload_try_struct(val sym); +val autoload_try_keyword(val sym); void autoload_set(al_ns_t ns, val *name, val fun); val autoload_reg(val (*instantiate)(val), val (*set_entries)(val)); diff --git a/stdlib/place.tl b/stdlib/place.tl index df3d09fb..07ee7be4 100644 --- a/stdlib/place.tl +++ b/stdlib/place.tl @@ -61,7 +61,7 @@ (defun sys:get-place-macro (sym) (or [*place-macro* sym] - (progn (sys:try-load-fun sym) [*place-macro* sym]))) + (progn (sys:autoload-try-fun sym) [*place-macro* sym]))) (defun sys:pl-expand (unex-place env) (while t diff --git a/struct.c b/struct.c index b994f6d4..f38e306f 100644 --- a/struct.c +++ b/struct.c @@ -46,7 +46,7 @@ #include "args.h" #include "cadr.h" #include "txr.h" -#include "lisplib.h" +#include "autoload.h" #include "struct.h" #define max(a, b) ((a) > (b) ? (a) : (b)) @@ -442,7 +442,7 @@ val make_struct_type(val name, val supers, val self = lit("make-struct-type"); val iter; - lisplib_try_load_struct(name); + autoload_try_struct(name); if (built_in_type_p(name)) uw_throwf(error_s, lit("~a: ~s is a built-in type"), @@ -604,7 +604,7 @@ val find_struct_type(val sym) { uses_or2; return or2(gethash(struct_type_hash, sym), - if2(lisplib_try_load_struct(sym), + if2(autoload_try_struct(sym), gethash(struct_type_hash, sym))); } @@ -1199,7 +1199,7 @@ static loc lookup_slot_load(val inst, struct struct_inst *si, val sym) { loc ptr = lookup_slot(inst, si, sym); if (nullocp(ptr)) { - lisplib_try_load_slot(sym); + autoload_try_slot(sym); return lookup_slot(inst, si, sym); } return ptr; @@ -1209,7 +1209,7 @@ static loc lookup_static_slot_load(struct struct_type *st, val sym) { loc ptr = lookup_static_slot(st, sym); if (nullocp(ptr)) { - lisplib_try_load_slot(sym); + autoload_try_slot(sym); return lookup_static_slot(st, sym); } return ptr; @@ -1220,7 +1220,7 @@ static struct stslot *lookup_static_slot_desc_load(struct struct_type *st, { struct stslot *stsl = lookup_static_slot_desc(st, sym); if (stsl == 0) { - lisplib_try_load_slot(sym); + autoload_try_slot(sym); return lookup_static_slot_desc(st, sym); } return stsl; @@ -1995,7 +1995,7 @@ val slot_types(val slot) { uses_or2; return or2(gethash(slot_type_hash, slot), - if2(lisplib_try_load_slot(slot), + if2(autoload_try_slot(slot), gethash(slot_type_hash, slot))); } @@ -2003,7 +2003,7 @@ val static_slot_types(val slot) { uses_or2; return or2(gethash(static_slot_type_hash, slot), - if2(lisplib_try_load_slot(slot), + if2(autoload_try_slot(slot), gethash(static_slot_type_hash, slot))); } -- cgit v1.2.3