Next: , Previous: , Up: srfi ilists procs   [Index]


2.40.6.12 Conversion

These procedures convert between mutable and immutable pair structures.

Function: ipair pair->ipair pair
Function: pair ipair->pair ipair

These procedures, which are inverses, return an ipair and a pair respectively that have the same (i)car and (i)cdr fields as the argument.

Function: dilist list->ilist flist
Function: flist ilist->list dilist

These procedures return an ilist and a list respectively that have the same elements as the argument. The tails of dotted (i)lists are preserved in the result, which makes the procedures not inverses when the tail of a dotted ilist is a list or vice versa. The empty list is converted to itself.

It is an error to apply list->ilist to a circular list.

Function: ilist vector->ilist vector
Function: vector ilist->list ilist

These procedures return an ilist and a vector respectively that have the same elements as the argument. The empty list is converted to an empty vector. It is an error to apply ilist->vector to a dotted list.

NOTE These functions are Vicare extensions.

Function: object tree->itree object
Function: object itree->tree object

These procedures walk a tree of pairs or ipairs respectively and make a deep copy of it, returning an isomorphic tree containing ipairs or pairs respectively. The result may share structure with the argument. If the argument is not of the expected type, it is returned.

These procedures are not inverses in the general case. For example, a pair of ipairs would be converted by tree->itree to an ipair of ipairs, which if converted by itree->tree would produce a pair of pairs.

Function: object gtree->itree object
Function: object gtree->tree object

These procedures walk a generalized tree consisting of pairs, ipairs, or a combination of both, and make a deep copy of it, returning an isomorphic tree containing only ipairs or pairs respectively. The result may share structure with the argument. If the argument is neither a pair nor an ipair, it is returned.


Next: , Previous: , Up: srfi ilists procs   [Index]