summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-10-16 07:36:27 -0700
committerKaz Kylheku <kaz@kylheku.com>2019-10-16 07:36:27 -0700
commitbdc7277d09377f87319e0c27de40210b0212fabc (patch)
tree82f310bcb94d82c8db838d7dec41e380251bfa2f /lib.c
parentafbca6b306ddd07e84c44f4d47bd04ddd3cada86 (diff)
downloadtxr-bdc7277d09377f87319e0c27de40210b0212fabc.tar.gz
txr-bdc7277d09377f87319e0c27de40210b0212fabc.tar.bz2
txr-bdc7277d09377f87319e0c27de40210b0212fabc.zip
tree: copy-search-tree function.
* lib.c (copy): Handle tree objects via copy_search_tree. * tree.c (deep_copy_tnode): New static function. (copy_search_tree): New function. (tree_init): copy-search-tree intrinsic registered. * tree.h (copy_search_tree): Declared. * txr.1: Documented copy-search-tree, and copy function's use thereof.
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 81f3d06d..b6f22971 100644
--- a/lib.c
+++ b/lib.c
@@ -10081,6 +10081,8 @@ val copy(val seq)
return make_random_state(seq, nil);
if (seq->co.cls == carray_s)
return copy_carray(seq);
+ if (seq->co.cls == tree_s)
+ return copy_search_tree(seq);
if (obj_struct_p(seq))
return copy_struct(seq);
/* fallthrough */