summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--match.c13
-rw-r--r--tests/008/call-2.expected0
-rw-r--r--tests/008/call-2.txr6
3 files changed, 9 insertions, 10 deletions
diff --git a/match.c b/match.c
index ef2daf9d..2b1a6f7c 100644
--- a/match.c
+++ b/match.c
@@ -4506,18 +4506,11 @@ static val v_call(match_files_ctx *c)
val funval = tleval_144(specline, funexpr, c->bindings);
val argexprs = cdr(exprs);
val call = cons(funval, argexprs);
- val spec = cons(cons(call, nil), nil);
- match_files_ctx ctx = mf_spec_bindings(*c, spec, c->bindings);
- val ret = v_fun(&ctx);
-
- if (ret == nil)
- return nil;
+ val spec = cons(cons(call, nil), cdr(c->spec));
- if (ret == decline_k)
- sem_error(nil, lit("call: function ~s not found"), funval, nao);
+ c->spec = spec;
- c->bindings = ctx.bindings;
- return ret;
+ return v_fun(c);
}
static val h_do(match_line_ctx *c)
diff --git a/tests/008/call-2.expected b/tests/008/call-2.expected
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/tests/008/call-2.expected
diff --git a/tests/008/call-2.txr b/tests/008/call-2.txr
new file mode 100644
index 00000000..10257f62
--- /dev/null
+++ b/tests/008/call-2.txr
@@ -0,0 +1,6 @@
+@(define foo (var))
+@var
+@(end)
+@(next :list '("A" "B"))
+@(call (quote foo) "A")
+@(call (quote foo) "B")