Fork me on GitHub
#clojure-spec
<
2019-06-15
>
misha16:06:06

(->> [0 1 2 3]
  (partition-all 2)
  (into {}))
ClassCastException   [trace missing]

(->> [[0 1] [2 3]]
  (into {}))
=> {0 1, 2 3}
😞

misha16:06:15

(->> [0 1 2 3]
  (partition-all 2)
  (map vec)
  (into {}))
=> {0 1, 2 3}

andy.fingerhut19:06:01

one of the places in Clojure where vectors vs. non-vectors makes a difference.

y.khmelevskii19:06:24

hey, can you please help me to understand why lein throw this error

If there are a lot of uncached dependencies this might take a while ...
clojure.lang.ExceptionInfo: Could not find artifact org.clojure:spec-alpha2:jar:0.2.177-SNAPSHOT in central ()
{:lib org.clojure/spec-alpha2, :coord {:mvn/version "0.2.177-SNAPSHOT", :deps/manifest :mvn}}

y.khmelevskii19:06:04

I use leiningen together with deps.edn

bronsa19:06:28

snapshot releases are not in maven central, they're in sonatype

bronsa19:06:42

try adding in your repos

y.khmelevskii19:06:38

which way? via :mvn/repos?

y.khmelevskii19:06:01

:mvn/repos {"clojars" {:url ""}
             "central" {:url ""}}
it doesn’t work

y.khmelevskii19:06:09

and my dependency org.clojure/spec-alpha2 {:mvn/version "0.2.177-SNAPSHOT"}

bronsa20:06:07

not sure if lein picks up repos from deps.edn

bronsa20:06:28

if you're sure that snapshot exists, maybe trying adding that repo in .lein/profiles.clj and retry

bronsa20:06:34

don't have any other suggestions, sorry