commit dd13b84d825fb06fb2316401378207551266b502
parent 0b2df2b16f9befd08c1f90d48797038d6ee93bf0
Author: Ed van Bruggen <edvb@uw.edu>
Date: Sat, 31 Mar 2018 14:03:44 -0700
Move constant definition to init_env
Diffstat:
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/main.c b/main.c
@@ -76,10 +76,6 @@ main(int argc, char *argv[])
Hash env = tisp_init_env(64);
tib_math_env(env);
- nil.t = NIL;
- t.t = SYMBOL;
- t.v.s = estrdup("t");
-
if (argc > 0) {
if (!(fp = fopen(*argv, "r")))
die(1, "%s: %s:", argv[0], *argv);
diff --git a/tisp.c b/tisp.c
@@ -512,6 +512,10 @@ prim_define(Hash env, Val args)
Hash
tisp_init_env(size_t cap)
{
+ nil.t = NIL;
+ t.t = SYMBOL;
+ t.v.s = estrdup("t");
+
Hash h = hash_new(cap);
hash_add(h, "t", &t);
hash_add(h, "car", mk_prim(prim_car));