Skip to main content
Stack Overflow for Teams is now Stack Internal: See how we’re powering the human intelligence layer of enterprise AI. Read more >
Filter by
Sorted by
Tagged with
1 vote
1 answer
61 views

This is the code fragment of the error: (defn end-render [fb] (let [width (get-in fb [:dimen :width]) height (get-in fb [:dimen :height]) msfbo (:msfbo fb) fbo (:fbo fb)] ...
user1785730's user avatar
  • 3,839
2 votes
1 answer
114 views

At the risk of asking a question with an obvious solution: if I have a function in J that takes two arguments and returns two arguments and I want to accumulate the answer's second argument and to use ...
Shmuel Greenberger's user avatar
1 vote
0 answers
81 views

First of all thanks in advance for any help, this is the first time I'm setting up a system like this, so a few points are not clear and might be written in bad form (and that's why I'm here). ...
Alberto Zaccagni's user avatar
1 vote
1 answer
86 views

This code (GL33/glUniform2fv ^int (location shader "offsets") ^float [] offsets) produces this error: No matching method glUniform2fv found taking 3 args for class org.lwjgl.opengl.GL33 I'...
user1785730's user avatar
  • 3,839
3 votes
0 answers
121 views

I implemented a few lazy sort & merge functions that are used heavily in my ReBAC authorization library, EACL, to lazily "merge" & deduplicate ~1M datoms emitted from Datomic's d/...
Petrus Theron's user avatar
1 vote
1 answer
76 views

I'm just trying the Clojure LSP plugin in Intellij IDEA Community without knowing anything about Clojure or the plugin. My goal is to start learning Clojure. I installed the plugin and clojure-lsp via ...
user38725's user avatar
  • 965
0 votes
0 answers
41 views

One thing I like about metadata is that I can organise functions across namespaces. E.g.: (defn ^{:category 1} a-function [] (do-stuff)) (->> (ns-interns 'this.namespace) vals (map ...
Lars Melander's user avatar
0 votes
1 answer
57 views

Shadow-cljs has a resource loader that can include literal files into the Clojurescript code (ns app.my (:require [shadow.resource :as rc])) (rc/inline "file.txt") I need a macro that ...
user2649762's user avatar
0 votes
1 answer
87 views

In this function I get an exception: (defn ball-collision? [ball brick] (let [^org.joml.Vector3f ball-pos (:position ball) ^org.joml.Vector3f brick-pos (:position brick) ^org.joml....
user1785730's user avatar
  • 3,839
0 votes
0 answers
42 views

I am trying to make a sample web application on clojure that uses reitit and exposes its structure via swagger. To that end i have added code that handles request for "/swagger.json" as ...
Srv19's user avatar
  • 3,638
1 vote
2 answers
112 views

Consider this code snippet which calculates the delta time since the last frame: (defn game-loop [window game] (let [last-frame (atom (GLFW/glfwGetTime))] (while (not (GLFW/...
user1785730's user avatar
  • 3,839
1 vote
1 answer
92 views

Consider this map: (def my-map {:a-vec []}) Now I want to append some value to a-vec: (assoc my-map :a-vec (conj (:a-vec my-map) 17)) What I don't like about this is that I name both the map and the ...
user1785730's user avatar
  • 3,839
1 vote
0 answers
126 views

When enabling Cursive in Intellij 2024.03 it throws: Error reading C:\myprocect-path\project.clj class com.intellij.credentialStore.OneTimeString cannot be cast to class java.lang.String (com.intellij....
Krzysztof Tkacz's user avatar
0 votes
1 answer
110 views

This is the Java code: public static FloatBuffer createInterleavedVertexBuffer(AIMesh mesh) { FloatBuffer buffer = BufferUtils.createFloatBuffer(mesh.mNumVertices() * 8); for (int i = 0; i <...
user1785730's user avatar
  • 3,839
2 votes
1 answer
60 views

This is my java source file: package main; class ModelLoader { public static void foo() { System.out.println("foo"); } } which is located at src/main/java/ModelLoader.java. ...
user1785730's user avatar
  • 3,839
3 votes
1 answer
63 views

How can I access the main window (:stage) from a menu click event in Cljfx? I need it for two reasons: to open a file chooser, and to resize the window. A minimal example: (ns a (:require [cljfx.api ...
kamwitsta's user avatar
  • 460
0 votes
1 answer
49 views

I am having no luck calling advanceExact in various Lucene DocValues subclasses, for example: user> (.advanceExact doc-values 1) Execution error (IllegalArgumentException) at user/eval24512 (REPL:...
Ryan Tate's user avatar
  • 1,613
0 votes
1 answer
90 views

This is my Clojure code: (ns learnopengl.mesh-model (:import [org.lwjgl.assimp Assimp AINode AIMesh])) (defn read-model "read a 3D model from a file" [path] (let [scene (Assimp/...
user1785730's user avatar
  • 3,839
-2 votes
2 answers
59 views

Working from CLI: (ns something (:require [clojure.java.io :as io])) (io/resource "file.txt") =>nil (slurp "file.txt") =>"content of file" Why doesn't io/...
Kustekjé Meklootn's user avatar
-1 votes
2 answers
127 views

Would like to have the equivalent of this in clojure, using the cljfx-library. FXTrayIcon icon = new FXTrayIcon(stage, getClass().getResource("someImageFile.png")); icon.show(); Starting ...
Kustekjé Meklootn's user avatar
1 vote
5 answers
150 views

Using clojure, how does this reduce work, when the anonymous function takes 2 parameters? (defn better-symmetrize-body-parts "Expects a seq of maps that have a :name and :size" [asym-...
Kevin Kraft's user avatar
0 votes
0 answers
30 views

I am writing a non-Clojure nREPL server. To test it, I need a language-agnostic nREPL client. I have been using monroe, however I am being thwarted by an error when I attempt to evaluate selected text:...
diachedelic's user avatar
  • 2,379
2 votes
1 answer
96 views

I'm using LWJGL MemoryStack together with JOML like this: (ns learnopengl.transformations (:import [org.joml Vector3f Matrix4f] [org.lwjgl.system MemoryStack])) (def memory-stack (...
user1785730's user avatar
  • 3,839
0 votes
0 answers
39 views

According to their documentation https://cljdoc.org/d/io.github.camsaul/toucan2/1.0.511/api/toucan2.insert#insert-returning-instances!, insert-returning-instance! should return the inserted record ...
CS Nerds's user avatar
1 vote
2 answers
328 views

I am desperately trying to set up a working environment for Clojure 1.12.0.1488, using IntelliJ 2024.3, Cursive's plugin 2025.1.1-343 and openJDK 24. I am using VoidLinux based on kernel 6.12.28_1, ...
Aurélien Plazzotta's user avatar
2 votes
3 answers
130 views

I'm having a problem with a little function that's supposed to count nodes and leaves in a tree. This is what it looks like: (defn count-tree "Count nodes and leaves in a tree as produced by ...
kamwitsta's user avatar
  • 460
2 votes
1 answer
89 views

Consider this snippet: (def vertices [ -0.5 -0.5 0 0.5 -0.5 0 0 0.5 0]) (def vertex-buffer (doto (BufferUtils/createFloatBuffer (count vertices)) (dorun (map #(.put (float %...
user1785730's user avatar
  • 3,839
2 votes
2 answers
102 views

I have an extremely simple Clojure project that uses JavaFX 21.0.7; it's just one file, and all it's meant to do (at the moment) is display a stage with a scene consisting of an empty pane: (ns ...
Choosechee's user avatar
0 votes
1 answer
67 views

I've been trying to follow this tutorial. This is my callback: (def cb (proxy [java.lang.Object GLFWKeyCallbackI] [] (invoke [window keycode _ action _] (when (and (= keycode ...
user1785730's user avatar
  • 3,839
0 votes
1 answer
56 views

consider i have map r as below - {:a1 {:foo {:xyz "xyz" :abc []} } :a2 {:bar {:xyz "xyz" :abc []} } :a3 {:baz {:xyz "xyz" :abc []} } :a4 {:bax {:xyz "xyz"}} ...
user51's user avatar
  • 10.6k
1 vote
1 answer
63 views

I'm trying to follow this tutorial and can't seem to correctly translate this line: window = glfwCreateWindow(300, 300, "Hello World!", NULL, NULL); This is what I've tried: (let [window (...
user1785730's user avatar
  • 3,839
0 votes
1 answer
102 views

I'm writing a classic binary search function in Clojure and testing it with the mutant mutation testing library. My tests work fine in terms of correctness, but mutation testing reports one surviving ...
Raíssa Barreira's user avatar
1 vote
1 answer
81 views

This is the error: Execution error (UnsupportedOperationException) at bucket_drops_screen_extension.main_menu.proxy$java.lang.Object$Screen$e6e56cf1/show (REPL:-1). show This is my code: (defn screen ...
user1785730's user avatar
  • 3,839
1 vote
1 answer
127 views

I'm learning syntax-case macro system. This is what I have so far: (define-syntax loop (lambda (x) (syntax-case x () [(_ (var val x ...) body) (with-syntax ([recur (datum->syntax ...
jcubic's user avatar
  • 67k
1 vote
1 answer
118 views

I'm trying to implement a REST API using Kit. My routes are defined as follows: (defn api-routes [_opts] ["/auth/login" {:post auth/login}] ["/auth/checked" {:get (wrap-auth ...
Patrick Bucher's user avatar
0 votes
2 answers
56 views

This is the java code I'm trying to implement in clojure: manager.load("data/mytexture.png", Texture.class); I've tried this: (.load "resources/bucket.png" (.class Texture)) ...
user1785730's user avatar
  • 3,839
1 vote
1 answer
114 views

I am trying to do a few things at once with a Clojure macro but it's not working. I want to either learn how to fix it or understand why it is impossible. I want to: Create a Java interface in ...
MonkeyWithDarts's user avatar
0 votes
2 answers
49 views

I'm trying to call a method of a java library: (.draw (:sprite-batch @resources) (:bucket @resources) 0.0 0.0 1.0 1.0) And get this error: Execution error (IllegalArgumentException) at bucket-drops....
user1785730's user avatar
  • 3,839
0 votes
1 answer
93 views

I have use care where I have to process several clojure projects and find the imports of java libraries in each clojure namespace I an invoking clj-kondo from my code for each .clj file as follows: (...
user193116's user avatar
  • 3,568
1 vote
1 answer
57 views

For example: (let [!a (ref 1 :validator odd?)] (dosync (alter !a (comp inc inc)) (let [!b (fork-ref !a)] (alter !b (comp inc))))) ;; should throw IllegalStateException Of course it's ...
Lēctia Landau's user avatar
0 votes
1 answer
134 views

I want my Clojure program to "look out at the world" through the camera. I found a Github project that does the work and is even written in Java. I got it to work using a 3-line piece of ...
LionelGoulet's user avatar
1 vote
2 answers
155 views

I'm trying to use https://github.com/metosin/malli?tab=readme-ov-file#malliexperimentaltime Here is what I have (ns foobar.core (:require [malli.core :as m] [malli.registry :as mr] ...
phtrivier's user avatar
  • 13.5k
0 votes
0 answers
39 views

From the documentation for some: Returns the first logical true value of (pred x) for any x in coll, else nil. One common idiom is to use a set as pred, for example this will return :fred if :fred ...
user1785730's user avatar
  • 3,839
0 votes
1 answer
64 views

Consider this code snippet: (defn foo [] (let [line (apply str (repeat 2 \.)) lines (into [] (repeat 2 line))] (for [x lines] (println x)) ; this doesn't print (loop [remaining [[1 2]...
user1785730's user avatar
  • 3,839
1 vote
1 answer
122 views

I'm using Heroku with the Papertrail add-on to manage my server logs. However, I'm not satisfied with Papertrail’s UI and would like to pull logs locally using their API. To do this, I'm writing a ...
Pedro Delfino's user avatar
3 votes
1 answer
102 views

An example probably explains it best. Why does the 2nd and 3rd examples work? Integer/MAX_VALUE => 2147483647 (Integer/MAX_VALUE) => 2147483647 ((((((Integer/MAX_VALUE)))))) ; wtf? => ...
rutchkiwi's user avatar
  • 584
1 vote
3 answers
160 views

I need an integer timestamp and want to circumvent the overhead of creating a Java Date object. Is there such a thing from Clojure? I want the datetime now in (long? double?) integer form, not ...
LionelGoulet's user avatar
0 votes
3 answers
107 views

This is my code: (defn calculate [operators operands] (loop [index 0 equation (get operands 0)] (if (< index (count operators)) (recur (inc index) (list (get operators index) (...
user1785730's user avatar
  • 3,839
1 vote
1 answer
82 views

I'm studying Datomic and I got stuck in Multiple Head Rules. In Datomic Documentation, it's said that a Multiple Head Rule is a rule that has multiple "heads" and each head has a different ...
LAZARO QUEIROZ DO NASCIMENTO's user avatar
1 vote
1 answer
76 views

Given this line of code: (filter #(is-valid? %) input) is-valid? is a somewhat heavy operation. input has a size of maybe a thousand. To speed things up I thought to run is-valid? in parallel: --> ...
user1785730's user avatar
  • 3,839

1
2 3 4 5
356