This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-09-15
Channels
- # ai (35)
- # announcements (3)
- # babashka (16)
- # babashka-sci-dev (2)
- # beginners (37)
- # biff (16)
- # calva (5)
- # cider (2)
- # clj-commons (81)
- # clj-kondo (29)
- # cljfx (2)
- # cljs-dev (4)
- # clojars (4)
- # clojure (92)
- # clojure-europe (72)
- # clojure-losangeles (8)
- # clojure-nl (1)
- # clojure-norway (10)
- # clojure-uk (1)
- # clojurescript (20)
- # clojutre (2)
- # conjure (2)
- # data-science (18)
- # datomic (1)
- # emacs (10)
- # fulcro (49)
- # joyride (1)
- # kaocha (23)
- # leiningen (8)
- # lsp (14)
- # meander (5)
- # off-topic (93)
- # polylith (4)
- # re-frame (20)
- # reagent (9)
- # reitit (2)
- # remote-jobs (8)
- # sci (1)
- # shadow-cljs (21)
- # testing (3)
- # vim (27)
- # xtdb (35)
Any thoughts on refactorings for cycling through different ways to perform iteration? Something like:
• doseq
<-> run!
• `mapv` <->
• on the riskier side, collection transformations e.g. into
->>
<-> transduce
• etc.
@U04V15CAJ Ah, I didn't know that! Do you think there are any valid cases for a code action like this?
The ->>
-> transduce
one seems like a nice efficiency upgrade. The stack is essentially the same in both, but the transducer doesn't retain everything in memory.
My understanding is that it still creates intermediate sequences between each step and puts a strain on the GC when using a large collection, while the transduce version does not. In any case, the example list is short and not complete. There are probably a few other such transforms that could be considered.
I see. So still an efficiency gain but not for all the reasons I thought. Thanks for the correction.
FWIW Alex Miller https://groups.google.com/g/clojure/c/9I6MtgOTD0w/m/Cif1Z8OB8HwJ tool developers to support a ->>
<-> eduction
refactoring 7 years ago. eduction
is still pretty obscure, from what I’ve seen, but perhaps it should be another candidate
Thanks, @U07M2C8TT. Okay, it sounds like there is at least a little interest in this idea. I'll create an issue for it just to put it on the radar.