summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-02-05 17:42:59 -0800
committerKaz Kylheku <kaz@kylheku.com>2014-02-05 17:42:59 -0800
commit87ef0e20b4e9d8f82d061ddc6993d04a2f6eda9d (patch)
tree2886dd9d1afa7d16de09c882ddd654b73617a250 /lib.c
parent04a75123fc2f6135850a811bf7477ed97fdcdc83 (diff)
downloadtxr-87ef0e20b4e9d8f82d061ddc6993d04a2f6eda9d.tar.gz
txr-87ef0e20b4e9d8f82d061ddc6993d04a2f6eda9d.tar.bz2
txr-87ef0e20b4e9d8f82d061ddc6993d04a2f6eda9d.zip
* 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.
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c2
1 files changed, 2 insertions, 0 deletions
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]);