This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # aleph (1)
- # announcements (1)
- # beginners (59)
- # boot (2)
- # calva (5)
- # cider (8)
- # clj-kondo (6)
- # cljdoc (5)
- # cljsrn (11)
- # clojure (123)
- # clojure-dusseldorf (1)
- # clojure-europe (4)
- # clojure-italy (22)
- # clojure-losangeles (4)
- # clojure-nl (10)
- # clojure-spec (18)
- # clojure-uk (22)
- # clojurescript (103)
- # cursive (32)
- # data-science (1)
- # datomic (21)
- # events (2)
- # figwheel (1)
- # fulcro (12)
- # graalvm (3)
- # graphql (8)
- # jobs (2)
- # kaocha (4)
- # klipse (2)
- # lein-figwheel (4)
- # leiningen (23)
- # off-topic (11)
- # planck (11)
- # re-frame (8)
- # reagent (2)
- # reitit (3)
- # rewrite-clj (1)
- # ring (1)
- # ring-swagger (31)
- # schema (2)
- # shadow-cljs (66)
- # spacemacs (3)
- # specter (16)
- # sql (9)
- # tools-deps (16)
- # vim (26)
ns-unmap for easier code reload of defmulti/defmethod within REPL, but it caused exception when invoking uberjar standalone jar, any way I can detect if current environment is dev or not in order to skip those
@hiredman thx for your advise, although it works as if
ns-unmap, packaging with uberjar still throw exception, I guess aot compilation don’t allow variable re-binding…
I would not be super surprised if you had some lurking namespaces issue with your project
Maybe not (trying to remember where and in what order the bytecode to look up vars is emitted)
Hey, I have a date format as "2017-02-14T12:00:00.000+4:00", I need it to convert so that it is in format YYYY-MM-DD, so basically get rid of time and timezone stuff. I used clj-time.coerce/from-string to convert it from String to DateTime Instant.
check out the java.time.format package in the JDK
user=> (def d (java.time.LocalDateTime/now)) #'user/d user=> d #object[java.time.LocalDateTime 0x643ba1ed "2019-08-14T01:23:05.972628"] user=> (.format d (java.time.format.DateTimeFormatter/ofPattern "yyyy-MM-dd")) "2019-08-14"
what type are you starting with? what type do you want at the end?
so string / string
so would be best to first parse from string to LocalDateTime, using a DateTimeFormatter (once you create a formatter, it can be used to either parse or format)
then use a different formatter to format back to a string
just be careful that you understand what you're doing with the timezone offset
it's not anymore
the same developers that created joda developed the java.time packages which are now part of java
java.time and joda are similar as they were created by the same people
same formatter stuff exists
If I’m in namespace
app.db.core and I want to use a spec from
app.db.entity is there a way to do that that doesn’t involve writing
:app.db.entity/foo-spec every time I need to reference it?
Hi! im stucked trying to use a local library in my clojure project.
I created a
checkouts folder at the source directory, and symlinked the local lib, but when i run
lein ring server, it seems it totally ignores what's in the checkouts...
I've never used
checkouts, but running
lein do pom, jar, install in your local library directory, then starting your project that depends on it (making sure it's listed as a dependency with the same version number), has always worked for me.
@brandon149 you can also try
(:require [app.db.entity :refer [::foo-spec]). I know it works with fn syms, I havent tried it with spec syms, but there is no reason it shouldnt work. You can also do
refer-all to alias all the syms from that ns into the current ns.
@murtaza52 I tried out some stuff in the repl and it looks like doing a regular ns require will let you do
yes that should work too, and is actually the better option in your case. I did not mention id bcoz @vale had already mentioned it.
Is there a major blog post that people refer to for setting up their Clojure dev environment?
https://purelyfunctional.tv/guide/how-to-install-clojure is good for getting things installed. after that, you have to search for guides on the build tool you're going for (ie. https://clojure.org/guides/deps_and_cli is good for tools.deps)
if you already use emacs or have been wanting to learn, then check out CIDER. emacs is a lot to learn and rewarding (i think) but has a long learning curve. Cursive is an excellent option and these two dominate the marketshare if i'm remembering the clojure survey results correctly. Outside of this there's Calva for VS code which reuses a lot of CIDER's underlying tooling and Chlorine for Atom. There's a really nice video from @seancorfield using Atom to fix a bug in a lib that is a nice showcase of its benefits and workflow. But once you choose from this list then just follow along with the docs/blogs about that tooling
FYI, Clojure survey 2019 results for dev environment can be found at "Q12" here: https://www.surveymonkey.com/results/SM-S9JVNXNQV/
Error messages are important to a lot of people!
Didn’t realize, I guess after a while you get so used to them
I think anything unfamiliar, that at first seems confusing and/or you believe was done better in previous dev environments you worked in, you notice and wish for what you used to have 🙂
tools.deps brought me back into the clojure fold because it drastically changes the Clojure environment imo and isn't talked about enough.
I wouldn't call it silly, but if you feel that strongly about tools.deps bringing you back, have you considered writing an article about it?
(maybe you have, and I didn't notice -- sorry if so)
To me, the Clojure environment before tools.deps was so unfamiliar I couldn't justify the time investment with a whole cambrian explosion of many things going on and me having many interests through all of that.
did I spend some time coming up to speed with lein and
project.clj? sure. but the ecosystem to date just has a lot of "this is how I solved it as someone experienced" and a lot less of what @seancorfield has already done with his breakdown of his $HOME level