This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-03-06
Channels
- # adventofcode (2)
- # announcements (5)
- # architecture (4)
- # babashka (35)
- # beginners (28)
- # calva (4)
- # cider (9)
- # clerk (30)
- # clj-kondo (11)
- # clojure (58)
- # clojure-conj (3)
- # clojure-europe (71)
- # clojure-gamedev (2)
- # clojure-nl (3)
- # clojure-uk (2)
- # clojurescript (49)
- # conjure (2)
- # cursive (2)
- # emacs (4)
- # fulcro (1)
- # honeysql (2)
- # hyperfiddle (10)
- # jobs (2)
- # jobs-discuss (18)
- # leiningen (9)
- # membrane (14)
- # missionary (1)
- # off-topic (27)
- # pedestal (1)
- # polylith (5)
- # reagent (12)
- # releases (2)
- # remote-jobs (3)
- # shadow-cljs (83)
- # sql (5)
- # squint (14)
- # tools-build (13)
Just today I got this issue back: https://clojurians-log.clojureverse.org/tools-deps/2021-09-16 Using a very recent clojure CLI: Clojure CLI version 1.11.1.1200 Same error:
Error building classpath. Could not acquire write lock for 'artifact:org.bytedeco:opencv:4.5.5-1.5.7'
java.lang.IllegalStateException: Could not acquire write lock for 'artifact:org.bytedeco:opencv:4.5.5-1.5.7'
same workaround to get it fixed:
clj -Sthreads 1
I have it reproducible, every time doing:
rm -rf ~/.m2/repository/org/bytedeco/opencv* && clj
with a deps.edn:
{:deps {org.deeplearning4j/deeplearning4j-nlp {:mvn/version "1.0.0-M2.1"}}}
using
Clojure CLI version 1.11.1.1200
workaround is, as before:
clj -Sthreads 1
In the prevoius thread (https://clojurians-log.clojureverse.org/tools-deps/2021-09-16), it seems to have gone away with
a later Clojure CLI (1.10.3.981).
Either this was not true, or it came back.Also check with -Sforce to make sure you have a fresh classpath computation, but please put on Ask Clojure and I will take a look when I have a chance, might not be today
Done: https://ask.clojure.org/index.php/12730/error-could-acquire-write-lock-artifact-org-bytedeco-opencv

hi, any updates for https://github.com/edn-format/edn/issues/43 ? I've tried "viewing" an edn config file from nginx and it prompt for download
what would the recommended type be?
I will talk to Rich and look into it again
Hello. If you want to greet people and chat about random stuff, please do that in #off-topic. This channel is reserved for discussions and questions about #clojure :)
A couple of the special forms listed on the https://clojure.org/reference/special_forms are in fact macros wrapping the concrete special form: let
-> let*
, fn
-> fn*
. Is there an available full list of the concrete/actual special forms? The ones built into the reader/compiler that exist before core.clj
is loaded.
the list at the top of the Compiler is probably mostly that list - https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L40
oh of course, thanks
well, particularly https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L105
does anyone know if http://clojuredocs.org can take search path params? e.g.,Can I open Find page using a path like:
, or it always has to be FQN, i.e.,
Struggling to understand something in the context of tools.namespace.repl
.
I have code like this:
(defonce ^:dynamic *env* nil)
(defmethod some-other-ns/do-stuff :x [_]
(println *env*))
(defn load-env []
(into {} ...))
(defn load []
(binding [*env* (load-env)]
(some-other-ns/call-do-stuff-on-some-deeply-nested-data)))
On the first call to load
all is fine.
But calling load
after t.n.repl/refresh
shows that *env*
is now nil
.
Where did that binding go, given that (load-env)
can never return something but a map?Not reloading the NS with *env*
fixes the issue, but I would still like to understand where it came from in the first place.
But that defmethod
is the "old code" that apparently sees the old var - since it's in the same NS, shouldn't it start seeing the new var right away?
And defonce
doesn't prevent the new var from appearing, right?
`But that
Which namespace the code is doesn't come into it, what comes into it is when the code that is running looked up the var by name
Which generally only happens when code is loaded (there is a static init that looks up vars by name and then stores the var it finds in a static field of most fn classes generated by the compiler)
So it is a temporal difference (code loaded at different times coexisting) not a spacial one (different namespaces or whatever)
I see, thanks. Still feels itchy because I haven't traced it with a debugger to the exact root cause, of course. :) But that can wait, given that not reloading that particular ns works just fine.
The refresh is an epoch, a line in time that for things to work correctly code shouldn't cross, but for some reason you are having code survive across the line
I am trying to use the cli to return the value of a var. Originally, I was inclined to do something like
clj -X com.namespace/foo
But, it is pretty clear that that is only going to work with functions. Can anyone think of a way to do this?
By returning a value do you mean an exit code or printed return?
I mean you can use -M -e to evaluate and print the result of any expression
Is that sufficient?
So I just wanna make sure we are on the same page, In com.namespace
i have (def foo "bar")
and I am just trying to return "bar"
With -e
you'd still need to require the ns. -e "(requiring-resolve 'com.namespace/foo)"
(and you may need (deref ..)
wrapped around that since requiring-resolve
returns a Var
)
Like so:
(~/clojure)-(!2007)-> clojure -Tnew app :name flava/dave
Creating project from org.corfield.new/app in dave
Mon Mar 06 14:02:46
(~/clojure)-(!2008)-> cd dave/
Mon Mar 06 14:02:49
(~/clojure/dave)-(!2009)-> vi src/flava/dave.clj
Mon Mar 06 14:03:03
(~/clojure/dave)-(!2010)-> cat src/flava/dave.clj
(ns flava.dave
(:gen-class))
(def foo "bar")
(defn greet
"Callable entry point to the application."
[data]
(println (str "Hello, " (or (:name data) "World") "!")))
(defn -main
"I don't do a whole lot ... yet."
[& args]
(greet {:name (first args)}))
Mon Mar 06 14:03:06
(~/clojure/dave)-(!2011)-> clojure -M -e "(requiring-resolve 'flava.dave/foo)"
#'flava.dave/foo
Mon Mar 06 14:03:26
(~/clojure/dave)-(!2012)-> clojure -M -e "(deref (requiring-resolve 'flava.dave/foo))"
"bar"
Mon Mar 06 14:03:37
(~/clojure/dave)-(!2013)->
In other languages, you can put a reference to a parent object on a child and traverse up and down the relationships pretty easily. This is less doable in clojure without incurring additional memory costs and losing updates when either side changes. How do folks deal with this?
@U2FRKM4TW's suggestion is a good one. Depending on the use case, you can also use things like zippers!
Normalization is smart. Iām considering zippers but they feel very low level for the kind of operations Iām working with.
What kind of operations are you working with?
lol Iām working with source code traversal, which is the bread and butter of zippers, namely rewrite-clj. But rewrite-clj is a little slow and I find zippers to be hard to work with/conceptualize, so Iām exploring other options for fun.
in functional programming you usually use write a recursive transformation and use the call stack as the parent pointer
that can be a bit awkward sometimes of course, but for tree rewriting it definitely works
zippers add quite a bit of overhead. you can also do what those other languages do: use mutable references
I ran into a similar problem when trying to port a markdown parser from JS to Clojure
In analysing sports games, we originally had something that used a zipper. Currently experimenting with something that promises to be much faster based on a kind of doubly linked list of events allowing for lazily looking outwards in either direction from current context. That's an interesting point about normalisation. Will need to think about that.