From 3315a83172c4178176d1cf7634dfc69a8fd29edc Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 19 Jan 2012 22:12:17 -0800 Subject: * debug.c (last_command): Initialize to empty string rather than nil, otherwise hitting enter tries to repeat the nil command. (show_bindings): New function. Prints all levels of bindings. (debug): Flip the corresponding print flags after printing the current form or data, so they are not printed for every prompt. On EOF from standard input, substitute the q command. If enter is hit and there is no last command, just re-print the prompt. The v command uses show_bindings to dump the environment. * eval.c (eval): When calling debug_check, pass the env objects, rather than the bindings it contains. --- eval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index dcca5a6d..0dbe952c 100644 --- a/eval.c +++ b/eval.c @@ -327,7 +327,7 @@ static val eval_intrinsic(val form, val env) val eval(val form, val env, val ctx_form) { type_check(env, ENV); - debug_check(consp(form) ? form : ctx_form, env->e.vbindings, nil, nil, nil); + debug_check(consp(form) ? form : ctx_form, env, nil, nil, nil); if (nullp(form)) { return nil; -- cgit v1.2.3