summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-02-13 06:54:42 -0800
committerKaz Kylheku <kaz@kylheku.com>2019-02-13 06:54:42 -0800
commit014c61e860fce07cceee60efecd949a17e53f2ae (patch)
tree5a3ffb653eb25298582cbb458e53d804197076ff /eval.c
parentbb5d5d3efed8491ce2159abdf3da2114db91e5eb (diff)
downloadtxr-014c61e860fce07cceee60efecd949a17e53f2ae.tar.gz
txr-014c61e860fce07cceee60efecd949a17e53f2ae.tar.bz2
txr-014c61e860fce07cceee60efecd949a17e53f2ae.zip
optimizing diff, isec and uni for non-lists.
Also, these functions now support hashes. * eval.c (eval_init): Register only the deprecated set-diff to the set_diff function. The diff intrinsic is now going to the new function named diff. * lib.c (diff): New function. (isec, uni): Rewritten to use seq_iter_t. * lib.h (diff): Declared. * txr.1: Documentation updated.
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/eval.c b/eval.c
index f9150b8c..d1013871 100644
--- a/eval.c
+++ b/eval.c
@@ -6014,7 +6014,6 @@ void eval_init(void)
val not_null_f = func_n1(not_null);
val me_each_f = func_n2(me_each);
val me_for_f = func_n2(me_for);
- val diff_f = func_n4o(set_diff, 2);
val length_f = func_n1(length);
protect(&top_vb, &top_fb, &top_mb, &top_smb, &special, &builtin, &dyn_env,
@@ -6747,8 +6746,8 @@ void eval_init(void)
reg_fun(intern(lit("find-max"), user_package), func_n3o(find_max, 1));
reg_fun(intern(lit("find-min"), user_package), func_n3o(find_min, 1));
reg_fun(intern(lit("multi-sort"), user_package), func_n3o(multi_sort, 2));
- reg_fun(intern(lit("set-diff"), user_package), diff_f);
- reg_fun(intern(lit("diff"), user_package), diff_f);
+ reg_fun(intern(lit("set-diff"), user_package), func_n4o(set_diff, 2));
+ reg_fun(intern(lit("diff"), user_package), func_n4o(diff, 2));
reg_fun(intern(lit("isec"), user_package), func_n4o(isec, 2));
reg_fun(intern(lit("uni"), user_package), func_n4o(uni, 2));