std.lib.zip

*handler*

dynamic

+base+

+nil-handler+

+types+

at-end?

added in 3.0

(at-end? {:keys [context], :as zip})

replace element right of the current status

at-inside-most-left?

added in 3.0

(at-inside-most-left? zip)

check if at inside-most left point of a container

at-inside-most?

added in 3.0

(at-inside-most? zip)

check if at inside-most point of a container

at-left-most?

added in 3.0

(at-left-most? zip)

check if at left-most point of a container

at-outside-most?

added in 3.0

(at-outside-most? zip)

check if at outside-most point of the tree

at-right-most?

added in 3.0

(at-right-most? zip)

check if at right-most point of a container

can-step-inside-left?

added in 3.0

(can-step-inside-left? {:keys [context], :as zip})

check if can step left inside a container

can-step-inside?

added in 3.0

(can-step-inside? {:keys [context], :as zip})

check if can step down from current status

can-step-left?

added in 3.0

(can-step-left? {:keys [context], :as zip})

check if can step left from current status

(-> (from-status ’[1 2 3 | 4]) (can-step-left?)) => true

(-> (from-status ’[1 2 | 3 4]) (can-step-left?)) => false

can-step-outside?

added in 3.0

(can-step-outside? {:keys [context], :as zip})

check if can step up from current status

can-step-right?

added in 3.0

(can-step-right? {:keys [context], :as zip})

check if can step right from current status

(-> (from-status ’[1 2 3 | 4]) (can-step-right?)) => true

(-> (from-status ’[1 2 3 4 |]) (can-step-right?)) => false

check-context

added in 3.0

(check-context context)

checks that the zipper contains valid functions

check-optional

added in 3.0

(check-optional context)

checks that the meta contains valid functions

current-elements

added in 3.0

(current-elements {:keys [left right], :as zip})

all elements left and right of current position

delete-left

added in 3.0

(delete-left {:keys [context left], :as zip})(delete-left {:keys [context], :as zip} n)

delete element/s left of the current status

delete-right

added in 3.0

(delete-right {:keys [context right], :as zip})(delete-right {:keys [context], :as zip} n)

delete element/s right of the current status

display-zipper

added in 4.0

(display-zipper {:keys [parent context], :as zip})

displays the zipper

find

added in 3.0

(find zip move pred)

helper function for the rest of the find series

find-left

added in 3.0

(find-left zip pred)

steps status left to search predicate

find-next

added in 3.0

(find-next zip pred)

step status through the tree in depth first order to the first matching element

find-prev

added in 3.0

(find-prev zip pred)

step status through the tree in reverse order to the last matching element

find-right

added in 3.0

(find-right zip pred)

steps status right to search for predicate

form-zip

added in 4.0

(form-zip root)(form-zip root opts)

creates a form zip

form-zip-unwrap

added in 4.0

(form-zip-unwrap form)

unwraps nils for the zipper

form-zip-wrap

added in 4.0

(form-zip-wrap form)

wraps nils for the zipper

from-status

added in 3.0

(from-status data)(from-status data zipper-fn)

returns a zipper given a data structure with | as the status

get

added in 3.0

(get zip)(get zip arg)(get zip func step)

gets the value of the zipper

hierarchy

added in 3.0

(hierarchy {:keys [context], :as zip})

replace element right of the current status

insert-left

added in 3.0

(insert-left {:keys [context], :as zip} data)(insert-left {:keys [context], :as zip} data & more)

insert element/s left of the current status

insert-right

added in 3.0

(insert-right {:keys [context], :as zip} data)(insert-right {:keys [context], :as zip} data & more)

insert element/s right of the current status

is

added in 3.0

(is zip pred)(is zip pred step)

checks zip given a predicate

is-container?

added in 3.0

(is-container? zip)(is-container? {:keys [context], :as zip} step)

checks if node on either side is a container

(-> (vector-zip 1 2 3) (is-container? :right)) => true

(-> (vector-zip 1 2 3) (is-container? :left)) => false

is-empty-container?

added in 3.0

(is-empty-container? zip)(is-empty-container? {:keys [context], :as zip} step)

check if current container is empty

(-> (vector-zip []) (is-empty-container?)) => true

left-element

added in 3.0

(left-element zip)

element directly left of current position

left-elements

added in 3.0

(left-elements zip)

all elements left of current position

levelwalk

added in 3.0

(levelwalk zip [pred] f)(levelwalk zip [pred] f levelwalk {:keys [move-right can-move-right?], :as opts})

performs a match at the same level

list-child-elements

added in 3.0

(list-child-elements zip)(list-child-elements {:keys [context], :as zip} direction)

lists elements of a container

matchwalk

added in 3.0

(matchwalk zip matchers f)(matchwalk zip [pred & more :as matchers] f matchwalk {:keys [move-right can-move-right?], :as opts})

performs a match at each level

postwalk

added in 3.0

(postwalk zip f)

emulates std.lib.walk/postwalk behavior with zipper

prewalk

added in 3.0

(prewalk {:keys [context], :as zip} f)

emulates std.lib.walk/prewalk behavior with zipper

register-type

added in 4.0

(register-type type context)

registers a zip type

replace-left

added in 3.0

(replace-left zip data)

replace element left of the current status

replace-right

added in 3.0

(replace-right zip data)

replace element right of the current status

right-element

added in 3.0

(right-element zip)

element directly right of current position

right-elements

added in 3.0

(right-elements zip)

all elements right of current position

root-element

added in 3.0

(root-element zip)

accesses the top level node

seq-zip

added in 3.0

(seq-zip root)(seq-zip root opts)

constructs a sequence zipper

status

added in 3.0

(status {:keys [context], :as zip} & [no-cursor])

returns the form with the status showing

status-string

added in 3.0

(status-string zip)

returns the string form of the status

step-end

added in 3.0

(step-end {:keys [context], :as zip})

steps status to container directly at end

step-inside

added in 3.0

(step-inside {:keys [context], :as zip})(step-inside zip n)

step down from current status

step-inside-left

added in 3.0

(step-inside-left {:keys [context], :as zip})(step-inside-left zip n)

steps into the form on the left side

step-inside-most

added in 3.0

(step-inside-most {:keys [context], :as zip})

step to at-inside-most point of current container

step-inside-most-left

added in 3.0

(step-inside-most-left {:keys [context], :as zip})

steps all the way inside to the left side

step-left

added in 3.0

(step-left {:keys [left context right], :as zip})(step-left zip n)

step left from current status

step-left-most

added in 3.0

(step-left-most {:keys [context], :as zip})

step to left-most point of current container

step-next

added in 3.0

(step-next {:keys [context], :as zip})

step status through the tree in depth first order

step-outside

added in 3.0

(step-outside zip)(step-outside zip n)

step out to the current container

step-outside-most

added in 3.0

(step-outside-most {:keys [context], :as zip})

step to outside-most point of the tree

step-outside-most-right

added in 3.0

(step-outside-most-right {:keys [context], :as zip})

step to outside-most point of the tree to the right

step-outside-right

added in 3.0

(step-outside-right zip)(step-outside-right zip n)

the right of the current container

step-prev

added in 3.0

(step-prev {:keys [context], :as zip})

step status in reverse through the tree in depth first order

step-right

added in 3.0

(step-right {:keys [left right context], :as zip})(step-right zip n)

step right from current status

step-right-most

added in 3.0

(step-right-most {:keys [context], :as zip})

step to right-most point of current container

surround

added in 3.0

(surround {:keys [context parent left], :as zip})

nests elements in current block within another container

unregister-type

added in 4.0

(unregister-type type context)

unregisters a zip type

unwrap-element

added in 4.0

(unwrap-element {:keys [context], :as zip} element)

unwraps an element

update-child-elements

added in 3.0

(update-child-elements zip child-elements)(update-child-elements {:keys [context], :as zip} child-elements direction)

updates elements of a container

vector-zip

added in 3.0

(vector-zip root)(vector-zip root opts)

constructs a vector based zipper

zipper

added in 3.0

(zipper root context)(zipper root context opts)

constructs a zipper

zipper?

added in 3.0

(zipper? x)

checks to see if an object is a zipper