This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-04-05
Channels
- # announcements (15)
- # aws (7)
- # babashka (105)
- # beginners (35)
- # biff (5)
- # calva (48)
- # cider (5)
- # clj-kondo (25)
- # cljdoc (14)
- # clojure (84)
- # clojure-czech (2)
- # clojure-dev (6)
- # clojure-europe (58)
- # clojure-nl (6)
- # clojure-norway (19)
- # clojure-portugal (2)
- # clojure-uk (5)
- # clojurescript (23)
- # cloverage (5)
- # code-reviews (5)
- # conjure (28)
- # data-science (1)
- # datomic (53)
- # events (6)
- # exercism (7)
- # fulcro (16)
- # graalvm-mobile (2)
- # honeysql (29)
- # improve-getting-started (2)
- # kaocha (32)
- # lambdaisland (2)
- # lsp (29)
- # malli (3)
- # overtone (1)
- # pedestal (8)
- # polylith (3)
- # portal (6)
- # quil (2)
- # rdf (15)
- # releases (2)
- # rewrite-clj (14)
- # sci (9)
- # shadow-cljs (7)
- # specter (5)
- # sql (5)
- # xtdb (38)
Is this a bug?
(#'clojure.core.protocols/iter-reduce [1 2 3] conj)
Execution error (ClassCastException) at user/eval10101 (REPL:1).
class java.lang.Long cannot be cast to class clojure.lang.IPersistentCollection (java.lang.Long is in module java.base of loader 'bootstrap'; clojure.lang.IPersistentCollection is in unnamed module of loader 'app')
iter-reduce
binds the first value of ret
to be the first element from the iterator and not (f)
not a bug. The init-less reduce arity (which is awful, don't call it!) is documented to call the reducing function on the first two elements of the collection