r/Clojure • u/CoBPEZ • May 25 '25
A rich poor man's CSS hot reload
blog.agical.seA short post about the tiny amount of code needed for cooking my own Garden CSS watcher as a shadow-cljs hook.
r/Clojure • u/CoBPEZ • May 25 '25
A short post about the tiny amount of code needed for cooking my own Garden CSS watcher as a shadow-cljs hook.
r/Clojure • u/CoBPEZ • May 25 '25
It's qute exciting giving the AI agent access to my Clojure REPL. Giving it access to the REPL connected to my editor is a bit of next level. Very fun, but I also think it will prove to be very useful.
r/Clojure • u/bhauman • May 25 '25
This is own my personal "Claude Code" for working with Clojure, and now that Claude 4 is so darn competent it's time to release it.
It's super powers are the the REPL access and bang on Clojure editing that fixes paren errors and edits expressions and not text. So no whitespace and delimiter problems.
I currently use this with Claude Desktop and some "other" tools I'm using.
r/Clojure • • May 24 '25
When reading or listening about clojure, the keyword that comes up more often is data driven programming. However, it's clearly discussed much less over the internet than concepts like OOP, for which you can find explanations and courses in a way too high number of websites. So, how does one get started and familiar with the concepts and practices? I've also checked out the table of contents of clojure for the brave and true and it is not mentioned, at least not explicitly. Are there probably libraries or other open source projects that are particularly good to read to understand it?
EDIT: related questions:
r/Clojure • • May 23 '25
by starting a 10 day trial:
https://www.oreilly.com/library/view/functional-design-principles/9780138176518/
The book teaches Clojure for beginners and Robert C. Martin makes a good job explaining it so even not the smartest can understand.
No payment information required.
r/Clojure • u/smokeysilicon • May 22 '25
Hey I'm starting in a company that uses Clojure for backend and ClojureScript for frontend. I have never worked with functional programming languages before even though. I'm generally familiar with the concepts in functional programming. Not at all with the LISP syntax tho, but it's not terribly complicated from what I've seen. My background is full stack developer who started with Node.js project (React + Express), worked momentarily in Java + SpringBoot + React project, and lately working in Python (FastAPI) and Vue project. Total YOE 3 years. Now my questions is:
- How is it going to be like getting into Clojure for someone like me?
- The Clojure ecosystem is pretty niche and I feel esoteric. Is it going to be dead weight in my CV down the line?
- What learning resources would you recommend? I have been going through old post and have gathered some resources, but if you still want to suggest something new.
r/Clojure • u/eeemax • May 21 '25
Context: I'm writing a React component library that relies on TailwindCSS. In order for tailwind to work correctly, it needs to be aware of the css classes used in my react library. I'd also like to import a plugin file for that library in my tailwind.config.js.
The challenge is that I'd like to keep the version of the file used to calculate tailwind classes consistent with the version of the library imported in deps.edn.
Things I've considered:
- Export my CLJS library as an NPM module. Add the path from node_modules into my tailwind paths (I think this is the standard way for js libraries). The problem is that I think importing from NPM will make it so that clojure tooling (i.e. things like find-references) don't work correctly on the exported javascript.
- Look inside ~/.m2/repository and try to find the file. This seems brittle, and in the category of like ehhhhh idk
- Add a build step to my shadow edn that:
- looks up the current version of the library as defined in deps.edn
- downloads the source code if it's not present to a filepath in my repo
- link to the downloaded file path
right now option 3 seems like the best solution, but idk -- I'm hoping there's a nicer way to organize this with something like https://github.com/jacekschae/shadow-cljs-tailwindcss or like a more standardized kind of way to think about this stuff. Does anyone have thoughts on the right/a better way to do this?
r/Clojure • • May 22 '25
def twoSum(nums: list, target: int, i=0):
if len(nums) == i or nums[i] > target:
return []
if nums[i] == target:
return [i]
if nums[i] < target:
dont_take_current = twoSum(nums, target, i + 1)
if len(dont_take_current) > 0:
return dont_take_current
take_current = twoSum(nums, target - nums[i], i + 1)
if len(take_current) > 0:
return [i] + take_current
return []Given an array of integers nums and an integer target, return indices of the numbers such that they add up to target.
Constraints: the nums list contains no duplicates and is sorted, nums contains only positive numbers.
There might be a better solution, but you should take the same approach, i.e. brute force.
class MyTestCase(unittest.TestCase):
def test_something(self):
self.assertEqual([0, 1], twoSum([1, 2, 4], 3))
def test_something_else(self):
self.assertEqual([0], twoSum([0,3,4], 0))r/Clojure • u/dustingetz • May 20 '25
r/Clojure • u/andersmurphy • May 20 '25
Hope this is useful! It was a load of fun.