This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-07-24
Channels
- # announcements (5)
- # beginners (184)
- # calva (32)
- # cider (29)
- # clj-kondo (1)
- # cljdoc (29)
- # cljsrn (6)
- # clojure (44)
- # clojure-dev (36)
- # clojure-europe (9)
- # clojure-italy (18)
- # clojure-losangeles (1)
- # clojure-nl (3)
- # clojure-spec (7)
- # clojure-uk (30)
- # clojure-ukraine (1)
- # clojuredesign-podcast (8)
- # clojurescript (65)
- # code-reviews (21)
- # core-async (25)
- # cursive (51)
- # data-science (3)
- # datascript (2)
- # datomic (25)
- # emacs (14)
- # events (1)
- # figwheel-main (3)
- # fulcro (3)
- # graalvm (5)
- # jackdaw (17)
- # kaocha (14)
- # luminus (5)
- # off-topic (17)
- # pathom (7)
- # pedestal (2)
- # re-frame (71)
- # reagent (25)
- # shadow-cljs (83)
- # spacemacs (31)
- # sql (92)
- # tools-deps (23)
- # vim (102)
- # xtdb (5)
need help on core.async Caused by: java.lang.ClassNotFoundException: clojure.core.async.Mutex using lein repl with :dependencies [[org.clojure/clojure "1.9.0"] [org.clojure/core.async "0.4.500"] [me.raynes/conch "0.8.0"] [com.draines/postal "2.0.3"] [propertea "1.3.1"] [instaparse "1.4.10"] [com.taoensso/timbre "4.10.0"]]
That class doesn’t exist anymore
You must have an old version aot compiled in somewhere or a dep mismatch
Would probably be helpful to do a lein clean, or lein deps :tree or a stack trace etc
@alexmiller thanks, lein clean worked, i will keep clojure 1.7 for tonight , tried upgrading to 1.9 has many error with in my code ( clojure.core/ns did not conform to spec )
@skadam A lot of those errors can be "fixed" by updating to more recent dependencies I suspect (unless they're genuinely coming from your code and not libraries?).
This page lists known errors in popular libraries that were detected by Spec and subsequently fixed by correcting the syntax https://archive.clojure.org/design-wiki/display/design/Errors%2Bfound%2Bwith%2Bcore%2Bspecs.html
will look at it @seancorfield thanks for pointing
@carkh if i understood your question correctly, you would like src/dev/user.clj
to be loaded when you run a repl from within the src
directory (where deps.edn
is located). if that's the case, then you may use :extra-paths
as documented here: https://clojure.org/reference/deps_and_cli#_make_classpath
something like this:
{:deps {aleph {:mvn/version "0.4.6"}
integrant {:mvn/version "0.7.0"}}
:paths ["src" "resources"]
:aliases {:dev {:extra-deps {integrant/repl {:mvn/version "0.3.1"}}
:extra-paths ["dev"]}
:uberjar {:extra-deps {seancorfield/depstar {:mvn/version "0.2.2"}}}}}
yes the trouble is that i'm launching from cider, and i don't thinkit launches my :dev alias
and i don't want to put it in the main paths because it's for dev ... looks like cannot be solved
oh, i'm not so familiar with cider. i'm a cursive user and there's a way to specify an alias to run with use clj
.
ahaaa for future reference : (setq cider-clojure-cli-global-options "-A:server:client:dev")
I wanted to implement a couple of functions that retrieves the next or previous value in a collection given a predicate, and cycles to the end or beginning of the collection if the predicate matches a value at the beginning or end of the collection respectively. I.e.,
(next-item (partial = 3) [1 2 3 4 5]) ;; => 4
(next-item (partial = 5) [1 2 3 4 5]) ;; => 1
(next-item (partial = 1) [1]) ;; => nil
(next-item (partial = 1) []) ;; => nil
(next-item true? [1 2 3 4 5]) ;; => nil
(previous-item (partial = 3) [1 2 3 4 5]) ;; => 2
(previous-item (partial = 1) [1 2 3 4 5]) ;; => 5
(previous-item (partial = 1) [1]) ;; => nil
(previous-item (partial = 1) []) ;; => nil
(previous-item true? [1 2 3 4 5]) ;; => nil
This is what I came up with. Is this a decent implementation, or could it be improved?
I have one tip. Instead of doing (if pred something nil)
, use when
which automatically returns nil when the predicate is falsey
you can write it in a shorter form:
(defn next-item [pred coll]
(->> (concat (rest coll) (take 2 coll))
(drop-while (complement pred)) fnext))
(defn previous-item [pred coll]
(next-item pred (reverse coll)))
I am making a library, that has an optional part namely, you can pass edn or yaml as configuration. I want to make dependency on yaml parsing library optional, so the library user can include it or not. The problem is how to make yaml parse namespace require conditional. Any ideas?
You could conditionally load it if the user submits yaml. See the function requiring-resolve
what do you mean by truncatable without detection?
if you remove lines from the end of a yaml file, it's still valid yaml @roklenarcic
I see.
hello, maybe I dreamt it, but I remember a project that involved “compiling” clojure functions and their dependencies and uploading them to AWS lambda for execution. I really can’t remember its name, does anyone know what I’m talking about?
it would walk the code to figure out which parts are necessary
@thegeez yes! thank you!
@nathanmarz was talking about something similar a few days ago too.
Hi. Anyone has an idea on how to get the equivalent of (map vector coll1 coll2)
as a transducer? e.g.
(into [] (map vector [:a :b]) [1 2])
=> [[:a 1] [:b 2]]
you can't in into
, only sequence
has multi-coll transducer support (which returns a lazily realized sequence, so probably not too useful)
@alexmiller thanks, I'll look into it