summaryrefslogtreecommitdiffstats
path: root/txr.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-06-17 22:21:42 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-06-17 22:21:42 -0700
commitb41b2cc220d9ba53024045fd3f84cd7be495d6a4 (patch)
tree75a7d2bcacb30513f05c15da0e62e71a9367e13f /txr.c
parent90166275e015baddb82e56203b73bf5e1b8014ab (diff)
downloadtxr-b41b2cc220d9ba53024045fd3f84cd7be495d6a4.tar.gz
txr-b41b2cc220d9ba53024045fd3f84cd7be495d6a4.tar.bz2
txr-b41b2cc220d9ba53024045fd3f84cd7be495d6a4.zip
Adding anaphoric ifa macro.
* Makefile (install): Install .tl files present in stdlib directory. (INSTALL): Handle argument 2 being a list. * eval.c (load): New function. * eval.h (load): Declared. * lisplib.c (ifa_set_entries, ifa_instantiate): New functions to lazily load ifa.tl. (lisplib_init): Register new functions. * txr.c (stdlib_path): New variable. (sysroot_init): Store the stdlib path in stdlib_path. * txr.h (stdlib_path): Declared. * share/txr/stdlib/ifa.tl: New file.
Diffstat (limited to 'txr.c')
-rw-r--r--txr.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/txr.c b/txr.c
index effb3c2b..9897bc58 100644
--- a/txr.c
+++ b/txr.c
@@ -60,6 +60,7 @@ static const char *progname_u8;
static val progpath = nil;
int opt_noninteractive;
int opt_compat;
+val stdlib_path;
/*
* Can implement an emergency allocator here from a fixed storage
@@ -250,12 +251,14 @@ static void sysroot_init(void)
val slash = regex_compile(lit("\\\\"), nil);
#endif
prot1(&progpath);
+ prot1(&stdlib_path);
progpath = get_self_path();
#if HAVE_WINDOWS_H
progpath = regsub(slash, lit("/"), progpath);
#endif
- reg_var(intern(lit("stdlib"), user_package),
- sysroot(lit("share/txr/stdlib")));
+ stdlib_path = sysroot(lit("share/txr/stdlib"));
+
+ reg_var(intern(lit("stdlib"), user_package), stdlib_path);
reg_var(intern(lit("*txr-version*"), user_package),
toint(lit(TXR_VER), nil));
}