Warning: This is the manual of the legacy Guile 2.2 series. You may want to read the manual of the current stable series instead.
Next: General Conversion, Previous: Sorting, Up: Utility Functions [Contents][Index]
The procedures for copying lists (see Lists) only produce a flat
copy of the input list, and currently Guile does not even contain
procedures for copying vectors. copy-tree
can be used for these
application, as it does not only copy the spine of a list, but also
copies any pairs in the cars of the input lists.
Recursively copy the data tree that is bound to obj, and return
the new data structure. copy-tree
recurses down the
contents of both pairs and vectors (since both cons cells and vector
cells may point to arbitrary objects), and stops recursing when it hits
any other object.