diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-10-16 07:36:27 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-10-16 07:36:27 -0700 |
commit | bdc7277d09377f87319e0c27de40210b0212fabc (patch) | |
tree | 82f310bcb94d82c8db838d7dec41e380251bfa2f /lib.c | |
parent | afbca6b306ddd07e84c44f4d47bd04ddd3cada86 (diff) | |
download | txr-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.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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 */ |