17,775 questions
Best practices
3 votes
1 replies
55 views
Event should update data structures
Consider this function: (defn check-collision [game] (let [ball (:ball game)] (let [result (collision/ball-collision? ball (:paddle game))] (when (:collision? result) (resolve-...
3 votes
1 answer
121 views
How to write an accumulative recursive function in J without looping
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 ...
1 vote
1 answer
87 views
How to type hint a float array?
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'...
1 vote
1 answer
84 views
Intellij & Clojure LSP - Getting Started
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 ...
0 votes
1 answer
57 views
How to include a file with shadow-cljs/inline, but preprocess it first?
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 ...
0 votes
0 answers
45 views
Error on invocation of reitit.swagger/create-swagger-handler
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 ...
1 vote
1 answer
97 views
Appending to a vector in a map, but referencing the map only once
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 ...
0 votes
1 answer
110 views
Clojure implementation about five times slower than Java implementation
This is the Java code: public static FloatBuffer createInterleavedVertexBuffer(AIMesh mesh) { FloatBuffer buffer = BufferUtils.createFloatBuffer(mesh.mNumVertices() * 8); for (int i = 0; i <...