Clojure 1.12.0-alpha6 introduced method values to Clojure and this post will explore them in a bit more depth. The olden days Clojure functions are first-class values and can easily be passed around, but a common question seen in Clojure forums for years is how to map a static method (or instance method or constructor) over a collection. The idiomatic answer has been to wrap it in an anonymous…
In the spirit of the classic “How A Bill Becomes a Law” , I’d like to give some insight into how a Clojure question or JIRA ticket becomes a commit in the Clojure code . Users and contributors It’s important to start with the distinction between users and contributors of the language. The pool of users is large and many people happily use the language without needing to file a problem or a…
Certain tasks call for breaking up sequential data into segments to work on each segment. In Clojure, we often use functions like partition-all and partition to break sequential data (or code) into a lazy sequence of realized partitions that you can consume as needed. For example, a common use case in macros that parse syntax is to (partition 2 ...) over key-value pairs in binding or destructuring…
Last week we released a new version of the Clojure tools with support for directly executing a Clojure function that takes a map. There is one good example of this sort of program in Clojure itself - clojure.core.server/start-server , which can be used to start a socket server . Clojure users are probably most familiar with using the socket server to run a remote repl (but it can really be used to…
A new prerelease version of clj is now available (1.10.1.672) and it includes some important restructuring of how you use clj. This version has not yet been promoted to “stable” release. You can either install it explicitly with that version though: On Linux, use the instructions here but with 1.10.1.672. On Mac, use a versioned release : brew uninstall clojure brew install…
A new development version of clj is now available (1.10.1.600) and it includes the first public release of several strands of work that have been ongoing over the last few months (with more to come). This version has not yet been promoted to “stable” release. You can either install it explicitly with that version though: On Linux, use the instructions here but with 1.10.1.600. On Mac, use a…
February was here and gone in a flash it seems and it has been a blur of activity. I’ve written several interim posts, so I’m not going to go into a ton of detail, but I have a long list of things that have been in work: 1.0 libs Per the 1.0 post we decided to be a little more aggressive on our versioning in Clojure contrib libs and many commonly used contrib libs have now been updated to 1.0+. In…
I just published the results from the State of Clojure 2020 Survey , but I also wanted to post some thoughts on the open feedback section at the end. I read through all the responses there (about 645 responses from the 2500+ people that completed the survey). As usual, a large percentage (about 65%) were expressions of either thanks or general happiness, so thanks for those, they are fun to read…
I’ve been working on a write-up for the 2020 State of Clojure survey (sorry that’s taking so long). One feedback comment stuck with me: “A lot of libraries in the Clojure ecosystem (including in clojure.core) have version 0.y.z, indicating breaking changes could still be introduced. Yet some of these libraries have widespread adoption. The Clojure community emphasises the importance of backwards…
There was a question on Slack this evening about getting a similar effect to the injections feature of Leiningen in clj. There is no built-in feature for this, but you don’t really need one. The provided clojure.main/repl function is highly customizable. For example, it provides an :eval hook, which defaults to just the eval function. But that’s a great place to inject your own code around every…