I'm essentially looking for the Clojure version of Java's import static
. I understand that this is usually bad practice, but I'm working with LWJGL which has a lot of static methods like GLFW/glfwSetWindowPos
and GLFW/glfwMakeContextCurrent
, where the namespacing is part of the method name (due to being a thin wrapper around a C library). I find the repetition adds a lot of visual noise that makes the code harder to read, especially when doubly-namespaced functions take doubly-namespaced arguments like in
(GL15/glCreateShader GL15/GL_VERTEX_SHADER)
I found https://clojure.github.io/clojure-contrib/import-static-api.html, but seeing as clojure.contrib is deprecated, I'd prefer not to depend on it.