VARS

append-child

branch?

children

down

edit

end?

insert-child

insert-left

insert-right

left

leftmost

lefts

make-node

next

node

path

prev

remove

replace

right

rightmost

rights

root

seq-zip

up

vector-zip

xml-zip

zipper

append-child

branch?

children

down

edit

end?

insert-child

insert-left

insert-right

left

leftmost

lefts

make-node

next

node

path

prev

remove

replace

right

rightmost

rights

root

seq-zip

up

vector-zip

xml-zip

zipper

« Index of all namespaces of this project

Functional hierarchical zipper, with navigation, editing, and enumeration. See Huet

`(append-child loc item)`

Inserts the item as the rightmost child of the node at this loc, without moving

`(insert-child loc item)`

Inserts the item as the leftmost child of the node at this loc, without moving

`(insert-right loc item)`

Inserts the item as the right sibling of the node at this loc, without moving

`(make-node loc node children)`

Returns a new branch node, given an existing node and new children. The loc is only used to supply the constructor.

`(next loc)`

Moves to the next loc in the hierarchy, depth-first. When reaching the end, returns a distinguished loc detectable via end?. If already at the end, stays there.

`(prev loc)`

Moves to the previous loc in the hierarchy, depth-first. If already at the root, returns nil.

`(remove loc)`

Removes the node at loc, returning the loc that would have preceded it in a depth-first walk.

`(zipper branch? children make-node root)`

Creates a new zipper structure. branch? is a fn that, given a node, returns true if can have children, even if it currently doesn't. children is a fn that, given a branch node, returns a seq of its children. make-node is a fn that, given an existing node and a seq of children, returns a new branch node with the supplied children. root is the root node.