I don't understand compact
. 😛
Can anyone explain this?
> (s/setval (s/regex-nav #"(?<=( |^))[a-z]") "_" "hello world")
"_ello _orld"
> (s/select (s/regex-nav #"(?<=( |^))[a-z]") "hello world")
[["h" ""] ["e" ""] ["l" ""] ["l" ""] ["o" ""] ["w" " "] ["o" ""] ["r" ""] ["l" ""] ["d" ""]]
Oh, it's because re-seq
looks at "hello world", then "ello world", etc.
what can you do with the result of traverse
that you can’t do with the result of select
?