Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified pdf/cheatsheet-a4-bw.pdf
Binary file not shown.
Binary file modified pdf/cheatsheet-a4-color.pdf
Binary file not shown.
Binary file modified pdf/cheatsheet-a4-grey.pdf
Binary file not shown.
Binary file modified pdf/cheatsheet-usletter-bw.pdf
Binary file not shown.
Binary file modified pdf/cheatsheet-usletter-color.pdf
Binary file not shown.
Binary file modified pdf/cheatsheet-usletter-grey.pdf
Binary file not shown.
82 changes: 82 additions & 0 deletions src/clj-jvm/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,85 @@
---------------------------------------------------------------------
April 11, 2025 - Clojure 1.9 - 1.12, sheet v57

Moved most or all functions focused on REPL development to first
section. The first section was renamed from "Documentation" to
"REPL". It has sub-sections "Documentation", "Add Libs", and "Other",
with contents described below.

First sub-section of section "REPL" is REPL / Documentation. Its
contents were formerly in a section named Documentation /
clojure.repl.

Second sub-section of section "REPL" is REPL / Add Libs. Its contents
were in a section named Other / REPL in the previous version.

Second sub-section of section "REPL" is REPL / Other. Its contents
were in a section named Other / REPL in the previous version.

---------------------------------------------------------------------
April 10, 2025 - Clojure 1.9 - 1.12, sheet v56

Made 'minimum version' Clojure 1.9, removing all (1.9) tags marking
things as new in 1.9. Tags for things new in (1.10) (1.111) are still
present, as are tags (1.12) for things new in Clojure 1.12.0.

New things for Clojure 1.12 that have _not_ been added to the sheet at
this time:

Considered as implementation details:
clojure.core.protocols/iterator-reduce!
clojure.java.basis.impl/init-basis
clojure.java.basis.impl/the-basis
clojure.java.basis.impl/update-basis!
clojure.java.process/io-task

Should these be added? If so, where?
*repl*
clojure.java.basis/current-basis
clojure.java.basis/initial-basis
clojure.tools.deps.interop/invoke-tool

New things for Clojure 1.12 that have been added to the sheet in this
version:

Added to Sequences / Seq in, Seq out / 'Change' section:

partitionv partitionv-all splitv-at

Added to Transducers / Off the Shelf section:

partitionv-all

Added to Other / REPL section:

clojure.repl.deps/add-lib
clojure.repl.deps/add-libs
clojure.repl.deps/sync-deps

Added to Other / Browser/Shell section:

clojure.java.process/exec
clojure.java.process/exit-ref
clojure.java.process/from-file
clojure.java.process/start
clojure.java.process/stderr
clojure.java.process/stdin
clojure.java.process/stdout
clojure.java.process/to-file

Removed from Other / Browser/Shell section:

clojure.java.shell/sh
clojure.java.shell/with-sh-dir
clojure.java.shell/with-sh-env

Added new Java Interoperation / Streams section containing these:

stream-into!
stream-reduce!
stream-seq!
stream-transduce!

---------------------------------------------------------------------
April 19, 2022 - Clojure 1.8 - 1.11, sheet v55

Expand Down
293 changes: 187 additions & 106 deletions src/clj-jvm/cheatsheet-embeddable-for-clojure.org.html

Large diffs are not rendered by default.

54 changes: 31 additions & 23 deletions src/clj-jvm/cheatsheet-no-tooltips-no-cdocs-summary.html

Large diffs are not rendered by default.

357 changes: 214 additions & 143 deletions src/clj-jvm/cheatsheet-tiptip-cdocs-summary.html

Large diffs are not rendered by default.

295 changes: 188 additions & 107 deletions src/clj-jvm/cheatsheet-tiptip-no-cdocs-summary.html

Large diffs are not rendered by default.

357 changes: 214 additions & 143 deletions src/clj-jvm/cheatsheet-use-title-attribute-cdocs-summary.html

Large diffs are not rendered by default.

295 changes: 188 additions & 107 deletions src/clj-jvm/cheatsheet-use-title-attribute-no-cdocs-summary.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/clj-jvm/project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.11.1"]
:dependencies [[org.clojure/clojure "1.12.0"]
[org.clojure/data.json "2.4.0"]
[org.clojure/core.async "1.5.648"]
[org.clojure/data.priority-map "1.1.0"]
Expand Down
13 changes: 9 additions & 4 deletions src/clj-jvm/src/generator/clojure_metadata_checks.clj
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
(def ^:dynamic *auto-flush* true)

;; The list below was created by starting with the list of all
;; namespaces in a Clojure 1.10.0-RC1 run, with no dependencies other
;; namespaces in a Clojure 1.12.0 run, with no dependencies other
;; than the spec ones that Clojure needs to run, using these commands:

;; $ clj -Sdeps '{:deps {org.clojure/clojure {:mvn/version "1.10.0-RC1"}}}'
;; Clojure 1.10.0-RC1
;; $ clj -Sdeps '{:deps {org.clojure/clojure {:mvn/version "1.12.0"}}}'
;; Clojure 1.12.0
;; user=> (pprint (->> (all-ns) (map str) sort))

;; That list was then augmented by grep'ing all .clj files in the
;; Clojure 1.10.0-RC2 source code for 'ns' forms. Not all namespaces
;; Clojure 1.12.0 source code for 'ns' forms. Not all namespaces
;; included in Clojure are loaded by default using the commands above.

;; See also +common-namespaces-to-remove-from-shown-symbols+
Expand All @@ -31,24 +31,29 @@
clojure.edn
clojure.inspector
clojure.instant
clojure.java.basis
clojure.java.basis.impl
clojure.java.browse
clojure.java.browse-ui
clojure.java.io
clojure.java.javadoc
clojure.java.process
clojure.java.shell
clojure.main
clojure.math
;; clojure.parallel - deprecated, so leave out
clojure.pprint
clojure.reflect
clojure.repl
clojure.repl.deps
clojure.set
clojure.stacktrace
clojure.string
clojure.template
clojure.test
clojure.test.junit
clojure.test.tap
clojure.tools.deps.interop
clojure.uuid
clojure.walk
clojure.xml
Expand Down
88 changes: 56 additions & 32 deletions src/clj-jvm/src/generator/generator.clj
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@
clojure.edn
clojure.inspector
clojure.instant
clojure.java.basis
clojure.java.browse-ui
clojure.java.process
clojure.main
clojure.math
clojure.repl.deps
clojure.spec.gen.alpha
clojure.stacktrace
clojure.template
Expand Down Expand Up @@ -135,17 +138,29 @@


(def cheatsheet-structure
[:title {:latex "Clojure Cheat Sheet (Clojure 1.8 - 1.11, sheet v55)"
:html "Clojure Cheat Sheet (Clojure 1.8 - 1.11, sheet v55)"}
[:title {:latex "Clojure Cheat Sheet (Clojure 1.9 - 1.12, sheet v57)"
:html "Clojure Cheat Sheet (Clojure 1.9 - 1.12, sheet v57)"}
:page [:column
[:box "green"
:section "Documentation"
:table [["clojure.repl/"
:cmds '[clojure.repl/doc clojure.repl/find-doc
:section "REPL"
:table [["Documentation"
:cmds '[{:latex "\\textmd{\\textsf{(clojure.repl/)}}",
:html "(clojure.repl/)"}
clojure.repl/doc clojure.repl/find-doc
clojure.repl/apropos clojure.repl/dir
clojure.repl/source
clojure.repl/pst clojure.java.javadoc/javadoc
"(foo.bar/ is namespace for later syms)"]]]
"(foo.bar/ is namespace for later syms)"]]
["Add libs"
:cmds '["(1.12)"
{:latex "\\textmd{\\textsf{(clojure.repl.deps/)}}",
:html "(clojure.repl.deps/)"}
clojure.repl.deps/add-lib
clojure.repl.deps/add-libs
clojure.repl.deps/sync-deps]]
["Other" :cmds '[*1 *2 *3 *e *print-dup* *print-length*
*print-level* *print-meta*
*print-readably*]]]
]
[:box "blue"
:section "Primitives"
Expand Down Expand Up @@ -201,8 +216,7 @@
bigdec bigint num rationalize biginteger]]
["Test" :cmds '[zero? pos? neg? even? odd? number?
rational? integer? ratio? decimal?
float?
"(1.9)" double? int? nat-int?
float? double? int? nat-int?
neg-int? pos-int?
"(1.11)" NaN? infinite?]]
["Random" :cmds '[rand rand-int
Expand Down Expand Up @@ -304,7 +318,8 @@
[:box "yellow"
:section "Collections"
:subsection "Collections"
:table [["Generic ops" :cmds '[count empty not-empty into conj
:table [["Generic ops" :cmds '[count bounded-count empty
not-empty into conj
{:latex "\\textmd{\\textsf{(clojure.walk/)}}",
:html "(clojure.walk/)"}
clojure.walk/walk
Expand All @@ -314,7 +329,6 @@
clojure.walk/postwalk
clojure.walk/postwalk-demo
clojure.walk/postwalk-replace
"(1.9)" bounded-count
]]
["Content tests" :cmds '[distinct? empty?
every? not-every? some not-any?]]
Expand Down Expand Up @@ -513,7 +527,8 @@
:cmds '[conj concat distinct flatten group-by
partition partition-all partition-by
split-at split-with filter remove
replace shuffle]]
replace shuffle
"(1.12)" partitionv partitionv-all splitv-at]]
["Rearrange" :cmds '[reverse sort sort-by compare]]
["Process items" :cmds '[map pmap map-indexed
mapcat for replace seque]]]
Expand All @@ -539,7 +554,8 @@
replace partition-by partition-all
keep keep-indexed map-indexed distinct
interpose cat dedupe random-sample
"(1.9)" halt-when]]
halt-when
"(1.12)" partitionv-all]]
["Create your own"
:cmds '[completing ensure-reduced unreduced
{:latex "\\textmd{\\textsf{See also section Concurrency/Volatiles}}",
Expand Down Expand Up @@ -631,22 +647,21 @@
:table [
["Numbers"
:cmds '[number? rational? integer? ratio? decimal?
float? zero?
"(1.9)" double? int? nat-int? neg-int? pos-int?]]
float? zero? double? int? nat-int? neg-int?
pos-int?]]
[{:latex "\\begin{tabular}[t]{@{}l@{}} Symbols, \\\\ keywords \\end{tabular}"
:html "Symbols, keywords"}
:cmds '[keyword? symbol? "(1.9)" ident? qualified-ident?
:cmds '[keyword? symbol? ident? qualified-ident?
qualified-keyword? qualified-symbol?
simple-ident? simple-keyword? simple-symbol?]]
[{:latex "\\begin{tabular}[t]{@{}l@{}} Other \\\\ scalars \\end{tabular}"
:html "Other scalars"}
:cmds '[string? true? false? nil? some?
"(1.9)" boolean? bytes? inst? uri? uuid?]]
boolean? bytes? inst? uri? uuid?]]
["Collections"
:cmds '[list? map? set? vector? associative? coll?
sequential? seq? empty?
"(1.9)" indexed? seqable?]]
["Other" :cmds '["(1.9)" any?]]]
sequential? seq? empty? indexed? seqable?]]
["Other" :cmds '[any?]]]
]
[:box "magenta"
:section "IO"
Expand Down Expand Up @@ -1021,7 +1036,7 @@
:html "<a href=\"https://clojure.org/reference/reader#map_namespace_syntax\">map namespace syntax</a> e.g. <code>#:foo{:a 1}</code> is equal to <code>{:foo/a 1}</code>"}]]
[{:latex "\\cmd{\\#\\#}",
:html "<code>##</code>"}
:cmds '["(1.9) symbolic values:"
:cmds '["symbolic values:"
{:latex "\\cmd{\\#\\#Inf \\#\\#-Inf \\#\\#NaN}",
:html "<code>##Inf ##-Inf ##NaN<code>"}]]
[{:latex "\\cmd{\\$}",
Expand Down Expand Up @@ -1174,7 +1189,7 @@
[:box "magenta"
:section "Concurrency"
:table [["Atoms" :cmds '[atom swap! reset! compare-and-set!
"(1.9)" swap-vals! reset-vals!]]
swap-vals! reset-vals!]]
["Futures" :cmds '[future
[:common-prefix future-
call done? cancel cancelled?]
Expand Down Expand Up @@ -1228,14 +1243,18 @@
["Exceptions" :cmds '[throw try catch finally
clojure.repl/pst ex-info ex-data
Throwable->map
"(1.9)" StackTraceElement->vec
StackTraceElement->vec
"(1.10)" ex-cause ex-message
{:latex "\\textmd{\\textsf{(clojure.main/)}}",
:html "(clojure.main/)"}
clojure.main/ex-triage
clojure.main/ex-str
clojure.main/err->msg
clojure.main/report-error]]]
clojure.main/report-error]]
["Streams" :cmds '["(1.12)"
stream-into! stream-reduce!
stream-seq! stream-transduce!]]
]
:subsection "Arrays"
:table [["Create" :cmds '[make-array
[:common-suffix -array object
Expand Down Expand Up @@ -1285,9 +1304,6 @@
[:box "green2"
:section "Other"
:table [["XML" :cmds '[clojure.xml/parse xml-seq]]
["REPL" :cmds '[*1 *2 *3 *e *print-dup* *print-length*
*print-level* *print-meta*
*print-readably*]]
["Code" :cmds '[*compile-files* *compile-path* *file*
*warn-on-reflection* compile
loaded-libs test]]
Expand All @@ -1299,11 +1315,17 @@
:cmds '[{:latex "\\textmd{\\textsf{(clojure.java.browse/)}}",
:html "(clojure.java.browse/)"}
clojure.java.browse/browse-url
{:latex "\\textmd{\\textsf{(clojure.java.shell/)}}",
:html "(clojure.java.shell/)"}
clojure.java.shell/sh
clojure.java.shell/with-sh-dir
clojure.java.shell/with-sh-env]]]
"(1.12)"
{:latex "\\textmd{\\textsf{(clojure.java.process/)}}",
:html "(clojure.java.process/)"}
clojure.java.process/exec
clojure.java.process/exit-ref
clojure.java.process/from-file
clojure.java.process/start
clojure.java.process/stderr
clojure.java.process/stdin
clojure.java.process/stdout
clojure.java.process/to-file]]]
]
; [:footer
; tbd
Expand Down Expand Up @@ -1631,7 +1653,7 @@


(def latex-a4-header-before-title
(str "\\documentclass[footinclude=false,twocolumn,DIV40,fontsize=6.1pt]{scrreprt}\n"
(str "\\documentclass[footinclude=false,twocolumn,DIV40,fontsize=6.0pt]{scrreprt}\n"
latex-header-except-documentclass))

;; US letter is a little shorter, so formatting gets completely messed
Expand Down Expand Up @@ -1877,11 +1899,13 @@ document.write('<style type=\"text/css\">%s<\\/style>')
"clojure.java.browse/"
"clojure.java.io/"
"clojure.java.javadoc/"
"clojure.java.process/"
"clojure.java.shell/"
"clojure.main/"
"clojure.math/"
"clojure.pprint/"
"clojure.repl/"
"clojure.repl.deps/"
"clojure.set/"
"clojure.spec.alpha/"
"clojure.string/"
Expand Down