tisp

tiny lisp
git clone git://edryd.org/tisp
Log | Files | Refs | LICENSE

commit 29258977092664a4112790dda16cc6f655687917
parent 68b89e8eab2f57625ea8ee8b492adb3c314c3b37
Author: Ed van Bruggen <edvb@uw.edu>
Date:   Wed, 22 May 2019 16:23:27 -0700

Make quit look like a procedure

Diffstat:
tibs/io.c | 2+-
tibs/repl.tsp | 2+-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tibs/io.c b/tibs/io.c @@ -47,7 +47,7 @@ prim_read(Env env, Val args) struct Str str = { NULL }; if (!(file = tisp_read_file(NULL))) { putchar('\n'); - return mk_sym(env, "quit"); + return mk_pair(mk_sym(env, "quit"), env->nil); } str.d = file; v = tisp_read(env, &str); diff --git a/tibs/repl.tsp b/tibs/repl.tsp @@ -1,7 +1,7 @@ (define (repl) (print "> ") (let ((expr (read))) - (unless (= expr 'quit) + (unless (and (pair? expr) (= (car expr) 'quit)) (let ((ans (eval expr))) (unless (void? ans) (disp-string ans)))