diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-02-13 06:54:42 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-02-13 06:54:42 -0800 |
commit | 014c61e860fce07cceee60efecd949a17e53f2ae (patch) | |
tree | 5a3ffb653eb25298582cbb458e53d804197076ff /eval.c | |
parent | bb5d5d3efed8491ce2159abdf3da2114db91e5eb (diff) | |
download | txr-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.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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)); |