summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-01-15 19:59:28 -0800
committerKaz Kylheku <kaz@kylheku.com>2017-01-15 19:59:28 -0800
commit7bcd35fa7204a8bf1a043a2587f2e0f252764364 (patch)
treef916ad11f8e2f221dcec43cc65c40ac7098da517 /eval.c
parent0ad39c1d30de392efaf24a70da00734ea49679e8 (diff)
downloadtxr-7bcd35fa7204a8bf1a043a2587f2e0f252764364.tar.gz
txr-7bcd35fa7204a8bf1a043a2587f2e0f252764364.tar.bz2
txr-7bcd35fa7204a8bf1a043a2587f2e0f252764364.zip
Dump deferred warnings in eval_intrinsic.
* eval.c (eval_intrinsic): Dump deferred warnings after expansion, unless in the middle of a load. * parser.c (read_eval_ret_last): Bind *load-recursive* around all evaluations to t, then dump warnings if prior value of *load-recursive* is nil. Thus the repl's :read feature behaves like load. (repl_warning): We can now unconditionally defer deferrable warnings here now, whether or not in a load.
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/eval.c b/eval.c
index 0a9ad60e..0aea1d2f 100644
--- a/eval.c
+++ b/eval.c
@@ -1263,7 +1263,9 @@ val eval_intrinsic(val form, val env)
val lfx_save = last_form_expanded;
val form_ex = (last_form_expanded = last_form_evaled = nil,
expand(form, nil));
- val ret = eval(form_ex, default_bool_arg(env), form);
+ val loading = cdr(lookup_var(dyn_env, load_recursive_s));
+ val ret = ((void) (loading || uw_dump_deferred_warnings(std_error)),
+ eval(form_ex, default_bool_arg(env), form));
last_form_expanded = lfx_save;
last_form_evaled = lfe_save;
return ret;