aboutsummaryrefslogtreecommitdiff
path: root/repl.c
diff options
context:
space:
mode:
authorOskari Timperi <oskari.timperi@iki.fi>2014-05-17 12:37:09 +0300
committerOskari Timperi <oskari.timperi@iki.fi>2014-05-17 12:37:09 +0300
commit2836fa60045bcdd8c1c8c5ed775d711cc7f385a9 (patch)
tree7892216d6ae7f0c51bd6c147dadc0bb88f06070c /repl.c
parent6814f6b99562620e70538787b6f8d66c80f7b990 (diff)
downloadlispish-2836fa60045bcdd8c1c8c5ed775d711cc7f385a9.tar.gz
lispish-2836fa60045bcdd8c1c8c5ed775d711cc7f385a9.zip
refactor code to use LIST from sys/queue.h
It's now easier and more natural to work with the code. :-P
Diffstat (limited to 'repl.c')
-rw-r--r--repl.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/repl.c b/repl.c
index 615609f..c9d6861 100644
--- a/repl.c
+++ b/repl.c
@@ -4,14 +4,14 @@
#include "parse.h"
#include "eval.h"
-#include "list.h"
#include "env.h"
+#include "atom.h"
#include "linenoise.h"
int main(int argc, char **argv)
{
char *line;
- struct list *env;
+ struct env *env;
env = env_new();
@@ -23,12 +23,13 @@ int main(int argc, char **argv)
if (strcmp(".clean", line) == 0)
{
+ env_free(env);
env = env_new();
}
else
{
- struct list *result = eval_str_env(line, env);
- print_list(result, 0);
+ struct atom *result = eval_str(line, env);
+ print_atom(result, 0);
}
free(line);