# How to?

**URL:** https://clojureverse.org/c/questions-help/how-to/30.md

[Latest](https://clojureverse.org/latest.md) · [Categories](https://clojureverse.org/categories.md) · [Tags](https://clojureverse.org/tags.md)

---

## [About the How to? category](https://clojureverse.org/t/about-the-how-to-category/642)

<div class="topic-metadata">

**Author:** [@plexus](https://clojureverse.org/u/plexus)\
**Replies:** 0\
**Last updated:** [November 5, 2017, 4:12pm UTC](https://clojureverse.org/t/about-the-how-to-category/642 "2017-11-05T16:12:40Z")

</div>

The place for specific questions about how to perform a specific task how do I transform this nested vector? how can I deal with JSON? how can I loop through a collection? … Make sure the mark an accepted answer as su…

---

## [Knocking over Scittle with audio recordings](https://clojureverse.org/t/knocking-over-scittle-with-audio-recordings/14708)

<div class="topic-metadata">

**Author:** [@simon-brooke](https://clojureverse.org/u/simon-brooke)\
**Replies:** 6\
**Last updated:** [September 29, 2025, 4:43pm UTC](https://clojureverse.org/t/knocking-over-scittle-with-audio-recordings/14708 "2025-09-29T16:43:19Z")

</div>

Hi all, I’ve been writing Clojure as my main language since 2013, so I’m hardly a newbie. But I’m just diving into Michiel Borkent’s Scittle (which is great fun by the way), and I’m hitting problems with interoperation …

---

## [String operations without losing line numbers](https://clojureverse.org/t/string-operations-without-losing-line-numbers/11202)

<div class="topic-metadata">

**Author:** [@habruening](https://clojureverse.org/u/habruening)\
**Replies:** 2\
**Last updated:** [February 8, 2025, 9:49pm UTC](https://clojureverse.org/t/string-operations-without-losing-line-numbers/11202 "2025-02-08T21:49:46Z")

</div>

Since long I have one problem when writing parsers. If you create a substring, you loose the track to the original string. But it is often required to know where in a file you are. For example if you want to produce err…

---

## [Protocols: state, and default implementations](https://clojureverse.org/t/protocols-state-and-default-implementations/11512)

<div class="topic-metadata">

**Author:** [@alex314159](https://clojureverse.org/u/alex314159)\
**Replies:** 4\
**Last updated:** [July 27, 2025, 9:13pm UTC](https://clojureverse.org/t/protocols-state-and-default-implementations/11512 "2025-07-27T21:13:46Z")

</div>

Hello there. I find myself needing some state management, which I currently do with a global atom, but it feels messy. I was thinking about putting state inside a record, OO style. Is this an anti-pattern? What could go …

---

## [In Helix, React: an example of using the use-ref hook with a callback?](https://clojureverse.org/t/in-helix-react-an-example-of-using-the-use-ref-hook-with-a-callback/11478)

<div class="topic-metadata">

**Author:** [@rmschindler](https://clojureverse.org/u/rmschindler)\
**Replies:** 1\
**Last updated:** [July 11, 2025, 6:09am UTC](https://clojureverse.org/t/in-helix-react-an-example-of-using-the-use-ref-hook-with-a-callback/11478 "2025-07-11T06:09:53Z")

</div>

hi, perhaps this is something new with React 19, but I see that a “ref” can be a callback function . (see “How to manage a list of refs using a ref callback” in the React docs) can anyone point me to an example of this…

---

## [How to disable the ability to launch a socket server?](https://clojureverse.org/t/how-to-disable-the-ability-to-launch-a-socket-server/11427)

<div class="topic-metadata">

**Author:** [@purple.ink](https://clojureverse.org/u/purple.ink)\
**Replies:** 2\
**Last updated:** [May 25, 2025, 3:32pm UTC](https://clojureverse.org/t/how-to-disable-the-ability-to-launch-a-socket-server/11427 "2025-05-25T15:32:04Z")

</div>

https://clojure.org/reference/repl\_and\_main#\_launching\_a\_socket\_server Hello, I’ve been working on a game using Clojure, and now I’d like to share it with some players. However, I’m not comfortable with shipping it wit…

---

## [Lein ancient for depn.edn](https://clojureverse.org/t/lein-ancient-for-depn-edn/11249)

<div class="topic-metadata">

**Author:** [@Webdev\_Tory](https://clojureverse.org/u/Webdev_Tory)\
**Replies:** 2\
**Last updated:** [March 12, 2025, 9:28pm UTC](https://clojureverse.org/t/lein-ancient-for-depn-edn/11249 "2025-03-12T21:28:31Z")

</div>

I find lein ancient (GitHub - xsc/lein-ancient: Check your Projects for outdated Dependencies | Moved to Codeberg ) to be very useful to check all my dependency versions, especially on old projects. I just dusted off a p…

---

## [How to close the "ESTABLISHED" connection by aleph?](https://clojureverse.org/t/how-to-close-the-established-connection-by-aleph/11052)

<div class="topic-metadata">

**Author:** [@ninesolaries](https://clojureverse.org/u/ninesolaries)\
**Replies:** 1\
**Last updated:** [December 6, 2024, 1:56pm UTC](https://clojureverse.org/t/how-to-close-the-established-connection-by-aleph/11052 "2024-12-06T13:56:51Z")

</div>

I followed the example of tcp, but close the connection by sever when response is successful. (defn short-connection-echo-handler \[f\] (fn \[s info\] (println "show sink:" s) ;; take a message, and define a de…

---

## [How should I rewrite a js script in ClojureScript?](https://clojureverse.org/t/how-should-i-rewrite-a-js-script-in-clojurescript/11041)

<div class="topic-metadata">

**Author:** [@Webdev\_Tory](https://clojureverse.org/u/Webdev_Tory)\
**Replies:** 2\
**Last updated:** [November 24, 2024, 9:14am UTC](https://clojureverse.org/t/how-should-i-rewrite-a-js-script-in-clojurescript/11041 "2024-11-24T09:14:16Z")

</div>

I am trying to rewrite a js script in Clojurescript. The JS script is GitHub - jeb5/YouTube-Subscriptions-RSS: Generate an OPML file of RSS feeds for your YouTube subscriptions. Ideally it can be pasted into the browse…

---

## [Windows install options for clojure-tools - which way?](https://clojureverse.org/t/windows-install-options-for-clojure-tools-which-way/10947)

<div class="topic-metadata">

**Author:** [@gurban](https://clojureverse.org/u/gurban)\
**Replies:** 3\
**Last updated:** [October 22, 2024, 5:09am UTC](https://clojureverse.org/t/windows-install-options-for-clojure-tools-which-way/10947 "2024-10-22T05:09:37Z")

</div>

Hello Community, I’m quit new to Clojure and curious about the question, what would be the ‘right’ or preferred way to install clojure-tools (aka clojure and clj commands) on Windows? Kindly awaiting pointers, suggesti…

---

## [Set file and line-number information in stack trace entries](https://clojureverse.org/t/set-file-and-line-number-information-in-stack-trace-entries/10949)

<div class="topic-metadata">

**Author:** [@moon](https://clojureverse.org/u/moon)\
**Replies:** 0\
**Last updated:** [September 26, 2024, 5:46am UTC](https://clojureverse.org/t/set-file-and-line-number-information-in-stack-trace-entries/10949 "2024-09-26T05:46:01Z")

</div>

Clojure has some beautiful stack trace output, to be sure, but there is a missing piece I’m wondering if someone can help with. I am (very very slowly) working on a templating system called Ash Ra Template; compiler erro…

---

## [Make a web or webapp in 2024 with Clojure and Clojurescript](https://clojureverse.org/t/make-a-web-or-webapp-in-2024-with-clojure-and-clojurescript/10529)

<div class="topic-metadata">

**Author:** [@maxxcan](https://clojureverse.org/u/maxxcan)\
**Replies:** 14\
**Last updated:** [July 22, 2024, 10:32pm UTC](https://clojureverse.org/t/make-a-web-or-webapp-in-2024-with-clojure-and-clojurescript/10529 "2024-07-22T22:32:41Z")

</div>

Hello everyone and thanks for your time. I have had a lot of time without using Clojure. But, my company is asking me to make a small web or webapp that uses to a sqlite database. I want to make it using Clojure or Cloj…

---

## [How to use FFMpeg's FFProbe without resorting to shell/string calls?](https://clojureverse.org/t/how-to-use-ffmpegs-ffprobe-without-resorting-to-shell-string-calls/10562)

<div class="topic-metadata">

**Author:** [@Webdev\_Tory](https://clojureverse.org/u/Webdev_Tory)\
**Replies:** 8\
**Last updated:** [June 25, 2024, 6:00am UTC](https://clojureverse.org/t/how-to-use-ffmpegs-ffprobe-without-resorting-to-shell-string-calls/10562 "2024-06-25T06:00:20Z")

</div>

I have an ffprobe line of code. I could just work the strings and do a command-line ssh to pull it off, but… strings, reusability, extensibility, maintainability, brittleness… I am new to ffprobe (and ffmpeg in general)…

---

## [Please help me pprint code docstrings](https://clojureverse.org/t/please-help-me-pprint-code-docstrings/10786)

<div class="topic-metadata">

**Author:** [@timothypratley](https://clojureverse.org/u/timothypratley)\
**Replies:** 5\
**Last updated:** [June 20, 2024, 8:33pm UTC](https://clojureverse.org/t/please-help-me-pprint-code-docstrings/10786 "2024-06-20T20:33:52Z")

</div>

Hi! I’m printing some code and this is the best I could come up with: (defn pprint-str \[x\] (-\> (pprint/pprint x) (-\>\> (pprint/with-pprint-dispatch pprint/code-dispatch)) (with-out-str) (str/replace …

---

## [Design question... log message callback](https://clojureverse.org/t/design-question-log-message-callback/10748)

<div class="topic-metadata">

**Author:** [@ejstembler](https://clojureverse.org/u/ejstembler)\
**Replies:** 7\
**Last updated:** [May 30, 2024, 3:33pm UTC](https://clojureverse.org/t/design-question-log-message-callback/10748 "2024-05-30T15:33:13Z")

</div>

Over the past several years, I’ve adopted a log message callback strategy in most of my software. My idea is that I don’t want to pollute my library code with logging details or dependencies. So I implement a callback w…

---

## [Cursive repl clj/cljs custom configuration](https://clojureverse.org/t/cursive-repl-clj-cljs-custom-configuration/10723)

<div class="topic-metadata">

**Author:** [@cobrahere](https://clojureverse.org/u/cobrahere)\
**Replies:** 0\
**Last updated:** [May 7, 2024, 6:28am UTC](https://clojureverse.org/t/cursive-repl-clj-cljs-custom-configuration/10723 "2024-05-07T06:28:35Z")

</div>

Hi, Just wondering if we can configure the clj/cljs dropdown in cursive repl in intelliJ to use custom port when cljs is selected? Currently, I have to open a new server repl to connect to my shadow-cljs nrepl to ev…

---

## [Continously calculate and deliver data it with ring](https://clojureverse.org/t/continously-calculate-and-deliver-data-it-with-ring/10711)

<div class="topic-metadata">

**Author:** [@habruening](https://clojureverse.org/u/habruening)\
**Replies:** 4\
**Last updated:** [April 30, 2024, 5:26pm UTC](https://clojureverse.org/t/continously-calculate-and-deliver-data-it-with-ring/10711 "2024-04-30T17:26:18Z")

</div>

I have these few lines of code that creates a lazy list of numbers and sends them out over http with ring. (defn lines (\[\] (lines 1)) (\[n\] (lazy-seq (cons (str n "\\n") (do (Thread/sleep 1000) …

---

## [How to stream Safari-compatible video?](https://clojureverse.org/t/how-to-stream-safari-compatible-video/10643)

<div class="topic-metadata">

**Author:** [@Webdev\_Tory](https://clojureverse.org/u/Webdev_Tory)\
**Replies:** 15\
**Last updated:** [April 18, 2024, 12:15pm UTC](https://clojureverse.org/t/how-to-stream-safari-compatible-video/10643 "2024-04-18T12:15:02Z")

</div>

We have a well-used app that streams certain videos. They are streamed as partial content. The backend for this system is in Clojure, using Reitit with the Ring approach. However, while they work great in Firefox and Chr…

---

## [Roundtrip of XML data](https://clojureverse.org/t/roundtrip-of-xml-data/10666)

<div class="topic-metadata">

**Author:** [@habruening](https://clojureverse.org/u/habruening)\
**Replies:** 4\
**Last updated:** [April 7, 2024, 4:48pm UTC](https://clojureverse.org/t/roundtrip-of-xml-data/10666 "2024-04-07T16:48:04Z")

</div>

I have problems creating XML files with apostrophs in attributes. (let \[input (java.io.ByteArrayInputStream. (.getBytes "\<?xml version=\\"1.0\\" encoding=\\"UTF-8\\"?\> \<foo x=\\"x'y\\"\>\</…

---

## [Trying to translate into logic expression into core.logic](https://clojureverse.org/t/trying-to-translate-into-logic-expression-into-core-logic/10629)

<div class="topic-metadata">

**Author:** [@Henrik\_Larsson](https://clojureverse.org/u/Henrik_Larsson)\
**Replies:** 3\
**Last updated:** [March 30, 2024, 3:06pm UTC](https://clojureverse.org/t/trying-to-translate-into-logic-expression-into-core-logic/10629 "2024-03-30T15:06:12Z")

</div>

I trying my hand at core.logic which has always interested me but it has a steep learning curve. The domain I am mostly interested in is constraint satisfaction problems. For example if I have the following function, how…

---

## [Reloading core.async without derailing legacy threads/goroutines running on the legacy threadpool](https://clojureverse.org/t/reloading-core-async-without-derailing-legacy-threads-goroutines-running-on-the-legacy-threadpool/10615)

<div class="topic-metadata">

**Author:** [@joinr](https://clojureverse.org/u/joinr)\
**Replies:** 4\
**Last updated:** [March 8, 2024, 1:26pm UTC](https://clojureverse.org/t/reloading-core-async-without-derailing-legacy-threads-goroutines-running-on-the-legacy-threadpool/10615 "2024-03-08T13:26:00Z")

</div>

Say I have this ns: (ns blah (:require \[clojure.core.async :as async\])) (def log-chan (async/chan (async/sliding-buffer 1000))) (def logger (async/go-loop \[\] (when-let \[msg (async/\<! log-chan)\] (do (p…

---

## [Out of step sequence processing](https://clojureverse.org/t/out-of-step-sequence-processing/10587)

<div class="topic-metadata">

**Author:** [@andersmurphy](https://clojureverse.org/u/andersmurphy)\
**Replies:** 4\
**Last updated:** [February 23, 2024, 2:57pm UTC](https://clojureverse.org/t/out-of-step-sequence-processing/10587 "2024-02-23T14:57:48Z")

</div>

So I have function a that takes roughly 10 seconds and a function b that takes roughly 10 seconds. b takes the result of function b so (-\> a b). In total they take roughly 20 seconds to run. These function are called r…

---

## [Optimize the AST from Instaparse](https://clojureverse.org/t/optimize-the-ast-from-instaparse/10594)

<div class="topic-metadata">

**Author:** [@Henrik\_Larsson](https://clojureverse.org/u/Henrik_Larsson)\
**Replies:** 6\
**Last updated:** [February 22, 2024, 10:09pm UTC](https://clojureverse.org/t/optimize-the-ast-from-instaparse/10594 "2024-02-22T22:09:11Z")

</div>

After creating an operator-precedence parser using Instapare I have arrived at an AST that has alot of potential for optimization. Below are 3 examples. Given "((a|b)|(c&d))" AST is produced \[:or\_expr \[:and\_expr \[:…

---

## [The Majestic Monolith, how would you perform a release of a new version?](https://clojureverse.org/t/the-majestic-monolith-how-would-you-perform-a-release-of-a-new-version/10557)

<div class="topic-metadata">

**Author:** [@maxweber](https://clojureverse.org/u/maxweber)\
**Replies:** 6\
**Last updated:** [January 31, 2024, 5:39pm UTC](https://clojureverse.org/t/the-majestic-monolith-how-would-you-perform-a-release-of-a-new-version/10557 "2024-01-31T17:39:45Z")

</div>

I would like to move our system in this direction: If you only have one big server, how would you perform a release of a new version? The most straightforward way would be to accept a few seconds of downtime, which w…

---

## [Are multimethods appropriate for this? Human Friendly API](https://clojureverse.org/t/are-multimethods-appropriate-for-this-human-friendly-api/10542)

<div class="topic-metadata">

**Author:** [@habruening](https://clojureverse.org/u/habruening)\
**Replies:** 2\
**Last updated:** [January 26, 2024, 2:21am UTC](https://clojureverse.org/t/are-multimethods-appropriate-for-this-human-friendly-api/10542 "2024-01-26T02:21:59Z")

</div>

I use multimethods for something like a human friendly API. I have the example below. You don’t have to read it. I explain it. The example has a multimethod answer-what-is-the, that is able to find the answers for vari…

---

## [How to develop Clojure without Cider?](https://clojureverse.org/t/how-to-develop-clojure-without-cider/10397)

<div class="topic-metadata">

**Author:** [@Webdev\_Tory](https://clojureverse.org/u/Webdev_Tory)\
**Replies:** 20\
**Last updated:** [November 15, 2023, 12:26am UTC](https://clojureverse.org/t/how-to-develop-clojure-without-cider/10397 "2023-11-15T00:26:39Z")

</div>

I read people who mention using emacs to develop Clojure but without using Cider. Now, I love Cider, but the updates are killing me. Be that as it may, how is it even possible to have a REPL-driven workflow in emacs with…

---

## [Full-stack ClojureScript unit etc. testing?](https://clojureverse.org/t/full-stack-clojurescript-unit-etc-testing/10415)

<div class="topic-metadata">

**Author:** [@Webdev\_Tory](https://clojureverse.org/u/Webdev_Tory)\
**Replies:** 0\
**Last updated:** [November 14, 2023, 11:33pm UTC](https://clojureverse.org/t/full-stack-clojurescript-unit-etc-testing/10415 "2023-11-14T23:33:06Z")

</div>

We usually write full-stack Clojure apps, and for these our editor (Cider) powered testing is invaluable for TDD. We write tests and then write code to make those tests pass, quickly hopping from code to test and rerunni…

---

## [React Portals with Helix](https://clojureverse.org/t/react-portals-with-helix/10382)

<div class="topic-metadata">

**Author:** [@rmschindler](https://clojureverse.org/u/rmschindler)\
**Replies:** 0\
**Last updated:** [October 24, 2023, 11:56pm UTC](https://clojureverse.org/t/react-portals-with-helix/10382 "2023-10-24T23:56:57Z")

</div>

I’m just about to attempt to figure out how to use React Portals (Cf createPortal) in a Helix project. I haven’t found any mention of it in the Helix repo. If anybody has any pointers (say, to documentation), it would be…

---

## [Any chance to workaround the unicode variable issue with Google closure](https://clojureverse.org/t/any-chance-to-workaround-the-unicode-variable-issue-with-google-closure/10358)

<div class="topic-metadata">

**Author:** [@sunng87](https://clojureverse.org/u/sunng87)\
**Replies:** 3\
**Last updated:** [October 7, 2023, 9:11am UTC](https://clojureverse.org/t/any-chance-to-workaround-the-unicode-variable-issue-with-google-closure/10358 "2023-10-07T09:11:20Z")

</div>

Google closure library has issue with unicode variable name: Parser error on "combining character" (U+0307) · Issue #3639 · google/closure-compiler · GitHub and it doesn’t seem to be able to fix in a short while. If you…

---

## [Clojure general performance profiling 2023?](https://clojureverse.org/t/clojure-general-performance-profiling-2023/10344)

<div class="topic-metadata">

**Author:** [@Webdev\_Tory](https://clojureverse.org/u/Webdev_Tory)\
**Replies:** 5\
**Last updated:** [September 28, 2023, 6:33pm UTC](https://clojureverse.org/t/clojure-general-performance-profiling-2023/10344 "2023-09-28T18:33:21Z")

</div>

I have an app that might be performing poorly in our production environment. I want to take a look-see at if there are any red alerts for performance (e.g. any chokepoints). I don’t see any leads in the Clojure Toolbox. …

[Next page](https://clojureverse.org/c/questions-help/how-to/30.md?page=1)
