Fix comment on manual clojure example, it does actually work
> (def data [1 2 3 4 5 6 7 8]) > (map inc data) (2 3 4 5 6 7 8 9) > (into (empty data) (map inc data)) [2 3 4 5 6 7 8 9] > (sp/transform sp/ALL inc data) [2 3 4 5 6 7 8 9]
This commit is contained in:
parent
67e8680602
commit
5227a6306e
1 changed files with 2 additions and 1 deletions
|
|
@ -64,7 +64,8 @@ Consider these examples:
|
||||||
```clojure
|
```clojure
|
||||||
;; Manual Clojure
|
;; Manual Clojure
|
||||||
(map inc data) ;; doesn't work, becomes a lazy sequence
|
(map inc data) ;; doesn't work, becomes a lazy sequence
|
||||||
(into (empty data) (map inc data)) ;; doesn't work, reverses the order of lists
|
|
||||||
|
(into (empty data) (map inc data)) ;; works correctly
|
||||||
|
|
||||||
;; Specter
|
;; Specter
|
||||||
(transform ALL inc data) ;; works for all Clojure datatypes with near-optimal efficiency
|
(transform ALL inc data) ;; works for all Clojure datatypes with near-optimal efficiency
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue