redplanetlabs / specter

Clojure(Script)'s missing piece
Apache License 2.0
2.52k stars 105 forks source link

Transforming a string with the `ALL` navigator yields a reversed sequence #320

Open meditans opened 2 years ago

meditans commented 2 years ago

In the current version of specter, if I transform ALL of a string I get the reversed order of characters:

(specter/transform specter/ALL identity "123")
;; => (\3 \2 \1)

I find this confusing since we have:

(specter/select specter/ALL "123")
;; => [\1 \2 \3]

and:

(specter/transform specter/ALL identity (vec "123"))
;; => [\1 \2 \3]

Is there a reason for this behavior or could we change it to the more intuitive one?

tommy-mor commented 3 weeks ago

ran into this today

nathanmarz commented 3 weeks ago

Would just need to extend all-transform protocol to strings.