This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-02-03
Channels
- # announcements (8)
- # aws (2)
- # babashka (16)
- # beginners (173)
- # calva (13)
- # cider (4)
- # cljfx (6)
- # cljs-dev (108)
- # clojure (63)
- # clojure-australia (2)
- # clojure-dev (10)
- # clojure-europe (73)
- # clojure-italy (8)
- # clojure-nl (4)
- # clojure-norway (5)
- # clojure-uk (4)
- # clojurescript (49)
- # clojureverse-ops (4)
- # community-development (3)
- # core-async (23)
- # cursive (3)
- # data-science (5)
- # datomic (25)
- # emacs (3)
- # events (1)
- # fulcro (13)
- # helix (5)
- # introduce-yourself (1)
- # lein-figwheel (1)
- # lsp (36)
- # malli (1)
- # meander (2)
- # membrane (4)
- # music (8)
- # nextjournal (51)
- # off-topic (47)
- # other-languages (5)
- # pathom (31)
- # pedestal (5)
- # planck (14)
- # polylith (5)
- # portal (1)
- # re-frame (30)
- # react (2)
- # reagent (24)
- # releases (1)
- # rewrite-clj (18)
- # ring (9)
- # sci (33)
- # shadow-cljs (49)
- # testing (3)
- # tools-build (21)
- # tools-deps (29)
- # vim (19)
- # web-security (1)
- # xtdb (12)
https://github.com/cognitect-labs/test-runner for example calls shutdown-agents! already
I am using this library, but I experienced test suites that failed to exit not too long ago and adding an explicit call to shutdown-agents!
in my own test fixture seemed to fix it. perhaps that was a coincidence?
clojure.test doesn't have global test fixtures, just per testing namespace fixtures, so adding shutdown-agents! there will break things for any tests run after that
I guess I just lucked out in that the suite that has that fixture happens to consistently run last
and/or none of the other tests depend upon namespaces that use/require agents for the capabilities being tested
sure enough, a local run with the shutdown-agents
fixture commented out is hanging at the moment - if I'm relying on a fixture to prevent this from happening it sounds like I need to do some more work to track down the actual problem
@hiredman based on my read of the source, it seems like shutdown-agents
will only get called if an exception is raised, which means that something like my fixture may still be necessary:
https://github.com/cognitect-labs/test-runner/blob/334f2e2a5491747dff52f9ca8cbb4a53f54d344d/src/cognitect/test_runner.clj#L129
the real culprit was my own fault, a misplaced send
"stop" call to an agent already in a "terminated" state that blocked the shutdown hook I had added to the runtime
shutdown-agents
had the appearance of fixing it because it terminated the agent before that send
call.
According to last year's State of Clojure survey, almost 62% of Clojure developers use Clojurescript https://www.surveymonkey.com/results/SM-S2L8NR6K9/
Hi, what is your preferred solution for implementing sliding window with transducers? I hoped that this: https://ask.clojure.org/index.php/2422/transducer-for-partition-all-with-step will be one of 1.11 updates 😶
It does, would you recommend it? I was discouraged by the last commit date so I created my own implementation but I will switch if that library is frequently used.
it is frequently used
I would recommend it
stuff that works doesn't need commits :)
Generally, last commit date isn't a good indicator of “good library” given how stable clojure is
Of course not. But there are some issues and no updates so i wanted to be sure that there is no newer and better alternative. Thank you :-)
Any recommendations for tutorials on Clojure CLI / deps.edn for someone coming from Leiningen? (Some kind of mapping from how-to-do-X-with-Leiningen to how-to-do-X-with-deps.edn.)
Ive been using https://clojure.org/guides/deps_and_cli and google so far 🙂
And there's the #tools-deps channel which is helpful when you're switching over. We went lein
(2011) -> boot
(2015) -> CLI / deps.edn
(2018) at work so I'm happy to answer any specific Qs you might have @U06A9U5RP
@seancorfield Thank you. I will ask specific questions there (after I’ve read up a bit more on the basics).
I'm trying to use clj-new
to scaffold a figwheel-main template, but am having some issues. @seancorfield any ideas?
clojure -Ttools install com.github.seancorfield/clj-new '{:git/tag "v1.2.381"}' :as clj-new
Checking out: at 76f728dce63f7b881f4e5705ba0d59d795d56f11
Installed clj-new
coetry@Allens-MacBook-Air ~ % clj -X:new clj-new/create :template figwheel-main :name coetry/seven-guis :args '["--reagent"]'
WARNING: Specified aliases are undeclared and are not being used: [:new]
Namespace could not be loaded: clj-new
coetry@Allens-MacBook-Air ~ % clj -Tclj-new/create :template figwheel-main :name coetry/seven-guis :args '["--reagent"]'
Error building classpath. Unknown tool: clj-new/create
coetry@Allens-MacBook-Air ~ % clj -Tclj-new :template figwheel-main :name coetry/seven-guis :args '["--reagent"]'
No function found on command line or in :exec-fn
coetry@Allens-MacBook-Air ~ % clojure -Tclj-new :template figwheel-main :name coetry/seven-guis :args '["--reagent"]'
No function found on command line or in :exec-fn
maybe @U064J0EFR you might know?
@U1KFUC2NA Happy to improve the clj-new
README if that would help? It has this section on installation and use as a CLI tool: https://github.com/seancorfield/clj-new#installation-as-a-tool and then it has this section on installation and use via an alias in deps.edn
: https://github.com/seancorfield/clj-new#installation-via-depsedn
you said :as clj-new
on the installation - that's the tool name
then its clj -Tname function
so here should be clj -Tclj-new create ...
the -X:new
didn't work as you didn't define the :new
alias anywhere
so should be:
clj -Tclj-new create :template figwheel-main :name coetry/seven-guis :args '["--reagent"]'
If I have the name of a symbol as it's used in a namespace, how do I resolve it? As in, a namespace the-ns
requires another one like (:require [foo.bar :as baz])
and uses a symbol like baz/boo
, how do I resolve the symbol baz/boo
used in the-ns
from another namespace e.g. to get meta
on that symbol as it's defined in foo.bar
? When I try something like (ns-resolve (find-ns 'the-ns) (symbol "baz/boo"))
I get nil
(find-ns returned a right-looking value as did symbol). Is there a way to do this?
user=> (ns foo)
nil
foo=> (def f 1)
#'foo/f
foo=> (ns bar (:require [foo :as f]))
nil
bar=> (in-ns 'user)
#object[clojure.lang.Namespace 0x522b2631 "user"]
user=> (ns-resolve 'bar 'f/f)
#'foo/f
user=>
ah, i was remembering this little bit (map namespace [(symbol "foo/bar" "baz") (symbol "foo" "bar/baz")])
where the symbols print identically but have different namespaces
thanks @hiredman!
i'm looking for a way of serializing and storing clojure data in a compact way that would allow storing historical copies
https://github.com/lacuna/bifurcan > [ALPHA] durable (disk-backed) representations which share the API and asymptotic performance of their in-memory counterparts Haven't tested this, but may be worth looking into ^
I'm also interested in a library that could do what you describe.
iirc @U053S2W0V did something like this a number of years back(?)
although I don't think this does history
you could use datahike which does hitchhiker trees for on-disk persistent kv store and then it builds a datalog query engine atop it
it does have history
@U07S8JGF7 i did build something like this, but it never achieved production readiness in a way i felt comfortable sharing
hitchhiker trees do that
if nothing else
they don't map cleanly to all clojure structures though necessarily