slurp-backward
function
rewrite-clj.paredit/slurp-backward
(slurp-backward [zloc])DEPRECATED: we recommend [[slurp-backward-into]] for more control.
Returns `zloc` with node to the left of nearest eligible sequence slurped into that sequence else `zloc` unchanged.
Pull in the node to right of the current node's parent sequence.
If there is no node to the right of parent sequence, searches upward until it finds one, if any.
- `[1 2 [3 |4 5] 6] => [1 [2 3 |4 5] 6]`
- `1 [[[|2 3 4]]] => [1 [[|1 2 3 ]]]`
- `[1 2 |[3] 4] 5 => [1 2 |[3] 4 5]`
If located at an empty seq will ultimately slurp into that empty seq and locate to the slurped node:
- `1 [|[] 2 3] => [1 |[] 2 3]`
- `[1 |[] 2 3] => [|[1] 2 3]`
Examples
No examples yet. Be the first to add one!