Skip to content

Commit cd231f4

Browse files
committedDec 31, 2024·
regenerate site
1 parent 1597b7c commit cd231f4

File tree

12 files changed

+77
-42
lines changed

12 files changed

+77
-42
lines changed
 

‎articles/cookbooks/date_and_time/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ <h2>Date and Time</h2>
143143
(ydm "20170108")
144144
;; =&gt; #object[java.time.LocalDate 0x4851aa55 "2017-08-01"]
145145
</code></pre><p>For more formatting patterns check out the
146-
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/time/format/DateTimeFormatter.html">DateTimeFormatter</a>
146+
<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/time/format/DateTimeFormatter.html">DateTimeFormatter</a>
147147
class, the table <strong>Predefined Formatters</strong> is where the <code>:iso-date</code> came from
148148
although note it is written as <code>ISO_DATE</code> in the <strong>Formatted</strong> column.</p><p>More basic recipes can be read in the
149149
<a href="https://dm3.github.io/clojure.java-time/README.html">README</a> for

‎articles/cookbooks/files_and_directories/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ <h2>Working with Files and Directories in Clojure</h2>
109109
getParent The dirname of the file.
110110
getPath Filename with directory.
111111
mkdir Create this directory on disk.
112-
</code></pre><p>To read about more available methods, see <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/File.html">the <code>java.io.File</code>
112+
</code></pre><p>To read about more available methods, see <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/io/File.html">the <code>java.io.File</code>
113113
docs</a>.</p><h3 id="get-a-list-of-the-files-and-dirs-in-a-given-directory">Get a list of the files and dirs in a given directory</h3><p>As <code>File</code> objects:</p><pre><code class="clojure">(.listFiles (io/file "path/to/some-dir"))
114114
</code></pre><p>Same, but just the <em>names</em> (strings), not File objects:</p><pre><code class="clojure">(.list (io/file "path/to/some-dir"))
115115
</code></pre><p>The results of those calls are seqable.</p><h2 id="see-also">See also</h2><ul><li><a href="https://github.com/clj-commons/fs">https://github.com/clj-commons/fs</a></li><li>the I/O section of the <a href="https://clojure.org/api/cheatsheet">cheatsheet</a></li></ul>

‎articles/cookbooks/strings/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ <h2>Strings</h2>
7777
interoperability.</p><p>This work is licensed under a <a rel="license" href="https://creativecommons.org/licenses/by/3.0/">Creative Commons
7878
Attribution 3.0 Unported License</a> (including images &amp;
7979
stylesheets). The source is available <a href="https://github.com/clojure-doc/clojure-doc.github.io">on
80-
Github</a>.</p><h2 id="overview">Overview</h2><ul><li>Strings are <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html">plain Java
80+
Github</a>.</p><h2 id="overview">Overview</h2><ul><li>Strings are <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html">plain Java
8181
strings</a>.
8282
You can use anything which operates on them.</li><li>Java strings are immutable, so they're convenient to use in Clojure.</li><li>You can't add metadata to Java strings.</li><li>Clojure supports some convenient notations:</li></ul><pre><code> "foo" java.lang.String
8383
#"\d" java.util.regex.Pattern (in this case, one which matches a single digit)
8484
\f java.lang.Character (in this case, the letter 'f')
8585
</code></pre><ul><li><strong>Caveat:</strong> Human brains and electronic computers are rather different
86-
devices. So Java strings (sequences of <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Character.html#unicode">UTF-16
86+
devices. So Java strings (sequences of <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Character.html#unicode">UTF-16
8787
characters</a>)
8888
don't always map nicely to user-perceived characters. For example, a
8989
single Unicode "code point" doesn't necessarily equal a user-perceived
@@ -179,7 +179,7 @@ <h2>Strings</h2>
179179
(read-string "#\"[abc]\""))
180180
;=&gt; #"[abc]"
181181
</code></pre><h3 id="parsing-complex-strings">Parsing complex strings</h3><h4 id="regexes">Regexes</h4><p>Regexes offer a boost in string-matching power. You can express ideas
182-
like repetition, alternatives, etc.</p><p><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/regex/Pattern.html">Regex
182+
like repetition, alternatives, etc.</p><p><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/regex/Pattern.html">Regex
183183
reference.</a></p><p><strong>Groups:</strong> Regex groups are useful, when we want to match more than
184184
one substring. (Or refer to matches later.) In the regex <code>#"(group-1) (group-2)"</code>, the 0th group is the whole match. The 1st group is
185185
started by the left-most <code>(</code>, the 2nd group is started by the
@@ -291,7 +291,7 @@ <h2>Strings</h2>
291291
(print "...")))
292292
;=&gt; "We have shrimp-kabobs, shrimp creole, shrimp gumbo..."
293293
</code></pre><h4 id="format-strings">Format strings</h4><p>Java's templating mini-language helps you build many strings
294-
conveniently. <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Formatter.html">Reference.</a></p><pre><code class="clojure">;; %s is most commonly used to print args. Escape %'s with %%.
294+
conveniently. <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Formatter.html">Reference.</a></p><pre><code class="clojure">;; %s is most commonly used to print args. Escape %'s with %%.
295295
(format "%s enjoyed %s%%." "Mozambique" 19.8) ;=&gt; "Mozambique enjoyed 19.8%."
296296

297297
;; The 1$ prefix allows you to keep referring to the first arg.

‎articles/ecosystem/community/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ <h2>Clojure Community</h2>
6363
</div>
6464

6565
<p>This guide covers:</p><ul><li>Online Communities</li><li>The Official Clojure mailing lists</li><li>IRC channel</li><li>Documentation sites</li><li>Clojure User Groups around the globe</li><li>Conferences about or related to Clojure</li><li>Various Community sites about Clojure (subreddit, etc)</li></ul><p>This work is licensed under a <a rel="license" href="https://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 Unported License</a>
66-
(including images &amp; stylesheets). The source is available <a href="https://github.com/clojure-doc/clojure-doc.github.io">on Github</a>.</p><h2 id="online-communities">Online Communities</h2><ul><li><a href="https://clojurians.slack.com">Clojurians Slack</a> -- currently the most active online community, generously sponsored by Salesforce (owners of Slack) -- <a href="http://clojurians.net">self-signup at clojurians.net</a> -- <a href="https://clojurians-log.clojureverse.org/">partial archive of channels</a> (via <code>@logbot</code> on Slack)</li><li><a href="https://clojurians.zulipchat.com/">Clojurians Zulip</a> -- free, open source community, includes an archive of most channels from the Clojurians Slack (via <code>@zulip-mirror-bot</code> on Slack)</li><li><a href="https://www.reddit.com/r/Clojure/">Clojure SubReddit</a> -- r/Clojure -- the right-hand sidebar has links to many Clojure resources</li><li><a href="https://clojureverse.org">ClojureVerse</a> -- online forum</li><li><a href="https://ask.clojure.org/">Clojure Q&amp;A</a> -- the official Clojure question and answer site</li><li><a href="https://discord.gg/discljord">Clojurians Discord</a></li><li><a href="https://clj.social/">clj.social</a> -- a Clojure-specific Mastodon instance</li><li><a href="https://clojure.camp/">Clojure Camp</a> -- aimed at Clojure beginners, this offers a fun community of mentors and fellow learners, via Discord, Meetup.com, and offers study groups, pairing, and 1:1 mentoring</li><li>See also the <a href="https://clojure.org/community/resources">Clojure Discussion section on clojure.org</a> for more online communities</li></ul><h2 id="clojure-mailing-list">Clojure Mailing List</h2><ul><li><a href="https://groups.google.com/g/clojure">Clojure users mailing list</a> -- this is the original and still occasionally active mailing list for Clojure users</li></ul><h2 id="clojure-irc-channels">Clojure IRC Channels</h2><ul><li><code>#clojure</code> on <a href="https://libera.chat">Libera.Chat</a></li></ul><h2 id="documentation">Documentation</h2><ul><li>Official <a href="https://clojure.org/guides/getting_started">clojure.org Guides</a></li><li>Official <a href="https://clojure.org/reference/reader">clojure.org Reference documentation</a></li><li>Official <a href="https://clojure.org/api/api">clojure.org API documentation</a></li><li><a href="https://clojuredocs.org/">ClojureDocs</a>: Clojure API reference, with examples</li><li><a href="https://clojure-doc.org/">Clojure-Doc</a>: Clojure tutorials, cookbooks, etc</li><li><a href="https://clojure.org/api/cheatsheet">Clojure API Cheatsheet</a> (hosted on clojure.org)</li><li>Community <a href="https://guide.clojure.style/">Clojure Style Guide</a></li><li><a href="http://clojurekoans.com/">Clojure Koans</a></li><li><a href="http://www.getclojure.org">GetClojure</a>: Tens of thousands of searchable Clojure examples mined from all over the internet.</li></ul><h2 id="books">Books</h2><ul><li>See the list of <a href="https://clojure.org/community/books">books on clojure.org</a></li></ul><h2 id="courses">Courses</h2><ul><li>See the list of <a href="https://www.clojure.org/community/training">courses and training on clojure.org</a></li></ul><h2 id="user-groups">User Groups</h2><ul><li>The list of <a href="https://clojure.org/community/user_groups">Clojure User Groups</a> around the world</li><li><a href="https://clojure.org/community/start_group">How to run your own Clojure User Group</a></li></ul><h2 id="videos-about-clojure">Videos About Clojure</h2><p>Videos of talks about Clojure are often made available on <a href="https://www.infoq.com/clojure">InfoQ</a>, and <a href="https://www.youtube.com/user/ClojureTV">Clojure YouTube channel</a>. In addition, here are some other video learning resources:</p><ul><li><a href="https://vimeo.com/channels/fulldisclojure/videos">Full Disclojure</a> is a series of screencasts about Clojure</li><li><a href="https://pluralsight.com/training/Courses/TableOfContents/clojure-concurrency-tutorial">Clojure Concurrency Tutorial</a></li><li><a href="https://www.oreilly.com/library/view/clojure-inside-out/9781449368647/">Clojure Inside Out</a> from O'Reilly</li><li><a href="https://www.youtube.com/playlist?list=PL1p6TgkbKXqyOwq6iSkce_EY5YWFHciHt">Clojure Koans Walkthroughs</a></li><li><a href="https://ericnormand.me/">Eric Normand</a></li><li><a href="https://tbaldridge.pivotshare.com/">Clojure Tutorials by Tim Baldridge</a></li><li><a href="https://www.youtube.com/practicalli">Practicalli YouTube Channel</a> -- including <a href="https://www.youtube.com/playlist?list=PLpr9V-R8ZxiDjyU7cQYWOEFBDR1t7t0wv">Learning Clojure with Practicalli</a></li></ul><h2 id="podcasts-about-clojure">Podcasts About Clojure</h2><ul><li><a href="https://cognitect.com/cognicast/">Cognicast</a> by Craig Andera often discusses topics relevant to Clojure and ClojureScript.</li><li><a href="https://clojuredesign.club/">Clojure Design Club</a> by Christoph Neumann and Nate Jones -- Functional Design in Clojure: Group therapy for recovering object-oriented developers.</li><li><a href="https://clojure.stream/podcast">ClojureStream</a> by Jacek Schae -- Explore unusually expressive programming language with Lisp roots that runs on JavaScript, Java Virtual Machine, and CLR.</li><li><a href="https://www.therepl.net/episodes/">The REPL</a> by Daniel Compton -- A weekly newsletter and podcast diving into Clojure programs and libraries.</li><li><a href="https://podcasters.spotify.com/pod/show/lostinlambduhhs/">Lost In Lambduhhs</a> by Jordan Miller -- Featuring interviews with a myriad of guests from all sectors of tech with a special focus on the languages Clojure and Clojurescript</li><li><a href="https://www.parens-of-the-dead.com/">Parens of the Dead</a> by Magnar Sveen and Christian Johansen -- A screencast series of zombie-themed games written with Clojure and ClojureScript</li></ul><h2 id="code-repositories">Code Repositories</h2><p>Most folks host their projects at
66+
(including images &amp; stylesheets). The source is available <a href="https://github.com/clojure-doc/clojure-doc.github.io">on Github</a>.</p><h2 id="online-communities">Online Communities</h2><ul><li><a href="https://clojurians.slack.com">Clojurians Slack</a> -- currently the most active online community, generously sponsored by Salesforce (owners of Slack) -- <a href="http://clojurians.net">self-signup at clojurians.net</a> -- <a href="https://clojurians-log.clojureverse.org/">partial archive of channels</a> (via <code>@logbot</code> on Slack)</li><li><a href="https://clojurians.zulipchat.com/">Clojurians Zulip</a> -- free, open source community, includes an archive of most channels from the Clojurians Slack (via <code>@zulip-mirror-bot</code> on Slack)</li><li><a href="https://www.reddit.com/r/Clojure/">Clojure SubReddit</a> -- r/Clojure -- the right-hand sidebar has links to many Clojure resources</li><li><a href="https://clojureverse.org">ClojureVerse</a> -- online forum</li><li><a href="https://ask.clojure.org/">Clojure Q&amp;A</a> -- the official Clojure question and answer site</li><li><a href="https://discord.gg/discljord">Clojurians Discord</a></li><li><a href="https://clj.social/">clj.social</a> -- a Clojure-specific Mastodon instance</li><li><a href="https://clojure.camp/">Clojure Camp</a> -- aimed at Clojure beginners, this offers a fun community of mentors and fellow learners, via Discord, Meetup.com, and offers study groups, pairing, and 1:1 mentoring</li><li>See also the <a href="https://clojure.org/community/resources">Clojure Discussion section on clojure.org</a> for more online communities</li></ul><h2 id="clojure-mailing-list">Clojure Mailing List</h2><ul><li><a href="https://groups.google.com/g/clojure">Clojure users mailing list</a> -- this is the original and still occasionally active mailing list for Clojure users</li></ul><h2 id="clojure-irc-channels">Clojure IRC Channels</h2><ul><li><code>#clojure</code> on <a href="https://libera.chat">Libera.Chat</a></li></ul><h2 id="documentation">Documentation</h2><ul><li>Official <a href="https://clojure.org/guides/getting_started">clojure.org Guides</a></li><li>Official <a href="https://clojure.org/reference/reader">clojure.org Reference documentation</a></li><li>Official <a href="https://clojure.org/api/api">clojure.org API documentation</a></li><li><a href="https://clojuredocs.org/">ClojureDocs</a>: Clojure API reference, with examples</li><li><a href="https://clojure-doc.org/">Clojure-Doc</a>: Clojure tutorials, cookbooks, etc</li><li><a href="https://clojure.org/api/cheatsheet">Clojure API Cheatsheet</a> (hosted on clojure.org)</li><li>Community <a href="https://guide.clojure.style/">Clojure Style Guide</a></li><li><a href="http://clojurekoans.com/">Clojure Koans</a></li><li><a href="http://www.getclojure.org">GetClojure</a>: Tens of thousands of searchable Clojure examples mined from all over the internet.</li></ul><h2 id="books">Books</h2><ul><li>See the list of <a href="https://clojure.org/community/books">books on clojure.org</a></li></ul><h2 id="courses">Courses</h2><ul><li>See the list of <a href="https://clojure.org/community/training">courses and training on clojure.org</a></li></ul><h2 id="user-groups">User Groups</h2><ul><li>The list of <a href="https://clojure.org/community/user_groups">Clojure User Groups</a> around the world</li><li><a href="https://clojure.org/community/start_group">How to run your own Clojure User Group</a></li></ul><h2 id="videos-about-clojure">Videos About Clojure</h2><p>Videos of talks about Clojure are often made available on <a href="https://www.infoq.com/clojure">InfoQ</a>, and <a href="https://www.youtube.com/user/ClojureTV">Clojure YouTube channel</a>. In addition, here are some other video learning resources:</p><ul><li><a href="https://vimeo.com/channels/fulldisclojure/videos">Full Disclojure</a> is a series of screencasts about Clojure</li><li><a href="https://pluralsight.com/training/Courses/TableOfContents/clojure-concurrency-tutorial">Clojure Concurrency Tutorial</a></li><li><a href="https://www.oreilly.com/library/view/clojure-inside-out/9781449368647/">Clojure Inside Out</a> from O'Reilly</li><li><a href="https://www.youtube.com/playlist?list=PL1p6TgkbKXqyOwq6iSkce_EY5YWFHciHt">Clojure Koans Walkthroughs</a></li><li><a href="https://ericnormand.me/">Eric Normand</a></li><li><a href="https://tbaldridge.pivotshare.com/">Clojure Tutorials by Tim Baldridge</a></li><li><a href="https://www.youtube.com/practicalli">Practicalli YouTube Channel</a> -- including <a href="https://www.youtube.com/playlist?list=PLpr9V-R8ZxiDjyU7cQYWOEFBDR1t7t0wv">Learning Clojure with Practicalli</a></li></ul><h2 id="podcasts-about-clojure">Podcasts About Clojure</h2><ul><li><a href="https://cognitect.com/cognicast/">Cognicast</a> by Craig Andera often discusses topics relevant to Clojure and ClojureScript.</li><li><a href="https://clojuredesign.club/">Clojure Design Club</a> by Christoph Neumann and Nate Jones -- Functional Design in Clojure: Group therapy for recovering object-oriented developers.</li><li><a href="https://clojure.stream/podcast">ClojureStream</a> by Jacek Schae -- Explore unusually expressive programming language with Lisp roots that runs on JavaScript, Java Virtual Machine, and CLR.</li><li><a href="https://www.therepl.net/episodes/">The REPL</a> by Daniel Compton -- A weekly newsletter and podcast diving into Clojure programs and libraries.</li><li><a href="https://podcasters.spotify.com/pod/show/lostinlambduhhs/">Lost In Lambduhhs</a> by Jordan Miller -- Featuring interviews with a myriad of guests from all sectors of tech with a special focus on the languages Clojure and Clojurescript</li><li><a href="https://www.parens-of-the-dead.com/">Parens of the Dead</a> by Magnar Sveen and Christian Johansen -- A screencast series of zombie-themed games written with Clojure and ClojureScript</li></ul><h2 id="code-repositories">Code Repositories</h2><p>Most folks host their projects at
6767
<a href="https://github.com/search?l=Clojure&amp;q=clojure&amp;type=Repositories">GitHub</a>, and most pure Clojure
6868
library distributions (with the exception of Contrib) are available at
6969
<a href="https://clojars.org/">Clojars</a>.</p><h2 id="websites">Websites</h2><ul><li><a href="https://clojure.org/">Clojure.org</a>: the official website</li><li><a href="https://planet.clojure.in/">Planet Clojure</a>: aggregator of selected Clojure-related blog posts</li><li><a href="https://www.clojure-toolbox.com/">The Clojure Toolbox</a>: a categorized directory of libraries and tools for Clojure</li><li><a href="https://4clojure.oxal.org/">4Clojure</a>: Clojure exercise problems</li><li><a href="https://exercism.io/">Exercism.io</a>: Peer-reviewed Clojure exercises</li></ul><h2 id="conferences">Conferences</h2><p>See <a href="https://clojure.org/community/resources#_conferences">Community &gt; Resources &gt; Conferences on clojure.org</a>.</p><h2 id="email-newsletters">Email Newsletters</h2><ul><li><a href="http://www.clojuregazette.com/">Clojure Gazette</a></li><li><a href="http://defnewsletter.com/">(def newsletter)</a></li></ul><h2 id="workshops">Workshops</h2><ul><li><a href="http://www.clojurebridge.org/">ClojureBridge</a></li></ul><h2 id="core-development">Core development</h2><p>See the <a href="https://clojure.org/dev/dev">Clojure &gt; Development on clojure.org</a> for full details on

‎articles/language/collections_and_sequences/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ <h2>Language: Collections and Sequences</h2>
201201
collection implementation details and won't be the same for vectors and lists.</p><p>In general, Clojure design emphasizes that operations on collections and sequences should be uniform and
202202
follow the principle of least surprise. In real world projects, however, the difference between
203203
algorithmic complexity and other runtime characteristics of various collection types often cannot
204-
be ignored. Keep this in mind.</p><p>You can find more information in the <a href="/articles/language/core_overview/">clojure.core Overview</a> and <a href="http://clojure.org/cheatsheet">Clojure cheatsheet</a>.</p><h3 id="count">count</h3><p>Returns a count of the number of items in a collection. An argument of nil returns 0.</p><pre><code class="klipse-clojure nohighlight">(count "Hello")
204+
be ignored. Keep this in mind.</p><p>You can find more information in the <a href="/articles/language/core_overview/">clojure.core Overview</a> and <a href="https://clojure.org/cheatsheet">Clojure cheatsheet</a>.</p><h3 id="count">count</h3><p>Returns a count of the number of items in a collection. An argument of nil returns 0.</p><pre><code class="klipse-clojure nohighlight">(count "Hello")
205205
;; ⇒ 5
206206
</code></pre><pre><code class="klipse-clojure nohighlight">(count [1 2 3 4 5 6 7])
207207
;; ⇒ 7
@@ -416,8 +416,8 @@ <h2>Language: Collections and Sequences</h2>
416416
;; Execution error (ClassCastException)...
417417
;; class java.lang.Double cannot be cast to class java.lang.String
418418
</code></pre><p>In order to do more complicated sorting, we can create our own <code>Comparator</code>. There's a wealth of information
419-
about comparators in the <a href="https://www.clojure.org/guides/comparators">clojure.org comparators guide</a>, but for now, one possible comparator is a
420-
function that takes two arguments and returns a negative, positive, or zero integer when the first argument is 'less than', 'greater than', or equal to (respectively) the second argument.</p><pre><code class="klipse-clojure nohighlight">(letfn [(strings-before-numbers
419+
about comparators in the <a href="https://clojure.org/guides/comparators">clojure.org comparators guide</a>, but for now, one possible comparator is a
420+
function that takes two arguments and returns a negative, positive, or zero integer when the first argument is 'less than', 'greater than', or equal to (respectively) the second argument.</p><pre><code class="klipse-clojure nohighlight">(letfn [(strings-before-numbers
421421
[x y]
422422
(cond
423423
; string is 'less than' number

‎articles/language/concurrency_and_parallelism/index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ <h2>Language: Concurrency and Parallelism</h2>
148148
;; ⇒ #object[clojure.lang.Atom 0x7499eac7 {:status :ready, :val ["chatty-joe"]}]
149149
@currently-connected
150150
;; ⇒ ["chatty-joe"]
151-
</code></pre><p>To demonstrate this graphically, initial atom state looks like this:</p><p><img src="/assets/images/language/concurrency_and_parallelism/atom_state1.png" alt="Atom state 1" /></p><p>and then we mutated it with <code>swap!</code>:</p><p><img src="/assets/images/language/concurrency_and_parallelism/atom_state2.png" alt="Atom state 2" /></p><p>For the readers familiar with the atomic types from the <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/atomic/package-summary.html">java.util.concurrent.atomic</a> package,
151+
</code></pre><p>To demonstrate this graphically, initial atom state looks like this:</p><p><img src="/assets/images/language/concurrency_and_parallelism/atom_state1.png" alt="Atom state 1" /></p><p>and then we mutated it with <code>swap!</code>:</p><p><img src="/assets/images/language/concurrency_and_parallelism/atom_state2.png" alt="Atom state 2" /></p><p>For the readers familiar with the atomic types from the <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/concurrent/atomic/package-summary.html">java.util.concurrent.atomic</a> package,
152152
this should sound very familiar. The only difference is that instead of setting a value, atoms are mutated
153153
with a function. This is both because Clojure is a functional language and because with this approach,
154154
<code>clojure.core/swap!</code> can <em>retry the operation</em> safely. This implies that the function you provide to
@@ -548,7 +548,7 @@ <h2>Language: Concurrency and Parallelism</h2>
548548
l)
549549
;; ⇒ [10]
550550
</code></pre><p>Note that for immutable Clojure data structures, explicit locking is effectively
551-
not necessary.</p><p><em>This section will need revisiting when Virtual Threads become more common.</em></p><h3 id="synchronization-on-clojure-record-fields">Synchronization on Clojure Record Fields</h3><p><em>TBD</em></p><h2 id="reducers-clojure-15">Reducers (Clojure 1.5+)</h2><ul><li>The <a href="https://www.clojure.org/news/2012/05/08/reducers">original blog post introducing reducers</a></li><li>The <a href="https://clojure.org/reference/reducers">official <code>clojure.org</code> reference on reducers</a></li><li>The <a href="https://clojure.github.io/clojure/clojure.core-api.html#clojure.core.reducers">official API docs for the <code>clojure.core.reducers</code> namespace</a></li></ul><h2 id="javautilconcurrent">java.util.concurrent</h2><h3 id="overview-2">Overview</h3><p><code>java.util.concurrent</code> (sometimes abbreviated as <code>j.u.c.</code>) is a group of
551+
not necessary.</p><p><em>This section will need revisiting when Virtual Threads become more common.</em></p><h3 id="synchronization-on-clojure-record-fields">Synchronization on Clojure Record Fields</h3><p><em>TBD</em></p><h2 id="reducers-clojure-15">Reducers (Clojure 1.5+)</h2><ul><li>The <a href="https://clojure.org/news/2012/05/08/reducers">original blog post introducing reducers</a></li><li>The <a href="https://clojure.org/reference/reducers">official <code>clojure.org</code> reference on reducers</a></li><li>The <a href="https://clojure.github.io/clojure/clojure.core-api.html#clojure.core.reducers">official API docs for the <code>clojure.core.reducers</code> namespace</a></li></ul><h2 id="javautilconcurrent">java.util.concurrent</h2><h3 id="overview-2">Overview</h3><p><code>java.util.concurrent</code> (sometimes abbreviated as <code>j.u.c.</code>) is a group of
552552
<em>concurrency utilities</em> in the JDK. Originally introduced in JDK 5 in 2004,
553553
they are developed and maintained by some of the experts in concurrency.
554554
<code>j.u.c.</code> is a mature library that has been heavily battle tested for
@@ -612,10 +612,10 @@ <h2>Language: Concurrency and Parallelism</h2>
612612
perform some computation and so on.</p><p>Because when threads are executed concurrently (or in parallel), the order of their execution is not
613613
guaranteed, we see 4 being added to the vector before 3 in the result.</p><p>Countdown latches are commonly used with initial value of 1 to "block and wait until this operation in
614614
a different thread is done".</p><h3 id="concurrent-collections">Concurrent Collections</h3><p>Most of the Java collections are mutable and were not designed for concurrency. <code>java.util.concurrent</code> includes a number of collections that
615-
are thread safe and can be used for passing data structures between threads.</p><h3 id="atomic-variables">Atomic Variables</h3><p>The <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/atomic/package-summary.html">java.util.concurrent.atomic</a> package provides
615+
are thread safe and can be used for passing data structures between threads.</p><h3 id="atomic-variables">Atomic Variables</h3><p>The <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/concurrent/atomic/package-summary.html">java.util.concurrent.atomic</a> package provides
616616
a number of data structures that support lock-free thread-safe programming on a single variable (identity). They support
617-
conditional atomic update operation (<em>compared-and-swap</em> aka <em>CAS</em>).</p><p>Some of the more popular atomic types in the <code>j.u.c.atomic</code> package are <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/atomic/AtomicBoolean.html">AtomicBoolean</a>,
618-
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/atomic/AtomicLong.html">AtomicLong</a> and <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/atomic/AtomicReference.html">AtomicReference</a>.</p><p>Atomic references are pretty well covered in Clojure with atoms but occasionally may be used by
617+
conditional atomic update operation (<em>compared-and-swap</em> aka <em>CAS</em>).</p><p>Some of the more popular atomic types in the <code>j.u.c.atomic</code> package are <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/concurrent/atomic/AtomicBoolean.html">AtomicBoolean</a>,
618+
<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/concurrent/atomic/AtomicLong.html">AtomicLong</a> and <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/concurrent/atomic/AtomicReference.html">AtomicReference</a>.</p><p>Atomic references are pretty well covered in Clojure with atoms but occasionally may be used by
619619
other libraries. An example to demonstrate how to use an atomic long for a thread-safe counter:</p><pre><code class="clojure">(let [l (AtomicLong.)]
620620
(dotimes [i 50]
621621
(.start (Thread. (fn []

‎articles/language/functions/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ <h2>Language: Functions</h2>
306306
(if (countries :in)
307307
(comment Implement positive case)
308308
(comment Implement negative case))
309-
</code></pre><p>because everything but <code>false</code> and <code>nil</code> evaluates to <code>true</code> in Clojure.</p><h2 id="clojure-functions-as-comparators">Clojure Functions As Comparators</h2><p>Clojure functions implement the <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Comparator.html">java.util.Comparator</a>
309+
</code></pre><p>because everything but <code>false</code> and <code>nil</code> evaluates to <code>true</code> in Clojure.</p><h2 id="clojure-functions-as-comparators">Clojure Functions As Comparators</h2><p>Clojure functions implement the <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Comparator.html">java.util.Comparator</a>
310310
interface and can be used as comparators.</p><p>See <a href="https://clojure.org/guides/comparators">the official Clojure guide to Comparators</a> for more details.</p><h2 id="wrapping-up">Wrapping Up</h2><p>Functions are at the heart of Clojure. They are defined using the <code>defn</code> macro, can have multiple arities,
311311
be variadic and support parameter destructuring. Function arguments and return value can optionally be
312312
type hinted.</p><p>Functions are first class values and can be passed to other functions (called Higher Order Functions or HOFs).

‎articles/language/glossary/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ <h2>Language: Glossary</h2>
210210
#-prefixed literal which causes the reader to parse the form
211211
following it using a function or macro of your own
212212
choosing/devising. It's in this way that you can <em>tag</em> a literal to be
213-
handled specially by the reader.</p><p>For more info, see <a href="http://clojure.org/reader">the "Tagged Literals" section of the reader
213+
handled specially by the reader.</p><p>For more info, see <a href="https://clojure.org/reader">the "Tagged Literals" section of the reader
214214
doc</a>.</p><h3 id="threading-macros">threading macros</h3><p>The thread-first (<code>-&gt;</code>) and thread-last (<code>-&gt;&gt;</code>) macros. "Threading"
215215
refers to how they pass values to each subsequent argument in the
216216
macro, not concurrency.</p><h3 id="thrush">thrush</h3><p>A combinator. Not the same thing as the <a href="#threading-macros">thread-first

‎articles/language/interop/index.html

Lines changed: 54 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ <h2>Language: Java Interop</h2>
6464

6565
<p>This guide covers:</p><ul><li>How to instantiate Java classes</li><li>How to invoke Java methods</li><li>How to extend Java classes with proxy</li><li>How to implement Java interfaces with reify</li><li>How to generate Java classes with gen-class</li><li>Other topics related to interop</li></ul><p>This guide does not cover how to include Java files in Clojure projects.
6666
For that, head to <a href="/articles/cookbooks/cli_build_projects/#including-java-code-in-a-clojure-project">including Java code in a Clojure project</a></p><p>This work is licensed under a <a rel="license" href="https://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 Unported License</a>
67-
(including images &amp; stylesheets). The source is available <a href="https://github.com/clojure-doc/clojure-doc.github.io">on Github</a>.</p><h2 id="what-version-of-clojure-does-this-guide-cover">What Version of Clojure Does This Guide Cover?</h2><p>This guide covers Clojure 1.11.</p><h2 id="overview">Overview</h2><p>Clojure was designed to be a hosted language that directly interoperates with its host platform (JVM, JS, CLR and so on).
67+
(including images &amp; stylesheets). The source is available <a href="https://github.com/clojure-doc/clojure-doc.github.io">on Github</a>.</p><h2 id="what-version-of-clojure-does-this-guide-cover">What Version of Clojure Does This Guide Cover?</h2><p>This guide covers Clojure 1.12.</p><h2 id="overview">Overview</h2><p>Clojure was designed to be a hosted language that directly interoperates with its host platform (JVM, JS, CLR and so on).
6868
Clojure code is compiled to JVM bytecode. For method calls on Java objects, the Clojure compiler
6969
will try to emit the same bytecode <code>javac</code> would produce.</p><p>It is possible to implement interfaces, and to extend and generate Java classes in Clojure.</p><p>Clojure also provides convenient functions and macros that make consuming Java libraries
7070
easier and often more concise than it would be in Java code.</p><p>See also the <a href="https://clojure.org/reference/java_interop">official Java interop reference</a> on clojure.org.</p><h2 id="imports">Imports</h2><p>Java classes can be referenced either using their fully-qualified names (FQNs) such as
@@ -102,17 +102,36 @@ <h2>Language: Java Interop</h2>
102102
</code></pre><p>It is possible to use fully qualified names (e.g. <code>java.util.Date</code>) or short names with imports:</p><pre><code class="clojure">(import java.util.Date)
103103

104104
(Date.) ; ⇒ #inst "2012-10-09T21:24:27.229-00:00"
105-
</code></pre><p>An example with constructor arguments:</p><pre><code class="clojure">(java.net.URI. "http://clojure.org")
106-
;;⇒ #object[java.net.URI 0x8bd076a "http://clojure.org"]
105+
</code></pre><p>As of Clojure 1.12, you can use the following syntax:</p><pre><code class="clojure">(java.util.Date/new)
106+
107+
;; or, if you have imported the class:
108+
109+
(Date/new)
110+
</code></pre><p>An example with constructor arguments:</p><pre><code class="clojure">(java.net.URI. "https://clojure.org")
111+
;;⇒ #object[java.net.URI 0x8bd076a "https://clojure.org"]
112+
113+
;; or, in Clojure 1.12:
114+
115+
(java.net.URI/new "https://clojure.org")
116+
</code></pre><p>In Clojure 1.12, <code>SomeClass/new</code> is a "function value" and can be treated like
117+
a regular Clojure function:</p><pre><code class="clojure">(map (fn [f] (f "https://clojure.org")) [java.net.URI/new count clojure.string/upper-case])
118+
;;=&gt; (#object[java.net.URI 0x7ec25216 "https://clojure.org"] 19 "HTTPS://CLOJURE.ORG")
107119
</code></pre><h2 id="how-to-invoke-java-methods">How to Invoke Java Methods</h2><h3 id="instance-methods">Instance Methods</h3><p>Instance methods are invoked using the <code>.</code> special form:</p><pre><code class="clojure">(let [d (java.util.Date.)]
108120
(. d getTime)) ; ⇒ 1349819873183
109121
</code></pre><p>Just like with object instantiation, it is much more common to see an alternative version:</p><pre><code class="clojure">(let [d (java.util.Date.)]
110122
(.getTime d)) ; ⇒ 1349819873183
123+
</code></pre><p>In Clojure 1.12, <code>SomeClass/.methodName</code> is a "function value" and can be treated like
124+
a regular Clojure function:</p><pre><code class="clojure">;; assuming (import java.util.Date):
125+
(map Date/.getTime [(Date.) (Date/new) #inst "2024-12-30"])
126+
;;⇒ (1735603851861 1735603851861 1735516800000)
111127
</code></pre><h3 id="static-methods">Static Methods</h3><p>Static methods can be invoked with the same <code>.</code> special form:</p><pre><code class="clojure">(. Math floor 5.677) ; ⇒ 5.0
112128
</code></pre><p>or (typically) the sugared version, <code>ClassName/methodName</code>:</p><pre><code class="clojure">(Math/floor 5.677) ; ⇒ 5.0
113129

114130
(Boolean/valueOf "false") ; ⇒ false
115131
(Boolean/valueOf "true") ; ⇒ true
132+
</code></pre><p>In Clojure 1.12, <code>SomeClass/.methodName</code> is a "function value" and can be treated like
133+
a regular Clojure function:</p><pre><code class="clojure">(map Boolean/valueOf ["true" "false" "what?"])
134+
;;⇒ (true false false)
116135
</code></pre><h3 id="chained-calls-with-the-double-dot-form">Chained Calls With The Double Dot Form</h3><p>It is possible to chain method calls using the <code>..</code> special form:</p><pre><code class="clojure">(.. (java.util.Date.) getTime toString) ; ⇒ "1693344712616"
117136
</code></pre><h3 id="multiple-calls-on-the-same-object">Multiple Calls On the Same Object</h3><p>If you need to call several methods on the same (mutable) object, you
118137
can use the <code>doto</code> macro:</p><pre><code class="clojure">(doto (java.util.Stack.)
@@ -124,13 +143,13 @@ <h2>Language: Java Interop</h2>
124143

125144
(let [pt (Point. 0 0)]
126145
(doto pt
127-
(.move 10 0)))
146+
(.move 10 0)))
128147
;;⇒ #object[java.awt.Point 0x1084ac45 "java.awt.Point[x=10,y=0]"]
129148

130149
(let [pt (Point. 0 0)]
131150
(doto pt
132-
(.move 10 0)
133-
(.translate 0 10)))
151+
(.move 10 0)
152+
(.translate 0 10)))
134153
;;⇒ #object[java.awt.Point 0x7bc6935c "java.awt.Point[x=10,y=10]"]
135154
</code></pre><p>Each method is called on the original object -- the first argument
136155
to <code>doto</code> -- and it returns that same object as the result.</p><h2 id="how-to-access-java-fields">How to Access Java Fields</h2><p>Public mutable fields are not common in Java libraries but sometimes you need to access them.
@@ -178,11 +197,13 @@ <h2>Language: Java Interop</h2>
178197
;; ⇒ clojure.lang.PersistentVector
179198
</code></pre><h2 id="how-to-get-a-java-class-reference-by-name">How To Get a Java Class Reference By Name</h2><p>To obtain a class reference by its string name (fully qualified), use <code>Class/forName</code> via Java interop:</p><pre><code class="clojure">(Class/forName "java.util.Date") ; ⇒ java.util.Date
180199
</code></pre><h3 id="array-types-primitives">Array Types, Primitives</h3><p>JVM has what is called <strong>primitive types</strong> (numerics, chars, booleans) that are not "real" objects.
181-
In addition, array types have pretty obscure internal names.</p><p>An array of <code>String</code>, has a name of <code>"[Ljava.lang.String;"</code>.
200+
In addition, array types have pretty obscure internal names.</p><p>An array of <code>String</code>, has an internal name of <code>"[Ljava.lang.String;"</code>.
182201
You can construct an array of <code>String</code> using <code>into-array</code>:</p><pre><code class="clojure">(class (into-array String ["foo" "bar" "baz"]))
183-
;; ⇒ [Ljava.lang.String;
184-
</code></pre><p>If you need to obtain a reference to
185-
an array of primitives, for example longs, pass <code>"[J"</code> to <code>Class/forName</code>. Below is the full table:</p><table class="table-striped table-bordered table"><thead><tr><th>Internal JVM class name</th><th>Array of ? (type)</th></tr></thead><tbody><tr><td><pre>"[S"</pre></td><td>short</td></tr><tr><td><pre>"[I"</pre></td><td>integer</td></tr><tr><td><pre>"[J"</pre></td><td>long</td></tr><tr><td><pre>"[F"</pre></td><td>float</td></tr><tr><td><pre>"[D"</pre></td><td>double</td></tr><tr><td><pre>"[B"</pre></td><td>byte</td></tr><tr><td><pre>"[C"</pre></td><td>char</td></tr><tr><td><pre>"[Z"</pre></td><td>boolean</td></tr></tbody></table><p>For convenience, Clojure has <code>*-array</code> functions for each of the above
202+
;;=&gt; java.lang.String/1 ; Clojure 1.12
203+
;; but in earlier versions of Clojure:
204+
;;⇒ [Ljava.lang.String;
205+
</code></pre><p>In Clojure 1.12, you can <code>SomeClass/N</code> to get a class reference to an N-dimensional array of the class,
206+
but prior to 1.12, you had to use <code>Class/forName</code> and the internal name of the array type:</p><table class="table-striped table-bordered table"><thead><tr><th>Internal JVM class name</th><th>Array of ? (type)</th><th>Clojure 1.12 type</th></tr></thead><tbody><tr><td><pre>"[S"</pre></td><td>short</td><td>short/1</td></tr><tr><td><pre>"[I"</pre></td><td>integer</td><td>integer/1</td></tr><tr><td><pre>"[J"</pre></td><td>long</td><td>long/1</td></tr><tr><td><pre>"[F"</pre></td><td>float</td><td>float/1</td></tr><tr><td><pre>"[D"</pre></td><td>double</td><td>double/1</td></tr><tr><td><pre>"[B"</pre></td><td>byte</td><td>byte/1</td></tr><tr><td><pre>"[C"</pre></td><td>char</td><td>char/1</td></tr><tr><td><pre>"[Z"</pre></td><td>boolean/1</td></tr></tbody></table><p>For convenience, Clojure has <code>*-array</code> functions for each of the above
186207
types that help you create an array of primitive values:</p><pre><code class="clojure">user=&gt; (char-array [\h \e \l \l \o])
187208
#object["[C" 0x7df60067 "[C@7df60067"]
188209
user=&gt; (apply str *1)
@@ -227,6 +248,16 @@ <h2>Language: Java Interop</h2>
227248
(accept [this dir]
228249
true))]
229250
(instance? java.io.FileFilter ff)) ; ⇒ true
251+
</code></pre><p>In Clojure 1.12, a Java interface that is declared <code>@FunctionalInterface</code> can
252+
be inferred from from the context and can be satisfied with a regular Clojure
253+
function. <code>java.io.FilenameFilter</code> is such an interface, so you can pass a
254+
Clojure function directly to a Java method that expects a <code>FilenameFilter</code>:</p><pre><code class="clojure">(seq (.list (java.io.File. ".") #(str/starts-with? %2 ".")))
255+
;;⇒ (".cpcache" ".portal" ".clj-kondo" ".lsp" ".calva")
256+
</code></pre><p>In earlier versions of Clojure, you would have to use <code>reify</code> for that:</p><pre><code class="clojure">(seq (.list (java.io.File. ".")
257+
(reify java.io.FilenameFilter
258+
(accept [this dir name]
259+
(str/starts-with? name ".")))))
260+
;;⇒ (".cpcache" ".portal" ".clj-kondo" ".lsp" ".calva")
230261
</code></pre><h3 id="reify-parameter-destructuring-and-varargs">reify, Parameter Destructuring and Varargs</h3><p><code>reify</code> does not support destructuring or variadic arguments in method signatures. You will not always get an error from the compiler if you try to use them, but the resulting code will not work the way you expect.
231262
For example:</p><pre><code class="clojure">(reify java.io.FilenameFilter
232263
(accept [a &amp; more]
@@ -245,7 +276,7 @@ <h2>Language: Java Interop</h2>
245276
(into [] (.listFiles dir ff)))
246277
;; ⇒ [#object[java.io.File 0x1450131a "/home/sean/oss/clojure-doc.github.io/deps.edn"]]
247278
</code></pre><p><code>reify</code> forms a closure: it will capture locals in its scope. This can be used to make implemented
248-
methods delegate to Clojure functions. The same example, rewritten with delegation:</p><pre><code class="clojure">user&gt; (import java.io.File)
279+
methods delegate to Clojure functions. The same example, rewritten with delegation:</p><pre><code class="clojure">(import java.io.File)
249280

250281
;; a file filter implementation that keeps only .edn files
251282
(let [f (fn [_dir name]
@@ -256,12 +287,15 @@ <h2>Language: Java Interop</h2>
256287
dir (File. "/home/sean/oss/clojure-doc.github.io/")]
257288
(into [] (.listFiles dir ff)))
258289
;; ⇒ [#object[java.io.File 0x5d512ddb "/home/sean/oss/clojure-doc.github.io/deps.edn"]]
259-
</code></pre><p>We have used <code>clojure.string/ends-with?</code> so that no type hints
260-
are required: unlike in the "inline" implementation (above),
261-
the Clojure compiler would not be able to infer the types of
262-
<code>_dir</code> and <code>name</code> parameters in the function that does the filtering.
263-
When methods are implemented "inline", types can be inferred from
264-
method signatures in the interface.</p><h2 id="extending-java-classes-with-proxy">Extending Java Classes With proxy</h2><p><code>proxy</code> is one of two ways to generate instances of anonymous classes in Clojure.
290+
</code></pre><p>As above, in Clojure 1.12, because <code>java.io.FilenameFilter</code> is a functional interface, you can pass a Clojure function directly:</p><pre><code class="clojure">(import java.io.File)
291+
292+
;; a file filter implementation that keeps only .edn files
293+
(let [^java.io.FilenameFilter
294+
f (fn [_dir name]
295+
(str/ends-with? name ".edn"))
296+
dir (File. "/home/sean/oss/clojure-doc.github.io/")]
297+
(into [] (.listFiles dir f)))
298+
</code></pre><blockquote><p>Note: we need the type hint on <code>f</code> here because <code>.listFiles</code> has multiple overloads for the same arity, and we need to distinguish a <code>FilenameFilter</code> from a <code>FileFilter</code>.</p></blockquote><h2 id="extending-java-classes-with-proxy">Extending Java Classes With proxy</h2><p><code>proxy</code> is one of two ways to generate instances of anonymous classes in Clojure.
265299
<code>proxy</code> takes two vectors: one listing its superclass and (optional) interfaces, the other listing constructor signatures, as well as
266300
zero or more
267301
method implementations. Method implementations are identical to <code>reify</code> except that the <code>this</code> argument is
@@ -428,7 +462,7 @@ <h2>Language: Java Interop</h2>
428462
(publish this (json/json-str { :group job-group }) "quartz.scheduler.jobs-resumed"))
429463
</code></pre><h3 id="inspecting-class-signatures">Inspecting Class Signatures</h3><p>When using <code>gen-class</code> for interoperability purposes, sometimes it is necessary to inspect the API
430464
of the class generated by <code>gen-class</code>.</p><p>It can be inspected
431-
using <a href="https://docs.oracle.com/en/java/javase/17/docs/specs/man/javap.html">javap</a>. Given the
465+
using <a href="https://docs.oracle.com/en/java/javase/21/docs/specs/man/javap.html">javap</a>. Given the
432466
following Clojure namespace:</p><pre><code class="clojure">(ns genclassy.core
433467
(:gen-class))
434468

@@ -510,7 +544,8 @@ <h2>Language: Java Interop</h2>
510544
or simply <em>monitor</em>). While very rarely necessary, Clojure provides support for
511545
operations that acquire intrinsic lock of a mutable Java object.</p><p>This is covered in the <a href="/articles/language/concurrency_and_parallelism/#using-intrinsic-locks-synchronized-in-clojure">Concurrency and Parallelism guide</a>.</p><h2 id="wrapping-up">Wrapping Up</h2><p>TBD: <a href="https://github.com/clojure-doc/clojure-doc.github.io#how-to-contribute">How to Contribute</a></p><h2 id="contributors">Contributors</h2><p>Michael Klishin <a href="mailto:michael@defprotocol.org">michael@defprotocol.org</a> (original author)
512546
Lee Hinman <a href="mailto:lee@writequit.org">lee@writequit.org</a>
513-
gsnewmark <a href="mailto:gsnewmark@meta.ua">gsnewmark@meta.ua</a></p>
547+
gsnewmark <a href="mailto:gsnewmark@meta.ua">gsnewmark@meta.ua</a>
548+
Sean Corfield <a href="mailto:sean@corfield.org">sean@corfield.org</a> (updated to Clojure 1.12)</p>
514549

515550
<div id="prev-next">
516551

‎articles/tutorials/introduction/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ <h2>Introduction to Clojure</h2>
118118
the JVM. The reader supports a few extra bits of syntactic sugar (for
119119
example, a literal syntax for specifying regular expressions) that we
120120
will cover as we go along.</p><p>Throughout this tutorial, we will liberally reference and lean on the
121-
marvelous <a href="http://clojure.org/cheatsheet">Clojure Cheatsheet</a>. Aside
121+
marvelous <a href="https://clojure.org/cheatsheet">Clojure Cheatsheet</a>. Aside
122122
from being a great organizational aide, it also handily includes links
123123
to the relevant <a href="http://clojuredocs.org/">Clojuredocs</a> pages where you
124124
can find docs for and examples of the various Clojure functions.</p><p>In the REPL, at any time you can see the documentation for a given
@@ -387,12 +387,12 @@ <h2>Introduction to Clojure</h2>
387387
(disj s :a) ; ⇒ #{:b}
388388

389389
s ; ⇒ is still #{:a :b}
390-
</code></pre><p>See the <a href="http://clojure.org/cheatsheet">cheatsheet</a> for much more
390+
</code></pre><p>See the <a href="https://clojure.org/cheatsheet">cheatsheet</a> for much more
391391
you can do with these core data structures.</p><h2 id="regular-expressions">Regular Expressions</h2><p>As you've seen, Clojure provides a handy literal syntax for regular
392392
expressions: <code>#"regex here"</code>. Clojure uses the same regular expression
393393
syntax as Java, which is nearly the same as what Perl 5 (and Python,
394394
and Ruby) uses. You can read more about the specifics in the Java
395-
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/regex/Pattern.html">java.util.regex Pattern
395+
<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/regex/Pattern.html">java.util.regex Pattern
396396
docs</a>.</p><p>Clojure provides a number of functions for working with strings, and a
397397
number of those can make use of regexes. See the next section for some
398398
examples.</p><h2 id="functions-for-working-with-strings">Functions For Working With Strings</h2><p>There are a number of functions for working with strings listed in the
@@ -467,7 +467,7 @@ <h2>Introduction to Clojure</h2>
467467
if you don't have "variables" and can't change anything, it will
468468
become clear as we continue.</p><h2 id="control-structures">Control Structures</h2><p>Clojure has most of the usual control structures you'd expect to find,
469469
for example: <code>if</code>, <code>and</code>, <code>or</code>, and <code>cond</code>. You can find them listed
470-
in the <a href="http://clojure.org/cheatsheet">Cheatsheet</a>.</p><p>Note that they are all <em>expressions</em> in Clojure, and evaluate to
470+
in the <a href="https://clojure.org/cheatsheet">Cheatsheet</a>.</p><p>Note that they are all <em>expressions</em> in Clojure, and evaluate to
471471
something. So, for example, this <code>if</code> expression:</p><pre><code class="clojure">(if motor-turning?
472472
"yes"
473473
"no")

‎cryogen.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><atom:link href="https://clojure-doc.org/" rel="self" type="application/rss+xml"/><title>Clojure Guides</title><link>https://clojure-doc.org/</link><description>Clojure Documentation</description><lastBuildDate>Mon, 30 Dec 2024 15:11:38 -0800</lastBuildDate><generator>clj-rss</generator></channel></rss>
1+
<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><atom:link href="https://clojure-doc.org/" rel="self" type="application/rss+xml"/><title>Clojure Guides</title><link>https://clojure-doc.org/</link><description>Clojure Documentation</description><lastBuildDate>Mon, 30 Dec 2024 16:50:41 -0800</lastBuildDate><generator>clj-rss</generator></channel></rss>

‎feed.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><atom:link href="https://clojure-doc.org/" rel="self" type="application/rss+xml"/><title>Clojure Guides</title><link>https://clojure-doc.org/</link><description>Clojure Documentation</description><lastBuildDate>Mon, 30 Dec 2024 15:11:38 -0800</lastBuildDate><generator>clj-rss</generator></channel></rss>
1+
<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><atom:link href="https://clojure-doc.org/" rel="self" type="application/rss+xml"/><title>Clojure Guides</title><link>https://clojure-doc.org/</link><description>Clojure Documentation</description><lastBuildDate>Mon, 30 Dec 2024 16:50:41 -0800</lastBuildDate><generator>clj-rss</generator></channel></rss>

0 commit comments

Comments
 (0)
Please sign in to comment.