Questions tagged [clojure]
Clojure is a modern Lisp dialect for the Java Virtual Machine (with versions for the CLR and JavaScript). More than merely an implementation of Lisp in Java, Clojure provides access to Java's classes and ecosystem.
clojure
17,693
questions
1
vote
1
answer
110
views
Syntax error macroexpanding defact, upgrading clojure 1.9 to 1.12
I'm getting the following error when upgrading from clojure 1.9 to clojure 1.12
Syntax error macroexpanding defact at (up/lib/pvm/fact.clj:23:18).
Don't know how to create ISeq from: clojure.lang....
1
vote
1
answer
40
views
Datomic and Paramaterized :where clauses
I have this:
(defn entities [entity-map]
(db/q
'[:find [(pull ?e pattern) ...]
:in $ pattern ?primary-field
:where [?e ?primary-field]]
(:pattern entity-map)
(:primary entity-...
0
votes
0
answers
42
views
Generate aliased namespaced tags with Ctags
I'm trying to configure Universal Ctags to recognize functions imported from different namespaces with an alias. The language I'm using is Clojure (I also give an example in Javascript), so every ...
0
votes
1
answer
40
views
Error when trying to run ClojureScript on Windows
I try to run ClojureScript "hello-world" project on Windows 10 Home 22H2 19045.4529. I follow documentation from https://clojurescript.org/guides/quick-start and get following output:
C:\...
2
votes
0
answers
82
views
How to fix java.lang.ClassNotFoundException: com.sun.tools.attach.VirtualMachine in java 21
I've a clojure project with deps.edn which uses the library clj-async-profiler
My main function in the project contains the below code -
(ns com.myns.cli
(:gen-class)
(:require
[clj-async-...
1
vote
2
answers
56
views
Trying to import libraries in Clojure
I have a problem with a code I am developing in Clojure:
(ns problem2 (:require [cheshire.core :as json]
[clojure.spec.alpha :as s]
[invoice-spec]))
(...
1
vote
1
answer
54
views
Not able to send post request with Content Type "x-www-form-urlencoded" with Clojure
I'm basically trying to do the following cURL command in Clojure:
curl --location '<auth-url>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=...
1
vote
1
answer
53
views
Set Clojure CLASSPATH on Windows
I have been struggling to modify my classpath in order to import clojure modules on my Windows machine. I have already updates my environment variable through powershell but I get the same error:
...
1
vote
1
answer
79
views
GraalVM cannot find BouncyCastle provider
I've got a Clojure program that I am trying to compile into a native image using GraalVM. The program is just a main function:
(defn -main [& args]
(println (Signature/getInstance "EDDSA&...
1
vote
1
answer
36
views
How can I integrate pac4j with clojure ring
I'm working to build a clojure ring app and use Shiro for authn/authz.
I saw pac4j can bring in OpenID Connect authentication for a lot of services.
I saw there is no pac4j implementation for clojure ...
1
vote
1
answer
66
views
How to interoperate from clojure with java varargs methods
According with docs I have to use into-array but it doesn't work.
(java.nio.file.Paths/get (into-array ["myfolder" "aaa.txt"]))
; Execution error (ClassCastException) at msm.config/...
0
votes
3
answers
58
views
Catch a compiler exception in macroexpand
I have an assertion that checks key correctness at compile time:
(defn assert-keys [check-map valid-keys]
(let [k (set (keys check-map))]
(when-not (set/subset? k valid-keys)
(throw (ex-...
0
votes
2
answers
45
views
How to pass list of args to variadic macro
I have a macro (I've simplified everything a lot):
(defmacro m1 [error & messages]
`(if ~error
(str "Error: " ~@messages)
(str ~@messages)))
It works pretty well. But now I ...
3
votes
5
answers
144
views
Clojure reduce not producing expected results
Why does the first reduce not work but the second does? The order of the comparisons should be the same...
(reduce (fn [{:keys [minimum maximum]} new-number]
{:minimum (if (and minimum (< ...
0
votes
1
answer
36
views
How to require a .clj fle from another project on my local machine?
Let's say you create two projects with Leiningen (side by side in a folder called projects) with lein new ping and lein new pong. Then you implement a little function in ping\src\ping\core.clj:
(defn ...