diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-01-25 08:39:15 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-01-25 08:39:15 -0800 |
commit | 4ec024cdc9544c244cbd8b630e8f631fc05c6075 (patch) | |
tree | 734ab15e190ec426499c25cc00a79045b92d2fc2 /lib.c | |
parent | 6c9893d4790f1a27c900b2d84a3532ae7c402463 (diff) | |
download | txr-4ec024cdc9544c244cbd8b630e8f631fc05c6075.tar.gz txr-4ec024cdc9544c244cbd8b630e8f631fc05c6075.tar.bz2 txr-4ec024cdc9544c244cbd8b630e8f631fc05c6075.zip |
* eval.c (eval_init): Register dupl and swap_12_21 as
the dup and flip intrinsics.
* lib.c (do_dup): New static function.
(dupl): New function.
* lib.h (dupl): Declared.
* txr.1: Documented dup and flip.
Diffstat (limited to 'lib.c')
-rw-r--r-- | lib.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -4756,6 +4756,16 @@ val iffi(val condfun, val thenfun, val elsefun) return func_f0v(cons(condfun, cons(thenfun, elsefun)), do_iff); } +static val do_dup(val fun, val arg) +{ + return funcall2(fun, arg, arg); +} + +val dupl(val fun) +{ + return func_f1(fun, do_dup); +} + val vector(val length, val initval) { int i; |