This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-11-08
Channels
- # announcements (8)
- # babashka (11)
- # beginners (63)
- # calva (1)
- # chlorine-clover (1)
- # cider (18)
- # cljfx (4)
- # cljs-dev (18)
- # clojure (17)
- # clojure-europe (20)
- # clojure-spec (2)
- # conjure (2)
- # data-science (6)
- # datomic (7)
- # depstar (17)
- # etaoin (2)
- # events (2)
- # fulcro (28)
- # graalvm (2)
- # graphql (3)
- # jobs-discuss (5)
- # off-topic (18)
- # pedestal (5)
- # reagent (6)
- # reveal (2)
- # shadow-cljs (39)
- # spacemacs (7)
- # xtdb (13)
Babashka survey: https://nl.surveymonkey.com/r/H2HK3RC
That's weird. But (reduce str "" "1")
does work.
Btw, (apply str ...)
might be better so there's only one StringBuilder
I think you’re seeing a couple of things. If I remember correctly, reduce will not invoke the reducing fn if there is only one element in the list
And, as discussed previously, a string is considered a sea of chars, as @U0525KG62 points lit
@U04V5VAUN You're correct.
(reduce - [1])
1
There is a mailing list entry (or something) somewhere where Rich regrets the two arity version of reduce for several reasons.
Thanks. I didn't run into trouble with this. I was just trying to understand reduce a bit better and one of my experiments gave me that funny result.
Hint: the other name for String is CharSequence ;) and reduce with this arity assumes that an element combined to no other reduces to itself.
anyone here had a play with flow-storm-debugger? https://github.com/jpmonettas/flow-storm-debugger