stch.zipper documentation

Zipper for sequential data. Maintains a
history of the traversed positions.

->Zipper

(->Zipper left right index traversed)
Positional factory function for class stch.zipper.Zipper.

->zip

(->zip coll)
Inputs: [coll :- [Any]]
Returns: Zipper

Returns a zipper from the given collection.

elem

(elem z)
Inputs: [z :- Zipper]
Returns: Any

Get the current element in the zipper.

empty?

(empty? z)
Inputs: [z :- Zipper]
Returns: Boolean

Is the zipper empty?

end

(end z)
Inputs: [z :- Zipper]
Returns: Zipper

Move the zipper to the end.

end?

(end? z)
Inputs: [z :- Zipper]
Returns: Boolean

Are we at the end of the zipper?

first?

(first? z)
Inputs: [z :- Zipper]
Returns: Boolean

Are we at the first position?

insert-right

(insert-right z el)
Inputs: [z :- Zipper, el :- Any]
Returns: Zipper

Insert el to the right of the current
element in the zipper.

left

Alias for prev.

leftmost

Alias for start.

lefts

(lefts z)
Inputs: [z :- Zipper]
Returns: DoubleList

Get the left side of the zipper.

map->Zipper

(map->Zipper m3068)
Factory function for class Zipper, taking a map of keywords to field values, but not 400x slower than ->x like the clojure.core version

next

(next z)
Inputs: [z :- Zipper]
Returns: Zipper

Move the zipper to the right.

next-traversed?

(next-traversed? z)
Inputs: [z :- Zipper]
Returns: Boolean

Has the next position been traversed?

not-empty?

Is the zipper not empty?

not-end?

Are we not at the end of the zipper?

not-start?

Are we not at the start of the zipper?

prev

(prev z)
Inputs: [z :- Zipper]
Returns: Zipper

Move the zipper to the left.

preview

(preview z)
Inputs: [z :- Zipper]
Returns: Any

Preview the next element in the zipper.

remove

(remove z)
Inputs: [z :- Zipper]
Returns: Zipper

Remove the current element from the zipper.

replace

(replace z el)
Inputs: [z :- Zipper, el :- Any]
Returns: Zipper

Replace the current element in the zipper
with el.

right

Alias for next.

rightmost

Alias for end.

rights

(rights z)
Inputs: [z :- Zipper]
Returns: DoubleList

Get the right side of the zipper.

start

(start z)
Inputs: [z :- Zipper]
Returns: Zipper

Move the zipper to the start.

start?

(start? z)
Inputs: [z :- Zipper]
Returns: Boolean

Are we at the start of the zipper?

strict-map->Zipper

(strict-map->Zipper m3069 & [drop-extra-keys?__1737__auto__])
Factory function for class Zipper, taking a map of keywords to field values.  All keys are required, and no extra keys are allowed.  Even faster than map->

traversed?

(traversed? z position)
Inputs: [z :- Zipper, position :- Int]
Returns: Boolean

Has the given position been traversed?

truncate

(truncate z)
Inputs: [z :- Zipper]
Returns: Zipper

Truncate the right side of the zipper.

update

(update z f)
Inputs: [z :- Zipper, f :- (Fn Any [Any])]
Returns: Zipper

Update the current element in the zipper,
calling f on it.

zip

(zip & args)
Inputs: [& args :- [Any]]
Returns: Zipper

Returns a zipper from the given arguments.