slurp-forward
function
rewrite-clj.paredit/slurp-forward
(slurp-forward [zloc])DEPRECATED: we recommend [[slurp-forward-into]] instead for more control.
Return `zloc` with node to the right of nearest eligible sequence slurped into that sequence else `zloc` unchanged.
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 2 3 ]]] 4]
- `[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!