<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Tweet on Ken Huang</title>
    <link>https://blog.kenhuang.io/tags/tweet/</link>
    <description>Recent content in Tweet on Ken Huang</description>
    <generator>Hugo</generator>
    <language>en</language>
    <managingEditor>whatacold@gmail.com (Ken Huang)</managingEditor>
    <webMaster>whatacold@gmail.com (Ken Huang)</webMaster>
    <lastBuildDate>Sat, 17 May 2025 05:15:47 +0800</lastBuildDate>
    <atom:link href="https://blog.kenhuang.io/tags/tweet/rss.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>🥷 Clojure Pro Tip 5: Hiccup Raw</title>
      <link>https://blog.kenhuang.io/blog/2025-05-15-clojure-tip-hiccup-raw/</link>
      <pubDate>Thu, 15 May 2025 12:49:27 +0800</pubDate><author>whatacold@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2025-05-15-clojure-tip-hiccup-raw/</guid>
      <description>&lt;p&gt;&#xA;In case you don’t know it, we can use raw strings, like embedding JS code, in hiccup.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;I just found out we can use &lt;a href=&#34;https://weavejester.github.io/hiccup/hiccup2.core.html#var-raw&#34;&gt;raw&lt;/a&gt; to prevent strings from getting escaped. I used to have to define a dedicated app.js for that, which would need an extra HTTP request.&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;https://blog.kenhuang.io/img/clojure-hiccup-raw.jpg&#34; alt=&#34;Hiccup raw in action&#34; title=&#34;Click to enlarge the image&#34;/&gt;&#xA;&lt;figcaption&gt;&#xA;Hiccup raw in action&#xA;&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;&#xA;Looking back, I should’ve found this at the very beginning, as it’s just mentioned on &lt;a href=&#34;https://github.com/weavejester/hiccup&#34;&gt;its GitHub homepage&lt;/a&gt;, but somehow I missed it.&lt;/p&gt;</description>
    </item>
    <item>
      <title>🥷 Clojure Pro Tip 4: Cider ClojureDocs</title>
      <link>https://blog.kenhuang.io/blog/2025-04-29-clojure-tip-cider-clojuredocs/</link>
      <pubDate>Tue, 29 Apr 2025 12:49:27 +0800</pubDate><author>whatacold@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2025-04-29-clojure-tip-cider-clojuredocs/</guid>
      <description>&lt;p&gt;&#xA;Sometimes, we may want a few examples of a Clojure API for inspiration while developing, especially when reading other people&amp;#39;s or open source code.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;With &lt;a href=&#34;https://cider.mx/&#34;&gt;Cider&lt;/a&gt; in &lt;a href=&#34;https://www.gnu.org/software/emacs/&#34;&gt;Emacs&lt;/a&gt;, we can run &lt;code class=&#34;verbatim&#34;&gt;M-x cider-doc&lt;/code&gt; to see the docstring for the symbol. We can even use &lt;code class=&#34;verbatim&#34;&gt;M-x cider-clojuredocs&lt;/code&gt; for some examples if the symbol is from the language core.&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;https://blog.kenhuang.io/img/clojure-cider-clojuredocs.jpg&#34; alt=&#34;Running M-x cider-clojuredocs&#34; title=&#34;Click to enlarge the image&#34;/&gt;&#xA;&lt;figcaption&gt;&#xA;Running M-x cider-clojuredocs&#xA;&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;&#xA;I happened to find this command recently. I bet I was not the only one who didn&amp;#39;t know it, thus I&amp;#39;m sharing.&lt;/p&gt;</description>
    </item>
    <item>
      <title>🥷 Clojure Pro Tip 3: the Thread-As Macro</title>
      <link>https://blog.kenhuang.io/blog/2025-04-23-clojure-tip-thread-as/</link>
      <pubDate>Wed, 23 Apr 2025 12:49:27 +0800</pubDate><author>whatacold@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2025-04-23-clojure-tip-thread-as/</guid>
      <description>&lt;p&gt;&#xA;So you&amp;#39;re more than excited to find out how Clojure&amp;#39;s thread macros can make code clean and concise, you just love it! But at some point you&amp;#39;ll be trapped a bit as the threaded argument&amp;#39;s positions are inconsistent using &lt;a href=&#34;https://clojuredocs.org/clojure_core/clojure.core/-%3E&#34;&gt;-&amp;gt;&lt;/a&gt; or &lt;a href=&#34;https://clojuredocs.org/clojure_core/clojure.core/-%3E%3E&#34;&gt;-&amp;gt;&amp;gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;Luckily, you can use &lt;a href=&#34;https://clojuredocs.org/clojure_core/clojure.core/as-%3E&#34;&gt;as-&amp;gt;&lt;/a&gt; to place the argument wherever you like:&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;https://blog.kenhuang.io/img/clojure-thread-as.jpg&#34; alt=&#34;Lambda vs. thread-as&#34; title=&#34;Click to enlarge the image&#34;/&gt;&#xA;&lt;figcaption&gt;&#xA;Lambda vs. thread-as&#xA;&lt;/figcaption&gt;&#xA;&lt;/figure&gt;</description>
    </item>
    <item>
      <title>🥷 Clojure Pro Tip 2: group-by</title>
      <link>https://blog.kenhuang.io/blog/2025-04-18-clojure-group-by/</link>
      <pubDate>Fri, 18 Apr 2025 12:49:27 +0800</pubDate><author>whatacold@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2025-04-18-clojure-group-by/</guid>
      <description>&lt;p&gt;&#xA;It&amp;#39;s amazingly easy to group things in Clojure. The language core provides a &lt;a href=&#34;https://clojuredocs.org/clojure_core/clojure.core/group-by&#34;&gt;group-by&lt;/a&gt; function directly. Together with many built-in functions or key functions, it creates a ton of possibilities, and we can also bake our grouping function if none is satisfying.&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;https://blog.kenhuang.io/img/clojure-group-by.jpg&#34; alt=&#34;group-by&#34; title=&#34;Click to enlarge the image&#34;/&gt;&#xA;&lt;figcaption&gt;&#xA;group-by&#xA;&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;&#xA;Example from &lt;a href=&#34;https://github.com/functional-koans/clojure-koans&#34;&gt;Clojure Koans&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Collecting Events to Google Analytics using ClojureScript</title>
      <link>https://blog.kenhuang.io/blog/2025-04-11-google-analytics-clojurescript/</link>
      <pubDate>Fri, 11 Apr 2025 22:49:27 +0800</pubDate><author>whatacold@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2025-04-11-google-analytics-clojurescript/</guid>
      <description>&lt;p&gt;&#xA;When you’re building a side project, chances are you need to collect user events so that you can understand user behaviors better and eventually improve your product.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;So recently I made a small ClojureScript library for that, it supports web apps or chrome extensions.&#xA;Check it out at &lt;a href=&#34;https://github.com/whatacold/google-analytics,&#34;&gt;https://github.com/whatacold/google-analytics,&lt;/a&gt; it also contains a &lt;a href=&#34;https://github.com/whatacold/google-analytics/tree/master/demo&#34;&gt;demo project&lt;/a&gt; using &lt;a href=&#34;https://shadow-cljs.github.io/docs/UsersGuide.html&#34;&gt;shadow-cljs&lt;/a&gt; as the build tool.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;Hope it helps, and give it a star ⭐ on GitHub and share it if it does, thanks!&lt;/p&gt;</description>
    </item>
    <item>
      <title>🥷 Clojure Pro Tip 1: the Discard Reader Symbol</title>
      <link>https://blog.kenhuang.io/blog/2025-04-05-clojure-tip-discard-reader-symbol/</link>
      <pubDate>Sat, 05 Apr 2025 12:49:27 +0800</pubDate><author>whatacold@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2025-04-05-clojure-tip-discard-reader-symbol/</guid>
      <description>&lt;p&gt;&#xA;In Clojure, we can use &lt;a href=&#34;https://clojuredocs.org/clojure.core/comment&#34;&gt;comment&lt;/a&gt; (aka Rich Comment Blocks) for tests or experiments in development. However, since a comment evaluates to nil, you may run into surprising results or even errors if you misuse it.&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;https://blog.kenhuang.io/img/clojure-discard-reader-symbol.jpg&#34; alt=&#34;Comment vs. Discard&#34; title=&#34;Click to enlarge the image&#34;/&gt;&#xA;&lt;figcaption&gt;&#xA;Comment vs. Discard&#xA;&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;&#xA;In these scenarios, you may tend to use &lt;code class=&#34;verbatim&#34;&gt;;&lt;/code&gt; to comment them out, but a better choice is to use the &lt;a href=&#34;https://clojure.org/guides/weird_characters#_discard&#34;&gt;discard reader symbol &lt;code class=&#34;verbatim&#34;&gt;#_&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Constructing Clojure Maps Conditionally</title>
      <link>https://blog.kenhuang.io/blog/2025-01-05-construct-a-map-clojure/</link>
      <pubDate>Sun, 05 Jan 2025 10:40:07 +0800</pubDate><author>whatacold@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2025-01-05-construct-a-map-clojure/</guid>
      <description>&lt;p&gt;&#xA;I was wondering how to construct a multi-key map conditionally while I was coding in Clojure. Ideally, I would like to build it &amp;#34;in one pass&amp;#34; like &lt;code class=&#34;verbatim&#34;&gt;{:bar 2 (when true :baz 3)}&lt;/code&gt;, but from what I had collected from Blue Sky, it seemed that&amp;#39;s impossible, or it&amp;#39;s just not an idiomatic way to program like that in Clojure. (Or, is this just a side effect of writing too much imperative code?)&lt;/p&gt;</description>
    </item>
    <item>
      <title>A Few Quick Notes About babashka/fs</title>
      <link>https://blog.kenhuang.io/blog/2024-12-07-babashka-fs-notes/</link>
      <pubDate>Sat, 07 Dec 2024 22:24:41 +0800</pubDate><author>whatacold@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2024-12-07-babashka-fs-notes/</guid>
      <description>&lt;p&gt;&#xA;Recently I&amp;#39;ve used &lt;a href=&#34;https://github.com/babashka/fs/blob/master/API.md&#34;&gt;babashka/fs&lt;/a&gt; a little bit, here are some quick notes for it:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Path vs File.&#xA;&#xA;Use Path whenever possible, according to &lt;a href=&#34;https://stackoverflow.com/a/26658436&#34;&gt;this SO answer to &amp;#34;Java: Path vs File&amp;#34;&lt;/a&gt;.&#xA;&#xA;This is actually Java related.&lt;/li&gt;&#xA;&lt;li&gt;It&amp;#39;s ok to use a &lt;code class=&#34;verbatim&#34;&gt;path&lt;/code&gt; as a key for a clojure map.&#xA;&#xA;At my first try, I somehow came to the conclusion that it&amp;#39;s not ok, while I was refactoring the &lt;a href=&#34;https://github.com/scicloj/clay/blob/main/src/scicloj/clay/v2/live_reload.clj&#34;&gt;live reload&lt;/a&gt; for clay. And later I found that it&amp;#39;s totally fine to use it as a key. 😞&lt;/li&gt;&#xA;&lt;li&gt;Use &lt;a href=&#34;https://github.com/babashka/fs/blob/master/API.md#babashka.fs/path&#34;&gt;fs/path&lt;/a&gt; to construct file/directory paths, for example, &lt;code class=&#34;verbatim&#34;&gt;(fs/path &amp;#34;/tmp&amp;#34; &amp;#34;foo&amp;#34; &amp;#34;bar&amp;#34; &amp;#34;baz.clj&amp;#34;)&lt;/code&gt; will result in a path object for &lt;code class=&#34;verbatim&#34;&gt;/tmp/foo/bar/baz.clj&lt;/code&gt; on linux.&#xA;&#xA;If you&amp;#39;re coming from Python, it might remind you of &lt;a href=&#34;https://docs.python.org/3/library/os.path.html&#34;&gt;os.path.join(path, *paths)&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Use &lt;code class=&#34;verbatim&#34;&gt;fs/createdirs&lt;/code&gt; for &lt;code class=&#34;verbatim&#34;&gt;mkdir -p&lt;/code&gt;, though its name is a bit misleading, I first thought it&amp;#39;s for creating a few dirs.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code class=&#34;verbatim&#34;&gt;fs/with-temp-dir&lt;/code&gt; is convenient for &lt;a href=&#34;https://github.com/scicloj/clay/blob/main/test/scicloj/clay/v2/live_reload_test.clj&#34;&gt;creating tests&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;</description>
    </item>
    <item>
      <title>Doing Unit test in Clojure Is Easy</title>
      <link>https://blog.kenhuang.io/blog/2024-11-27-clojure-unit-test/</link>
      <pubDate>Thu, 28 Nov 2024 23:10:56 +0800</pubDate><author>whatacold@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2024-11-27-clojure-unit-test/</guid>
      <description>&lt;p&gt;&#xA;While refactoring the &lt;a href=&#34;https://github.com/scicloj/clay/blob/main/src/scicloj/clay/v2/live_reload.clj&#34;&gt;live reload&lt;/a&gt; feature of &lt;a href=&#34;https://github.com/scicloj/clay&#34;&gt;Clay&lt;/a&gt;, I realized I&amp;#39;d better break long functions into smaller and functional ones (as many as I can), which is also a &lt;a href=&#34;https://guide.clojure.style/#be-functional&#34;&gt;common practice&lt;/a&gt; in the clojure community.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;Small pure functions not only are easy to verify on the development process (using a REPL), but also are easy to test. And unit tests are easy to write in clojure, just use &lt;code class=&#34;verbatim&#34;&gt;deftest&lt;/code&gt; from &lt;code class=&#34;verbatim&#34;&gt;clojure.test&lt;/code&gt;, a very basic one looks like this:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Adding Clojure Dependencies from the Command Line</title>
      <link>https://blog.kenhuang.io/blog/2024-11-09-clj-deps-cmdline/</link>
      <pubDate>Sat, 09 Nov 2024 21:02:56 +0800</pubDate><author>whatacold@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2024-11-09-clj-deps-cmdline/</guid>
      <description>&lt;p&gt;&#xA;While debugging a &lt;a href=&#34;https://github.com/scicloj/clay/issues/176&#34;&gt;live reload issue&lt;/a&gt; of Clay a few days ago, I learned from &lt;a href=&#34;https://github.com/kloimhardt&#34;&gt;Markus Agwin&lt;/a&gt; that we can actually add dependencies on the fly from the command line, just like this: &lt;code class=&#34;verbatim&#34;&gt;clj -Sdeps &amp;#34;{:deps {org.scicloj/clay {:mvn/version \&amp;#34;2-beta21\&amp;#34;}}}&amp;#34;&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;Even better, we can add dependency from a Git repo and specify the commit hash: &lt;code class=&#34;verbatim&#34;&gt;clj -Sdeps &amp;#34;{:deps {io.github.scicloj/clay {:git/url \&amp;#34;https://github.com/scicloj/clay.git\&amp;#34; :git/sha \&amp;#34;35a46541db66ae6b4e1af628b7c24c42d3be418f\&amp;#34;}}}&amp;#34;&lt;/code&gt;, which is really helpful for experimenting and verifying things.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;Some clj links (&lt;code class=&#34;verbatim&#34;&gt;clj --help&lt;/code&gt; has a pointer for these URLs):&lt;/p&gt;</description>
    </item>
    <item>
      <title>Bitten by Lazy Sequence of map</title>
      <link>https://blog.kenhuang.io/blog/2024-11-10-clojure-lazy-seq-case/</link>
      <pubDate>Sat, 09 Nov 2024 21:02:56 +0800</pubDate><author>whatacold@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2024-11-10-clojure-lazy-seq-case/</guid>
      <description>&lt;p&gt;&#xA;While impletenting the live reload feature for &lt;a href=&#34;https://github.com/scicloj/clay&#34;&gt;Clay&lt;/a&gt; a few weeks ago, unfortunately, I was bitten by the laziness of &lt;a href=&#34;https://clojuredocs.org/clojure.core/map&#34;&gt;map&lt;/a&gt;. It seems quite obvious we all know that its result is a lazy sequence, but I just can&amp;#39;t help fall into the &amp;#34;trap&amp;#34;.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;At that time I was adding a vector to keep track of all &lt;a href=&#34;https://github.com/nextjournal/beholder&#34;&gt;beholder&lt;/a&gt; instances watching file changes in user specified directories. So then when it&amp;#39;s time to stop all the watchers, I used something like to achieve the goal:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Anonymous Functions in Thread Macros</title>
      <link>https://blog.kenhuang.io/blog/2024-11-08-clojure-thread-macro-anonymous-function/</link>
      <pubDate>Fri, 08 Nov 2024 21:02:56 +0800</pubDate><author>whatacold@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2024-11-08-clojure-thread-macro-anonymous-function/</guid>
      <description>&lt;p&gt;&#xA;While adding &lt;a href=&#34;https://github.com/scicloj/clay/pull/165&#34;&gt;the live reload feature&lt;/a&gt; to Clay, I encountered a problem&#xA;of applying anonymous functions to thread macros. For example, below&#xA;is a simple snippet trying to wrap the input directory as a vector&#xA;with the help of thread macro, but surprisingly, it errors out. After&#xA;some searching, I figured out that I need to put the anonymous&#xA;function into another pair of parentheses:&lt;/p&gt;&#xA;&lt;div class=&#34;src src-clojure&#34;&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-clojure&#34; data-lang=&#34;clojure&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;-&amp;gt; &lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;/tmp/&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;o&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;if &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;vector? &lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;%&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;%&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;%&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]))&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;;; =&amp;gt; Syntax error (ClassCastException) compiling fn* at (simple4all.clj:19:1).&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;;;    class java.lang.String cannot be cast to class clojure.lang.ISeq (java.lang.String is in module java.base of loader &amp;#39;bootstrap&amp;#39;; clojure.lang.ISeq is in unnamed module of loader &amp;#39;app&amp;#39;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;-&amp;gt; &lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;/tmp/&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;if &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;vector? &lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;%&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;%&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;%&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;])))&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;;; =&amp;gt; [&amp;#34;/tmp/&amp;#34;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;p&gt;&#xA;Paul has a nice explanation on &lt;a href=&#34;https://stackoverflow.com/a/7838577&#34;&gt;Stack Overflow&lt;/a&gt;, &lt;a href=&#34;https://clojuredocs.org/clojure.core/-%3E&#34;&gt;thread macros&lt;/a&gt; need the function forms to be lists, but anonymous functions are already lists, so the first expression, &lt;code class=&#34;verbatim&#34;&gt;&amp;#34;/tmp/&amp;#34;&lt;/code&gt; in this example, will just be inserted into that list, just as illustrated below:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Starting a Clojure nREPL Manually for Cider</title>
      <link>https://blog.kenhuang.io/blog/2024-11-08-cider-clojure-repl-cmdline/</link>
      <pubDate>Fri, 08 Nov 2024 00:02:56 +0800</pubDate><author>whatacold@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2024-11-08-cider-clojure-repl-cmdline/</guid>
      <description>&lt;p&gt;&#xA;While troubleshooting and fixing a &lt;a href=&#34;https://github.com/scicloj/clay/issues/176&#34;&gt;live reload bug&lt;/a&gt; in &lt;a href=&#34;https://github.com/scicloj/clay&#34;&gt;Clay&lt;/a&gt; today, which required to start a minimal Clojure environment, I figured out how to start a nREPL from the command line.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;Instead of using &lt;code class=&#34;verbatim&#34;&gt;M-x cider-jack-in-clj&lt;/code&gt; directly from Emacs, actually we can manully bring up an nREPL with this: &lt;code class=&#34;verbatim&#34;&gt;clj -Sdeps &amp;#34;{:deps {org.scicloj/clay {:mvn/version \&amp;#34;2-beta21\&amp;#34;} cider/cider-nrepl {:mvn/version \&amp;#34;0.50.2\&amp;#34;}}}&amp;#34; -m nrepl.cmdline --middleware &amp;#34;[cider.nrepl/cider-middleware]&amp;#34;&lt;/code&gt; (The clay part is only necessary for this debugging), and then connect to this nREPL using the Emacs command &lt;code class=&#34;verbatim&#34;&gt;M-x cider-connect-clj&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
