summaryrefslogtreecommitdiffstats
path: root/lib.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-02-05 17:10:11 -0800
committerKaz Kylheku <kaz@kylheku.com>2014-02-05 17:10:11 -0800
commit04a75123fc2f6135850a811bf7477ed97fdcdc83 (patch)
treee98d53b542ff02cb9d1f3673606d41acdf304858 /lib.h
parent227f0d19dc5313edbebbb56ba6b4966012a2370e (diff)
downloadtxr-04a75123fc2f6135850a811bf7477ed97fdcdc83.tar.gz
txr-04a75123fc2f6135850a811bf7477ed97fdcdc83.tar.bz2
txr-04a75123fc2f6135850a811bf7477ed97fdcdc83.zip
Allow sequences and hashes to be called as functions.
This is already supported in the DWIM operator. * eval.c (apply): If object isn't a function, gather the arguments into an array and delegate to generic_funcall. * lib.c (generic_funcall): Changed from static to external linkage. Supports sequences and hashes as functions. Error messages fixed not to refer to "funcall". (funcall, funcall1, funcall2, funcall3, funcall4): Do not throw exception if fun is not of FUN type; instead, delegate to generic_funcall. Error messages fixed not to refer to "funcall". * lib.h (generic_function): Declared.
Diffstat (limited to 'lib.h')
-rw-r--r--lib.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib.h b/lib.h
index 1fc95a00..00fb35e5 100644
--- a/lib.h
+++ b/lib.h
@@ -603,6 +603,7 @@ val func_get_env(val fun);
val func_set_env(val fun, val env);
val functionp(val);
val interp_fun_p(val);
+val generic_funcall(val fun, val arg[], int nargs);
val funcall(val fun);
val funcall1(val fun, val arg);
val funcall2(val fun, val arg1, val arg2);