<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Clojure Q&amp;A - Recent questions tagged beginner</title>
<link>https://ask.clojure.org/index.php/tag/beginner</link>
<description></description>
<item>
<title>Can you help me choosing a book?</title>
<link>https://ask.clojure.org/index.php/14693/can-you-help-me-choosing-a-book</link>
<description>&lt;p&gt;Greetings,&lt;br&gt;
so I decided to learn Clojure, my background is Erlang. I am not working anymore in the IT industry.&lt;/p&gt;
&lt;p&gt;I want to learn Clojure for fun, in my spare time, and I love to use books for that.&lt;br&gt;
I love to build small projects while learning, not just theory.&lt;br&gt;
I see there are trillions of books, and I know it is a very subjective matter.&lt;/p&gt;
&lt;p&gt;I am looking for one good for beginners, and with a practical approach.&lt;br&gt;
Can you recommend one?&lt;/p&gt;
&lt;p&gt;I love &quot;Clojure for the Brave and True&quot;'s title and cover, and it also seems to build a project.&lt;/p&gt;
&lt;p&gt;Is that book still good in 2025?&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;
</description>
<category>Beginner</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14693/can-you-help-me-choosing-a-book</guid>
<pubDate>Tue, 26 Aug 2025 14:58:42 +0000</pubDate>
</item>
<item>
<title>Can we add metaphors/analogies for functional closures in Clojure to the docs please?</title>
<link>https://ask.clojure.org/index.php/14472/metaphors-analogies-functional-closures-clojure-docs-please</link>
<description>&lt;p&gt;Hi,&lt;br&gt;
Having been a longtime happy and satisfied user of Clojure I realized that there is very little to introduce someone new to Clojure to &lt;strong&gt;closures&lt;/strong&gt;  where functions [like vehicles] are passed in with opaqueness to their variables [like passengers] to another function.  I think this is probably a stumbling block for many beginners and might even, unfortunately, discourage people from adopting the language without further explanation of this caveat.  I think many programmers will also disagree with my assessment because they have &quot;closure eyes&quot; and can transparently understand passing functions around as first-class-citizens so-to-speak.  &lt;/p&gt;
&lt;p&gt;I propose that we amend the documentation to explicitly mention that closures are basically like vehicles or cars with passengers.  &lt;/p&gt;
&lt;p&gt;&lt;code&gt;the fact that not everything is transparent to the top level function call is something non-obvious &lt;/code&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;pre&gt;&lt;code&gt;(defn make-adder [x]
 (fn [y] (+ x y)))

(def add5 (make-adder 5))
 (add5 10) ;; Returns 15
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In this example:&lt;/p&gt;
&lt;p&gt;make-adder is like a vehicle factory. When you call it with 5, it creates a new vehicle.&lt;br&gt;
This new vehicle (the returned function) has a permanent passenger: the value 5 is sitting in the x seat.&lt;/p&gt;
&lt;p&gt;There's one empty seat (y) that you can fill when you drive the vehicle (call the function).&lt;/p&gt;
&lt;p&gt;When you call (add5 10), you're putting 10 in the y seat and driving the vehicle.&lt;/p&gt;
&lt;p&gt;Inside, the passengers interact: x (which is 5) and y (which is 10) are added together.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;How REPLs and Closures Intertwine&lt;br&gt;
The REPL (Read-Eval-Print-Loop) and closures interact in interesting ways:&lt;/p&gt;
&lt;p&gt;Creation and Persistence:&lt;br&gt;
When you define (def add5 (make-adder 5)) in the REPL, you're parking a vehicle (with 5 already inside) in your garage with the name &quot;add5&quot;. This vehicle persists between REPL evaluations.&lt;br&gt;
Inspection Limitations:&lt;br&gt;
In the REPL, you can see that add5 is a function, but you can't directly inspect who's sitting inside it. If you evaluate add5, you'll just see something like &lt;code&gt;#function[user/make-adder/fn--123].&lt;/code&gt;&lt;br&gt;
Usage in REPL:&lt;br&gt;
You can use the closure by calling it: (add5 10). The REPL will evaluate this by driving the vehicle with 10 in the y seat, and print the result (15).&lt;/p&gt;
</description>
<category>Docs</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14472/metaphors-analogies-functional-closures-clojure-docs-please</guid>
<pubDate>Thu, 20 Mar 2025 14:13:58 +0000</pubDate>
</item>
<item>
<title>Refresh/Reload deps.edn changes in Calva + VS Code in WSL Ubuntu</title>
<link>https://ask.clojure.org/index.php/14054/refresh-reload-deps-edn-changes-in-calva-vs-code-in-wsl-ubuntu</link>
<description>&lt;p&gt;Hi, I am new to Clojure and am following &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.youtube.com/watch?v=LqVyP_EGKqw&amp;amp;list=PLRGAFpvDgm2ylbXYIjvu3kI426zAP_Lqc&amp;amp;index=1&quot;&gt;this tutorial&lt;/a&gt; to make a Clojure API. This uses Cursive plugin in IntelliJ, but I am using Calva in VS Code.&lt;/p&gt;
&lt;p&gt;This is my project structure: &lt;/p&gt;
&lt;pre&gt;&lt;code&gt; .
├── deps.edn
├── resources
│   └── config.edn
└── src
    └── clojure_api
        ├── config.clj
        └── core.clj
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;My &lt;code&gt;config.clj&lt;/code&gt; file contents:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(ns clojure-api.config
    (:require [aero.core :as aero]
            [clojure.java.io :as io]))

(defn read-config []
  (-&amp;gt; &quot;config.edn&quot;
      (io/resource)
      (aero/read-config)))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I changed my deps.edn file to add the paths &lt;code&gt;src&lt;/code&gt; &amp;amp; &lt;code&gt;resources&lt;/code&gt; like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{:deps {aero/aero {:mvn/version &quot;1.1.6&quot;}} :path [&quot;resources&quot; &quot;src&quot;]}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;while keeping the &lt;code&gt;config.edn&lt;/code&gt; file an empty map: &lt;code&gt;{}&lt;/code&gt;. However, I could not read the config file from &lt;code&gt;read-config&lt;/code&gt; function in &lt;code&gt;config.clj&lt;/code&gt;. It gave this error in Calva repl: &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;; Execution error (IllegalArgumentException) at aero.core/read-config-into-tagged-literal (core.cljc:194).
; Cannot open &amp;lt;nil&amp;gt; as a Reader.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The tutorial &lt;a rel=&quot;nofollow&quot; href=&quot;https://youtu.be/LqVyP_EGKqw?list=PLRGAFpvDgm2ylbXYIjvu3kI426zAP_Lqc&amp;amp;t=421&quot;&gt;solved this error&lt;/a&gt; in Cursive by refreshing the project structure. I cannot seem to find any such commands in Calva. How can I update/refresh my project structure in Calva so that the &lt;code&gt;deps.edn&lt;/code&gt; changes are reflected in the repl?&lt;/p&gt;
&lt;p&gt;I have tried to restart the repl, reopening the folder in VS code, shuffling the &lt;code&gt;resources&lt;/code&gt; directory around to no avail.&lt;/p&gt;
&lt;p&gt;I could not find related answers to this problem after googling, so any help will be appreciated. &lt;/p&gt;
</description>
<category>Calva</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14054/refresh-reload-deps-edn-changes-in-calva-vs-code-in-wsl-ubuntu</guid>
<pubDate>Mon, 19 Aug 2024 15:16:49 +0000</pubDate>
</item>
<item>
<title>Cheshire parse-string coerce keys to keywords</title>
<link>https://ask.clojure.org/index.php/13777/cheshire-parse-string-coerce-keys-to-keywords</link>
<description>&lt;p&gt;Just learning Clojure. I have the following json string:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(def json &quot;{\&quot;a\&quot;: 1, \&quot;b\&quot;: \&quot;val\&quot;, \&quot;c\&quot;: {\&quot;D/E\&quot;: [1, 2, 3]}}}&quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If the key-fn param is true in the Cheshire parse-string call I got the following map: &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(def parsed-json (cheshire/parse-string json true))
;; ==&amp;gt; {:a 1, :b &quot;val&quot;, :c #:D{:E [1 2 3]}}
(type parsed-json)
;; =&amp;gt; clojure.lang.PersistentArrayMap
(type (:c parsed-json))
;; =&amp;gt; clojure.lang.PersistentArrayMap
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;How can I access the [1 2 3] array?  I don't understand what is #:D here, and how I can access :E.&lt;/p&gt;
</description>
<category>Collections</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13777/cheshire-parse-string-coerce-keys-to-keywords</guid>
<pubDate>Wed, 06 Mar 2024 18:06:15 +0000</pubDate>
</item>
<item>
<title>Somehow I have to loop after all</title>
<link>https://ask.clojure.org/index.php/13479/somehow-i-have-to-loop-after-all</link>
<description>&lt;p&gt;I know some little Lisp, but Clojure feels a bit different:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(defn mojorate []
  (let [v (vec (range 1 11))
        max (- (count v) 1)
        atomix (atom [])
        chanl (async/chan)]
    (println v)
    (loop [i 0]
      (async/go
        (&amp;gt;! chanl (swap! atomix conj (/ (get v i) 2))))
      (if (= i max)
        (do (&amp;lt;!! (async/go (&amp;lt;! chanl)))
          (async/close! chanl)
          @atomix)
        (recur (inc i))))))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It's just an exercise with channel, atom loop/recur etc.&lt;/p&gt;
&lt;p&gt;Can you do it like this?&lt;/p&gt;
</description>
<category>Refs, agents, atoms</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13479/somehow-i-have-to-loop-after-all</guid>
<pubDate>Tue, 21 Nov 2023 19:50:16 +0000</pubDate>
</item>
<item>
<title>Run a task parallely to delete tags</title>
<link>https://ask.clojure.org/index.php/12999/run-a-task-parallely-to-delete-tags</link>
<description>&lt;pre&gt;&lt;code&gt;(defn- find-story-ids-by-tag [tag-id]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;  (map :id (db-content-tag/read-contents-by-tag-id (config/db-spec) tag-id)))&lt;/p&gt;
&lt;p&gt;(defn- update-story [txn publisher-id story-id tag-id]&lt;br&gt;
  (let [{:keys [published-json]} (db-content/find-by-id txn story-id)&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    updated-tags (filter (fn [tag] (not= (:id tag) tag-id)) (:tags published-json))
    _ (db-story/update-published-json-without-timestamps txn publisher-id story-id (assoc published-json :tags updated-tags))]
(log/info {:message &quot;[TAG-DELETION] Updated Story Tags in Published JSON&quot;
           :publisher-id publisher-id
           :tag-id tag-id
           :story-id story-id
           :updated-tags-json updated-tags})))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;(defn- delete-tag [publisher-id tag-id]&lt;br&gt;
  (let [associated-content-ids (find-story-ids-by-tag tag-id)]&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(transaction/with-transaction
  [txn (config/db-spec)]
  (do
    (when (seq associated-content-ids)
      (do
        (doseq [story-id associated-content-ids]
          (update-story txn publisher-id story-id tag-id))
        (db-content-tag/delete-batch-by-tag txn tag-id associated-content-ids)
        (log/info {:message &quot;[TAG-DELETION] Deleted from Content Tag&quot;
                   :publisher-id publisher-id
                   :tag-id tag-id
                   :story-ids associated-content-ids})))
    (db-tag/delete txn publisher-id tag-id)
    (log/info {:message &quot;[TAG-DELETION] Deleted Tag&quot;
               :publisher-id publisher-id
               :tag-id tag-id})))))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;(defn run [publisher-id tag-ids]&lt;br&gt;
  (comment run 123 [4 5 6])&lt;br&gt;
  (try&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(do
  (log/info {:message &quot;[TAG-DELETION] started&quot;
             :publisher-id publisher-id
             :tag-ids tag-ids})
  (doseq [tag-id tag-ids] (if (db-tag/find-by-id (config/db-spec) publisher-id tag-id)
                            (delete-tag publisher-id tag-id)
                            (log/info {:message &quot;[TAG-DELETION] Tag Not Found&quot;
                                       :publisher-id publisher-id
                                       :tag-id tag-id})))
  (log/info {:message &quot;[TAG-DELETION] completed&quot;
             :publisher-id publisher-id
             :tag-ids tag-ids}))
(catch Exception e
  (log/exception e {:message &quot;[TAG-DELETION] errored&quot;
                    :publisher-id publisher-id
                    :tag-ids tag-ids}))))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If I have less than 100 tags this works, but say I have 100 000 tags it is very time consuming. How to modify this code which can run in parallel and takes less time? Currently the task uses seq for both deleting and updating the story&lt;/p&gt;
</description>
<category>Sequences</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12999/run-a-task-parallely-to-delete-tags</guid>
<pubDate>Sun, 04 Jun 2023 23:21:53 +0000</pubDate>
</item>
<item>
<title>Is there any performance difference between creating vector via (into [] xs) or (vec xs)?</title>
<link>https://ask.clojure.org/index.php/12996/there-performance-difference-between-creating-vector-into</link>
<description>&lt;p&gt;I can create set/map/vector by two ways:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(into #{} xs) ;; creates PersistentHashSet
(set xs)      ;; creates PersistentHashSet

(into {} xs)  ;; creates PersistentArrayMap or PersistentHashMap (depends on xs size) 
(apply hash-map xs) ;; creates PersistentHashMap

(into [] xs)  ;; creates PersistentVector
(vec xs)      ;; creates PersistentVector
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;(into r xs):&lt;br&gt;
- defines &lt;em&gt;generic&lt;/em&gt; algorithm by conj!-ing input sequence 1 by 1 to passed result collection (uses transient/persistent trick)&lt;/p&gt;
&lt;p&gt;(ctor xs):&lt;br&gt;
- defines precisely type of result data structure&lt;br&gt;
- passes xs sequence as an argument to constructor (which is static java function) so every ctor may define its own logic of creation (maybe by not conj-ing input sequence 1 by 1)&lt;/p&gt;
&lt;p&gt;Are there any performance differences between these two ways?&lt;br&gt;
Maybe there is an established idiom what to use when?&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
</description>
<category>Collections</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12996/there-performance-difference-between-creating-vector-into</guid>
<pubDate>Sat, 03 Jun 2023 11:35:12 +0000</pubDate>
</item>
<item>
<title>Should documentation be added to explain the default browser console representation of CLJS collections and seqs?</title>
<link>https://ask.clojure.org/index.php/12932/documentation-explain-default-representation-collections</link>
<description>&lt;p&gt;Using &lt;code&gt;console.log&lt;/code&gt; on a CLJS collection or sequence returns an internal representation of the object that looks like &lt;code&gt;`&lt;/code&gt;Object { meta: null, cnt: 3, shift: 5, root: {…}, tail: (3) […], __hash: null, &quot;cljs$lang$protocol_mask$partition0$&quot;: 167666463, &quot;cljs$lang$protocol_mask$partition1$&quot;: 139268 }&lt;code&gt;`&lt;/code&gt;. This seems like an easy pitfall for a beginner since &lt;code&gt;console.log&lt;/code&gt; is a standard debugging tool for JS developers. Referring users to something like &lt;code&gt;binaryage/devtools&lt;/code&gt; or any of the built-in functions for converting CLJS types to JS types might be helpful.&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12932/documentation-explain-default-representation-collections</guid>
<pubDate>Thu, 11 May 2023 16:04:18 +0000</pubDate>
</item>
<item>
<title>Can someone explain the anatomy of this piece of code ?</title>
<link>https://ask.clojure.org/index.php/12888/can-someone-explain-the-anatomy-of-this-piece-of-code</link>
<description>&lt;p&gt;I am beginner programmer &amp;amp; have been playing around with Clojure and experimenting alot.&lt;br&gt;
Can someone tell me what the &quot;for&quot; operator does in this context and the other args relationship ? ty in advance&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;(def xbox   {:bushido [&quot;only on PS&quot; {:country :notavailable}] &lt;br&gt;
:parappa &quot;only on PS&quot;    :oni &quot;only on PS&quot;})&lt;/p&gt;
&lt;p&gt;(def playstation   {:bushido [&quot;available&quot; {:country :japan}] &lt;br&gt;
:parappa &quot;classic&quot;    :oni &quot;need to play&quot;})&lt;/p&gt;
&lt;p&gt;(for [{[_ x] :bushido} [xbox playstation]] x)&lt;/p&gt;
&lt;/blockquote&gt;
</description>
<category>Clojure</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12888/can-someone-explain-the-anatomy-of-this-piece-of-code</guid>
<pubDate>Fri, 21 Apr 2023 07:00:41 +0000</pubDate>
</item>
<item>
<title>Are there any Clojure jobs for beginners or even intermediate level, in Europe?</title>
<link>https://ask.clojure.org/index.php/12773/there-clojure-jobs-beginners-even-intermediate-level-europe</link>
<description>&lt;p&gt;Hello, I usually see few or none, job offers in Europe for Clojure junior or even intermediate level. I am in a BIG career change, from architecture /urbanism towards programming (currently learning mainly Python for Data Science and Golang in general (also basic HTML and CSS) and for some reason something is pushing me towards digging into Clojure, too. The syntax is nice and the people too. The first times programming (in Python, Node.js &amp;amp; Go) I felt like I was trying to learn some kind of extraterrestrial dialect, but the mystery of it kept me going on. Then I started getting responses from the software and satisfaction came in.&lt;/p&gt;
&lt;p&gt;The question in particular, is, wether companies are willing to employ non-seniors; thus, if it is worth the time &amp;amp; effort for a beginner in a &quot;practical&quot; sense (I love learning new things, but...). The Clojure jobs offers are mainly for seniors. Also I am Canadian but I am currently (and probably, quite durably) located in Barcelona for family reasons, where the closest Clojure jobs (4 actually) are found in Madrid;  then remote jobs can be found in the rest of W. Europe, but usually it seems to me they ask for expert level, in order to fix complex situations very fast, i.e. not exactly as a first job, unless there is a large team there helping to get real-life Clojure experience. &lt;/p&gt;
&lt;p&gt;Finally, do you think Clojure is going to become more popular? Thank you for your advice! &lt;/p&gt;
&lt;p&gt;Cristina &lt;/p&gt;
</description>
<category>Clojure</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12773/there-clojure-jobs-beginners-even-intermediate-level-europe</guid>
<pubDate>Thu, 16 Mar 2023 12:36:05 +0000</pubDate>
</item>
<item>
<title>How can I make this code more generic/dry?</title>
<link>https://ask.clojure.org/index.php/12650/how-can-i-make-this-code-more-generic-dry</link>
<description>&lt;p&gt;I have several request handlers which all follow a similar pattern. &lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;
(defn handle-data-1
  [req]
  {:pre [(some? req)]}
  (try
    (let [start-date (parse-query-param (-&amp;gt; req :params :start-date))
          end-date (parse-query-param (-&amp;gt; req :params :end-date))
          data (db/fetch-data-1 start-date end-date)
          data-count (count data)]
      (log/debugf &quot;data-count=%d start-date=%s end-date=%s&quot; data-count start-date end-date)
      (if (pos? data-count)
        {:status 200
         :body data}
        {:status 404}))
    (catch Exception e
      (let [error-message (.getMessage e)]
        (log/errorf &quot;%s&quot; error-message)
        {:status 500 :body error-message}))))

(defn handle-data-2
  [req]
  {:pre [(some? req)]}
  (try
    (let [limit (Long/valueOf (parse-query-param (-&amp;gt; req :params :limit)))
          data (db/fetch-data-2 limit)
          data-count (count data)]
      (if (pos? data-count)
        {:status 200
         :body data}
        {:status 404}))
    (catch Exception e
      (let [error-message (.getMessage e)]
        (log/errorf &quot;%s&quot; error-message)
        {:status 500 :body error-message}))))

(defn handle-data-3
  [_]
  (try
    (let [data (db/fetch-data-3)
          data-count (count data)]
      (log/debugf &quot;data-count=%d&quot; data-count)
      (if (pos? data-count)
        {:status 200
         :body data}
        {:status 404}))
    (catch Exception e
      (let [error-message (.getMessage e)]
        (log/errorf &quot;%s&quot; error-message)
        {:status 500 :body error-message}))))
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;I'm trying to make a generic function which can be used by all the handle functions.  Something like:&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;
(defn try-query [f]
  {:pre [(some? f)]}
  (try
    (let [data (f) ;; &amp;lt;- need to invoke function and store results in data
          data-count (count data)]
      (if (pos? data-count)
        {:status 200
         :body data}
        {:status 404}))
    (catch Exception e
      (let [error-message (.getMessage e)]
        (log/errorf &quot;%s&quot; error-message)
        {:status 500 :body error-message}))))

(defn handle-data-1 [req]
  (let [start-date (parse-query-param (-&amp;gt; req :params :start-date))
        end-date (parse-query-param (-&amp;gt; req :params :end-date))]
    (log/debugf &quot;start-date=%s end-date=%s&quot; start-date end-date)
    (try-query (fn [] (db/fetch-data-1 start-date end-date))))) ;; &lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;The generic function needs to take another function (or closure) as a parameter and it can be of varying arity.  I want that generic function to invoke the passed-in function and store its results in a variable.&lt;/p&gt;
&lt;p&gt;In Ruby I could do this by passing a lambda to the function, then inside the function call the lambda.  I'm not sure how to achieve this in Clojure.&lt;/p&gt;
&lt;p&gt;Any ideas?&lt;/p&gt;
</description>
<category>Clojure</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12650/how-can-i-make-this-code-more-generic-dry</guid>
<pubDate>Tue, 07 Feb 2023 19:24:06 +0000</pubDate>
</item>
<item>
<title>How hard is it to learn Clojure?</title>
<link>https://ask.clojure.org/index.php/12340/how-hard-is-it-to-learn-clojure</link>
<description>&lt;p&gt;It had been a couple of weeks since I've started learning Clojure.&lt;/p&gt;
&lt;p&gt;I am a newbie at programming and I passed some basic courses &lt;a rel=&quot;nofollow&quot; href=&quot;https://skillcombo.com/topic/java/&quot;&gt;here&lt;/a&gt; about Java. I just wanted to know how long it will take for me to learn Clojure and if is it difficult for beginners. Also, you can recommend your favourite resources and roadmaps.&lt;/p&gt;
&lt;p&gt;Thanks in advance!&lt;/p&gt;
</description>
<category>Spec</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12340/how-hard-is-it-to-learn-clojure</guid>
<pubDate>Fri, 28 Oct 2022 23:28:38 +0000</pubDate>
</item>
<item>
<title>Why i get &quot;No suitable driver found for jdbc:://127.0.0.1/&quot; ?</title>
<link>https://ask.clojure.org/index.php/12247/why-i-get-no-suitable-driver-found-for-jdbc-127-0-0-1</link>
<description>&lt;p&gt;Java version :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;openjdk 18.0.2-ea 2022-07-19
OpenJDK Runtime Environment (build 18.0.2-ea+9-Ubuntu-222.04)
OpenJDK 64-Bit Server VM (build 18.0.2-ea+9-Ubuntu-222.04, mixed mode, sharing)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;but when i start the nREPL in my text editor, it's says :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Starting nREPL server...
/usr/lib/jvm/java-11-openjdk-amd64/bin/java ...
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Dependencies :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:dependencies [[org.clojure/clojure &quot;1.11.1&quot;]
               [com.github.seancorfield/next.jdbc &quot;1.3.834&quot;]
               [org.postgresql/postgresql &quot;42.5.0&quot;]
               [com.layerware/hugsql &quot;0.5.3&quot;]]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;code :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(def db
    {:classname &quot;org.postgresql.Driver&quot;
     :subprotocol &quot;postgresql&quot;
     :subname &quot;reporting&quot;
     :user &quot;admin&quot;
     :password &quot;admin&quot;})

(defn add-user-transaction [users]
  (jdbc/with-transaction [t-conn db]
                         (if-not (find-user t-conn {:id (:id users)})
                           (add-user! t-conn users))))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Everything works normal with that configuration, but only when i evaluate&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(add-user-transaction {:id &quot;cheryl&quot;
                   :pass &quot;Cheryl&quot;})
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; the error appears.&lt;/p&gt;
&lt;p&gt;It's asked in &lt;a rel=&quot;nofollow&quot; href=&quot;https://stackoverflow.com/questions/73521391/clojure-execution-error-sqlexception-at-java-sql-drivermanager-getconnection&quot;&gt;Clojure: Execution error (SQLException) at java.sql.DriverManager/getConnection (DriverManager.java:702)&lt;/a&gt; and already have answered, but the only answer in there is using &lt;code&gt;:deps&lt;/code&gt; or &lt;code&gt;deps.edn&lt;/code&gt; (as far i know, this is Maven repository), so how about leiningen? Or did i miss something about leiningen and Maven?&lt;br&gt;
And i even restarting my pc, text editor, and nREPL but nothing change.&lt;/p&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12247/why-i-get-no-suitable-driver-found-for-jdbc-127-0-0-1</guid>
<pubDate>Mon, 26 Sep 2022 21:45:00 +0000</pubDate>
</item>
<item>
<title>Can't change the HTML DOM</title>
<link>https://ask.clojure.org/index.php/12141/cant-change-the-html-dom</link>
<description>&lt;p&gt;It is happening when I'm learning Web Development with Clojure, Third Edition. At first everything looks fine and nothing to worry about, but when i start turn on my pc again, move into next section, and change the code, the HTML layout doesn't change. It's still &quot;Hello, Auto!&quot; even i restore the code again.&lt;/p&gt;
&lt;p&gt;I even do with the backup project, but the output still same.&lt;/p&gt;
&lt;p&gt;Here's the code :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(ns guestbook.core)

(-&amp;gt; (.getElementById js/document &quot;content&quot;)
    (.-innerHTML)
    (set! &quot;Hello, Auto!&quot;))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and this is the home HTML resources :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{% extends &quot;base.html&quot; %}
{% block content %}
&amp;lt;input id=&quot;token&quot; type=&quot;hidden&quot; value=&quot;{{csrf-token}}&quot; /&amp;gt;
&amp;lt;div id=&quot;content&quot;&amp;gt;&amp;lt;/div&amp;gt;
{% endblock %}
{% block page-scripts %}
    {% script &quot;/js/app.js&quot; %}
{% endblock %}
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12141/cant-change-the-html-dom</guid>
<pubDate>Fri, 02 Sep 2022 09:55:18 +0000</pubDate>
</item>
<item>
<title>Why i get different result on the same sequence?</title>
<link>https://ask.clojure.org/index.php/11957/why-i-get-different-result-on-the-same-sequence</link>
<description>&lt;p&gt;(= (map :name (mapify (parse (slurp filename)))) '(&quot;Edward Cullen&quot; &quot;Bella Swan&quot; &quot;Charlie Swan&quot; &quot;Jacob Black&quot; &quot;Carlisle Cullen&quot; &quot;Joni balap&quot;))&lt;br&gt;
=&amp;gt; true&lt;/p&gt;
&lt;p&gt;(clojure.string/includes? (map :name (mapify (parse (slurp filename)))) &quot;Joni&quot;)&lt;br&gt;
=&amp;gt; false&lt;/p&gt;
&lt;p&gt;(clojure.string/includes? '(&quot;Edward Cullen&quot; &quot;Bella Swan&quot; &quot;Charlie Swan&quot; &quot;Jacob Black&quot; &quot;Carlisle Cullen&quot; &quot;Joni balap&quot;) &quot;Joni&quot;)&lt;br&gt;
=&amp;gt; true&lt;/p&gt;
</description>
<category>Syntax and reader</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/11957/why-i-get-different-result-on-the-same-sequence</guid>
<pubDate>Mon, 13 Jun 2022 20:21:16 +0000</pubDate>
</item>
<item>
<title>How can we make it easier for beginners to install Clojure?</title>
<link>https://ask.clojure.org/index.php/11767/how-can-we-make-it-easier-for-beginners-to-install-clojure</link>
<description>&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.org/guides/getting_started&quot;&gt;The official Getting Started guide&lt;/a&gt; shows how to install Clojure and its dependencies for macOS, Linux, and Windows, using command-line tools.&lt;/p&gt;
&lt;p&gt;Those procedures work well for experienced programmers who are comfortable figuring things out. However, when it comes to lowering the barrier to entry for beginners, this is less than ideal and leads to a poor first impression.&lt;/p&gt;
&lt;p&gt;I use the guide mentioned above in my &quot;Getting Started with Clojure&quot; workshops, geared towards beginners with little to no prior experience with Clojure or programming in general. And I see first-hand how people struggle to get Clojure installed and working correctly on their system, especially Windows users.&lt;/p&gt;
&lt;p&gt;Allowing users to install Clojure and all dependencies in a single step would make it easier for people to install Clojure and dramatically improve the user experience for newbies, which is essential for increased exposure and adoption.&lt;/p&gt;
&lt;p&gt;To that end, I want to propose official &quot;download and double-click installers&quot; for all operating systems. For inspiration, check out the installers offered by other languages like &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.python.org/downloads/&quot;&gt;Python&lt;/a&gt; or &lt;a rel=&quot;nofollow&quot; href=&quot;https://go.dev/doc/install&quot;&gt;Go&lt;/a&gt;. &quot;Just download this installer and run it. That's it.&quot;&lt;/p&gt;
&lt;p&gt;Also, Scala has &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.scala-lang.org/download/&quot;&gt;an excellent landing page&lt;/a&gt; with two options to guide beginners and advanced users to different installation guides. Beginners are encouraged to try Scala in the browser without installing anything on their computer. For Clojure, we could guide beginners to something like &lt;a rel=&quot;nofollow&quot; href=&quot;https://calva.io/get-started-with-clojure/&quot;&gt;Calva&lt;/a&gt; or &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.maria.cloud&quot;&gt;Maria&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In summary: We could draw inspiration from other programming language ecosystems to create a smoother installation experience for beginners. After discovery, the newbie experience begins with the installation process.&lt;/p&gt;
&lt;p&gt;Note that there is &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojurians.slack.com/archives/C0353589RFC/p1649837679043339&quot;&gt;a relevant discussion ongoing in the Clojurians Slack&lt;/a&gt;.&lt;/p&gt;
</description>
<category>Tools</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/11767/how-can-we-make-it-easier-for-beginners-to-install-clojure</guid>
<pubDate>Wed, 13 Apr 2022 08:09:09 +0000</pubDate>
</item>
<item>
<title>All kinds of problems trying to run my first Clojure program</title>
<link>https://ask.clojure.org/index.php/11640/all-kinds-of-problems-trying-to-run-my-first-clojure-program</link>
<description>&lt;p&gt;Trying to run my first Clojure program while following &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.braveclojure.com/basic-emacs/&quot;&gt;this guide&lt;/a&gt; and I'm running into problems.&lt;/p&gt;
&lt;p&gt;Here's my basic code:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(ns clojure-noob.core
  (:gen-class))

(defn -main
  &quot;I don't do a whole lot...yet.&quot;
  [&amp;amp; args]
(println &quot;Hello, World!&quot;))

(defn train
  []
  (println &quot;Choo choo!&quot;)) 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And here's what I get after switching namespaces:&lt;/p&gt;
&lt;p&gt;   clojure-noob.core&amp;gt; (train)&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Syntax error compiling at (*cider-repl Clojure/Projects:localhost:49632(clj)*:46:20).
Unable to resolve symbol: train in this context
clojure-noob.core&amp;gt; (-main)
Syntax error compiling at (*cider-repl Clojure/Projects:localhost:49632(clj)*:49:20).
Unable to resolve symbol: -main in this context
clojure-noob.core&amp;gt; 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;What step am I missing?&lt;/p&gt;
&lt;p&gt;And why is the learning curve so steep?&lt;/p&gt;
</description>
<category>Tools</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/11640/all-kinds-of-problems-trying-to-run-my-first-clojure-program</guid>
<pubDate>Thu, 17 Mar 2022 22:18:15 +0000</pubDate>
</item>
<item>
<title>EMacs standard configuration error</title>
<link>https://ask.clojure.org/index.php/11621/emacs-standard-configuration-error</link>
<description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I'm very new to all of this...&lt;/p&gt;
&lt;p&gt;I encountered this error setting up Emacs with the standard configuration:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Warning (evil-collection): `evil-want-keybinding' was set to nil but not before loading evil.

Make sure to set `evil-want-keybinding' to nil before loading evil or evil-collection.

See https://github.com/emacs-evil/evil-collection/issues/60 for more details.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I went to the URL, but can't understand what they're discussing.&lt;/p&gt;
&lt;p&gt;How do I fix this?&lt;/p&gt;
&lt;p&gt;And what's the ideal setup to get up and running on building solutions in Clojure on a Mac?&lt;/p&gt;
</description>
<category>Tools</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/11621/emacs-standard-configuration-error</guid>
<pubDate>Mon, 14 Mar 2022 14:48:00 +0000</pubDate>
</item>
<item>
<title>What are resources to learn Clojure for beginners in Programming and get better?</title>
<link>https://ask.clojure.org/index.php/11239/what-resources-learn-clojure-beginners-programming-better</link>
<description>&lt;p&gt;As in title,&lt;br&gt;
I am not too good of programmer, best I can do is like, write simple number guessing game, and I guess that is an elementary thing to even be able to do..&lt;/p&gt;
&lt;p&gt;So,&lt;br&gt;
My question is, what are good resources to get better at clojure, that does not require much prior experience?&lt;/p&gt;
&lt;p&gt;And other question while we are at it..&lt;br&gt;
Would be going through specific tutorials, like for example, how to write simple snake game in clojure, and then playing around with it, changing things, be a decent approach?&lt;/p&gt;
</description>
<category>Clojure</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/11239/what-resources-learn-clojure-beginners-programming-better</guid>
<pubDate>Tue, 02 Nov 2021 09:55:58 +0000</pubDate>
</item>
<item>
<title>When to use simple/qualified keywords?</title>
<link>https://ask.clojure.org/index.php/10380/when-to-use-simple-qualified-keywords</link>
<description>&lt;p&gt;Is there any &quot;official&quot; guidance on this?&lt;/p&gt;
&lt;p&gt;Clojure.spec uses both:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(s/def ::foo (s/keys :req [::bar]))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The current usecase I'm wondering about is an internal API I'm working on. It is pretty clear that top-level keys in the api response benefit from being qualified. How about keywords in value positions?&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{:my.api.person/name &quot;Imre&quot;
 :my.api/result-type :success ;; :my.api.result/success perhaps?
 :my.api/warnings [:quota-exceeded :my.api.quota/exceeded]}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Edit: &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojurians-log.clojureverse.org/clojure/2021-03-26/1616759029.465400&quot;&gt;Slack discussion where I brought this up first&lt;/a&gt;&lt;/p&gt;
</description>
<category>Clojure</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/10380/when-to-use-simple-qualified-keywords</guid>
<pubDate>Fri, 26 Mar 2021 13:47:38 +0000</pubDate>
</item>
<item>
<title>WARNING: When invoking clojure.main, use -M</title>
<link>https://ask.clojure.org/index.php/10235/warning-when-invoking-clojure-main-use-m</link>
<description>&lt;p&gt;Hello All,&lt;/p&gt;
&lt;p&gt;I am new to Clojure, just wrote my first program using an editor. While running it I get the following warning&lt;/p&gt;
&lt;p&gt;&lt;code&gt;% clj addition_function.clj
WARNING: When invoking clojure.main, use -M
3&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The program executes but I am confused by the warning and &lt;code&gt;-M &lt;/code&gt;  flag. If some one can throw a light for a beginner it would be good.&lt;/p&gt;
</description>
<category>Clojure</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/10235/warning-when-invoking-clojure-main-use-m</guid>
<pubDate>Tue, 23 Feb 2021 06:56:01 +0000</pubDate>
</item>
<item>
<title>Escaping/returning from a REPL crash</title>
<link>https://ask.clojure.org/index.php/8752/escaping-returning-from-a-repl-crash</link>
<description>&lt;p&gt;Question: When I get an error inside a #object[] the REPL crashes and no command seems to escape, so I have to restart the terminal. &lt;/p&gt;
&lt;p&gt;Ctrl + C and Ctrl + D do not work.&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8752/escaping-returning-from-a-repl-crash</guid>
<pubDate>Wed, 23 Oct 2019 01:18:10 +0000</pubDate>
</item>
<item>
<title>Issue cycling functions</title>
<link>https://ask.clojure.org/index.php/8433/issue-cycling-functions</link>
<description>&lt;p&gt;Not really sure what I'm doing wrong here.&lt;br&gt;
I'm trying to cycle functions, but the result is a list of nils. When I modify the cycled functions to be a static function, it works as expected.&lt;br&gt;
Any advice?&lt;/p&gt;
&lt;p&gt;code: &lt;a rel=&quot;nofollow&quot; href=&quot;https://pastebin.com/K9xS9RG9&quot;&gt;https://pastebin.com/K9xS9RG9&lt;/a&gt;&lt;/p&gt;
</description>
<category>Clojure</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8433/issue-cycling-functions</guid>
<pubDate>Tue, 20 Aug 2019 13:47:44 +0000</pubDate>
</item>
</channel>
</rss>