summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-02-16 16:26:31 -0800
committerKaz Kylheku <kaz@kylheku.com>2014-02-16 16:26:31 -0800
commitb76485e540762c60ba34dc36875c3b936f4df7b8 (patch)
tree04f04f42e09bd11eaa3911840dc702a757b2308b /eval.c
parent5cb820d7f9be3df23e19fd67a2f5ff6309188eea (diff)
downloadtxr-b76485e540762c60ba34dc36875c3b936f4df7b8.tar.gz
txr-b76485e540762c60ba34dc36875c3b936f4df7b8.tar.bz2
txr-b76485e540762c60ba34dc36875c3b936f4df7b8.zip
* eval.c (op_tree_case): Removed superfluous handling of
nil parameter list; this is correctly handled by bind_macro_params. Added support for the colon symbol as an indication that the case is declined. * txr.1: Updated.
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/eval.c b/eval.c
index e7ad031d..54e7024e 100644
--- a/eval.c
+++ b/eval.c
@@ -1107,15 +1107,12 @@ static val op_tree_case(val form, val env)
for (; consp(cases); cases = cdr(cases)) {
val onecase = car(cases);
cons_bind (params, forms, onecase);
-
- if (!params) {
- if (!expr_val)
- return eval_progn(forms, env, forms);
- } else {
- val new_env = bind_macro_params(env, nil, params, expr_val,
+ val new_env = bind_macro_params(env, nil, params, expr_val,
colon_k, onecase);
- if (new_env)
- return eval_progn(forms, new_env, forms);
+ if (new_env) {
+ val ret = eval_progn(forms, new_env, forms);
+ if (ret != colon_k)
+ return ret;
}
}