From d654390f21bc0e37addd60646f85999f0dc99a6c Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 5 Jun 2023 07:19:00 -0700 Subject: New functions load-args-recurse and load-args-process * autoload.c (load_args_set_entries, load_args_instantiate): New static functions. (autoload_init): Register new auto-loaded module "load-args". * stdlib/load-args.tl: New file. * txr.1: Documented. * stdlib/doc-syms.tl: Updated. --- autoload.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'autoload.c') diff --git a/autoload.c b/autoload.c index 1d8fa26e..7f35223f 100644 --- a/autoload.c +++ b/autoload.c @@ -939,6 +939,22 @@ static val expander_let_instantiate(void) return nil; } +static val load_args_set_entries(val fun) +{ + val name[] = { + lit("load-args-recurse"), lit("load-args-process"), + nil + }; + autoload_set(al_fun, name, fun); + return nil; +} + +static val load_args_instantiate(void) +{ + load(scat2(stdlib_path, lit("load-args"))); + return nil; +} + val autoload_reg(val (*instantiate)(void), val (*set_entries)(val)) { @@ -1007,6 +1023,7 @@ void autoload_init(void) autoload_reg(pic_instantiate, pic_set_entries); autoload_reg(constfun_instantiate, constfun_set_entries); autoload_reg(expander_let_instantiate, expander_let_set_entries); + autoload_reg(load_args_instantiate, load_args_set_entries); reg_fun(intern(lit("autoload-try-fun"), system_package), func_n1(autoload_try_fun)); } -- cgit v1.2.3