From 87ef0e20b4e9d8f82d061ddc6993d04a2f6eda9d Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 5 Feb 2014 17:42:59 -0800 Subject: * lib.c (generic_funcall): If a cons cell is passed as one argument to a sequence being used as a function, split it into two arguments. This is consistent with the DWIM operator behavior. * txr.1: Document callable objects. --- lib.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib.c') diff --git a/lib.c b/lib.c index 771bb46d..03961597 100644 --- a/lib.c +++ b/lib.c @@ -3248,6 +3248,8 @@ val generic_funcall(val fun, val arg[], int nargs) case 0: uw_throw(error_s, lit("call: missing required arguments")); case 1: + if (consp(arg[0])) + return sub(fun, car(arg[0]), cdr(arg[0])); return ref(fun, arg[0]); case 2: return sub(fun, arg[0], arg[1]); -- cgit v1.2.3