This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-09-06
Channels
- # announcements (3)
- # beginners (8)
- # calva (17)
- # cider (3)
- # clj-kondo (1)
- # cljs-dev (7)
- # clojure (11)
- # clojure-dev (9)
- # clojure-europe (1)
- # clojuredesign-podcast (4)
- # clojurescript (10)
- # conjure (13)
- # datomic (3)
- # emacs (3)
- # figwheel-main (1)
- # fulcro (12)
- # leiningen (8)
- # meander (20)
- # off-topic (85)
- # pathom (1)
- # shadow-cljs (39)
- # spacemacs (7)
- # tools-deps (44)
- # xtdb (5)
Err. @misha ((frequencies "\n\n") "\n") => 2 But I didn't expect the behavior of split lines. I would have expected a blank string for each new line
yeah, frequencies seems to be 10x faster than count re-seq, but regex is actually #"\n\r|\r\n|\n|\r" or something like this.
all those shenanigans are exactly because empty strings are omitted from "default" tools you'd reach for :(
* 10x faster on that little useless string that is. on an actual text (any source code file) - it is ∞ slower (imagine frequencies clojure.core.clj just to count lines :))
If the source is big enough use the reducer library/ns.
If it's bigger then that then you use onyx
On the backend/clojure of course.
https://www.reddit.com/r/mit6824clojure/comments/hhma5e/none_distributed_but_multithread_map_reduce_in/?utm_medium=android_app&utm_source=share Here's a post about word count i wrote