├── .gitignore ├── pdf ├── cheatsheet-a4-bw.pdf ├── cljs-cheatsheet.pdf ├── cheatsheet-a4-grey.pdf ├── cheatsheet-a4-color.pdf ├── cheatsheet-usletter-bw.pdf ├── cheatsheet-usletter-color.pdf └── cheatsheet-usletter-grey.pdf ├── src ├── clj-jvm │ ├── revert-html-files.sh │ ├── scripts │ │ ├── clj-meta-checks.sh │ │ └── run.sh │ ├── deps.edn │ ├── project.clj │ ├── resources │ │ └── inline.css │ ├── cheatsheet_files │ │ ├── tipTip.css │ │ ├── jquery.tipTip.js │ │ ├── style.css │ │ └── jquery.js │ ├── test │ │ └── generator │ │ │ └── core_test.clj │ ├── scratch.clj │ ├── src │ │ └── generator │ │ │ └── clojure_metadata_checks.clj │ ├── README.markdown │ ├── unused-symbols.txt │ ├── TODO.txt │ └── CHANGELOG.txt └── cljs-cheatsheet.tex └── README.markdown /.gitignore: -------------------------------------------------------------------------------- 1 | src/*.aux 2 | src/*.log 3 | src/*.pdf 4 | src/*.gz 5 | 6 | -------------------------------------------------------------------------------- /pdf/cheatsheet-a4-bw.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clojure/clojure-cheatsheets/master/pdf/cheatsheet-a4-bw.pdf -------------------------------------------------------------------------------- /pdf/cljs-cheatsheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clojure/clojure-cheatsheets/master/pdf/cljs-cheatsheet.pdf -------------------------------------------------------------------------------- /pdf/cheatsheet-a4-grey.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clojure/clojure-cheatsheets/master/pdf/cheatsheet-a4-grey.pdf -------------------------------------------------------------------------------- /pdf/cheatsheet-a4-color.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clojure/clojure-cheatsheets/master/pdf/cheatsheet-a4-color.pdf -------------------------------------------------------------------------------- /pdf/cheatsheet-usletter-bw.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clojure/clojure-cheatsheets/master/pdf/cheatsheet-usletter-bw.pdf -------------------------------------------------------------------------------- /pdf/cheatsheet-usletter-color.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clojure/clojure-cheatsheets/master/pdf/cheatsheet-usletter-color.pdf -------------------------------------------------------------------------------- /pdf/cheatsheet-usletter-grey.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clojure/clojure-cheatsheets/master/pdf/cheatsheet-usletter-grey.pdf -------------------------------------------------------------------------------- /src/clj-jvm/revert-html-files.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | git checkout cheatsheet-embeddable-for-clojure.org.html cheatsheet-no-tooltips-no-cdocs-summary.html cheatsheet-tiptip-cdocs-summary.html cheatsheet-tiptip-no-cdocs-summary.html cheatsheet-use-title-attribute-cdocs-summary.html cheatsheet-use-title-attribute-no-cdocs-summary.html 4 | -------------------------------------------------------------------------------- /src/clj-jvm/scripts/clj-meta-checks.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | #clojure -X generator.clojure-metadata-checks/print-results 4 | 5 | # Some of the new public Vars that have been added in recent releases 6 | # of Clojure, but do not have :added metadata, are reported in this 7 | # Clojure JIRA: https://clojure.atlassian.net/browse/CLJ-2601 8 | 9 | set -x 10 | for ver in 1.6.0 1.7.0 1.8.0 1.9.0 1.10.3 1.11.1 11 | do 12 | clojure -Sdeps "{:deps {org.clojure/clojure {:mvn/version \"${ver}\"}}}" -M --main generator.clojure-metadata-checks > check-${ver}.txt 13 | done 14 | -------------------------------------------------------------------------------- /src/clj-jvm/deps.edn: -------------------------------------------------------------------------------- 1 | {:paths ["src" "resources"] 2 | :deps {org.clojure/data.json {:mvn/version "2.4.0"} 3 | org.clojure/core.async {:mvn/version "1.5.648"} 4 | org.clojure/data.priority-map {:mvn/version "1.1.0"} 5 | org.clojure/data.avl {:mvn/version "0.1.0"} 6 | org.clojure/data.int-map {:mvn/version "1.0.0"} 7 | org.clojure/tools.reader {:mvn/version "1.3.6"} 8 | org.flatland/ordered {:mvn/version "1.15.10"} 9 | org.flatland/useful {:mvn/version "0.11.6"} 10 | org.clojure/test.check {:mvn/version "1.1.1"}}} 11 | -------------------------------------------------------------------------------- /README.markdown: -------------------------------------------------------------------------------- 1 | # clojure-cheatsheets 2 | 3 | Clojure cheatsheets in HTML, PDF, and TeX formats. 4 | 5 | See [https://jafingerhut.github.io](https://jafingerhut.github.io) for 6 | several variants of the HTML cheatsheet for Clojure on the JVM. 7 | 8 | ## License 9 | 10 | Copyright (C) 2012-2022 Michael Fogus, Andy Fingerhut 11 | 12 | Distributed under the Eclipse Public License, the same as Clojure, 13 | except for the following parts. 14 | 15 | The TipTip jQuery Plugin, slightly modified from the version 16 | distributed here by Drew Wilson, dual licensed under the MIT and GPL 17 | licenses: 18 | 19 | http://code.drewwilson.com/entry/tiptip-jquery-plugin 20 | 21 | jQuery is distributed under either the MIT or GPL version 2 license: 22 | 23 | http://jquery.org/license 24 | -------------------------------------------------------------------------------- /src/clj-jvm/project.clj: -------------------------------------------------------------------------------- 1 | (defproject generator "0.1.0" 2 | :description "FIXME: write description" 3 | :url "http://example.com/FIXME" 4 | :license {:name "Eclipse Public License" 5 | :url "http://www.eclipse.org/legal/epl-v10.html"} 6 | :dependencies [[org.clojure/clojure "1.11.1"] 7 | [org.clojure/data.json "2.4.0"] 8 | [org.clojure/core.async "1.5.648"] 9 | [org.clojure/data.priority-map "1.1.0"] 10 | [org.clojure/data.avl "0.1.0"] 11 | [org.clojure/data.int-map "1.0.0"] 12 | [org.clojure/tools.reader "1.3.6"] 13 | [org.flatland/ordered "1.15.10"] 14 | [org.flatland/useful "0.11.6"] 15 | [org.clojure/test.check "1.1.1"]] 16 | :main generator.generator) 17 | -------------------------------------------------------------------------------- /src/clj-jvm/resources/inline.css: -------------------------------------------------------------------------------- 1 | code { 2 | font-family: monospace; 3 | } 4 | 5 | .page { 6 | page-break-after: always; 7 | page-break-inside: avoid; 8 | } 9 | 10 | .column { 11 | float: left; 12 | padding: 0; 13 | margin: 0; 14 | width: 50%; 15 | } 16 | 17 | .column:first-child { 18 | clear: both; 19 | } 20 | 21 | .header { 22 | text-align: center; 23 | } 24 | 25 | .header h2 { 26 | font-style: italic; 27 | } 28 | 29 | h1 { 30 | font-size: 1.8em; 31 | } 32 | 33 | h2 { 34 | font-size: 1.4em; 35 | } 36 | 37 | h3 { 38 | font-size: 1.2em; 39 | } 40 | 41 | .section { 42 | background-color: #ebebeb; 43 | margin: 0.5em; 44 | padding: 0 0.5em 0.5em; 45 | } 46 | 47 | table { 48 | width: 100%; 49 | border-collapse: collapse; 50 | } 51 | 52 | td, .single_row { 53 | vertical-align: top; 54 | padding: 0 0.5em; 55 | } 56 | 57 | tr.odd, .single_row { 58 | background-color: #f5f5f5; 59 | } 60 | 61 | tr.even { 62 | background-color: #fafafa; 63 | } 64 | 65 | .footer { 66 | float: right; 67 | text-align: right; 68 | border-top: 1px solid gray; 69 | } 70 | 71 | #foot { 72 | clear: both; 73 | } 74 | -------------------------------------------------------------------------------- /src/clj-jvm/cheatsheet_files/tipTip.css: -------------------------------------------------------------------------------- 1 | /* TipTip CSS - Version 1.2 */ 2 | 3 | #tiptip_holder { 4 | display: none; 5 | position: absolute; 6 | top: 0; 7 | left: 0; 8 | z-index: 99999; 9 | } 10 | 11 | #tiptip_holder.tip_top { 12 | padding-bottom: 15px; 13 | } 14 | 15 | #tiptip_holder.tip_bottom { 16 | padding-top: 15px; 17 | } 18 | 19 | #tiptip_holder.tip_right { 20 | padding-left: 15px; 21 | } 22 | 23 | #tiptip_holder.tip_left { 24 | padding-right: 15px; 25 | } 26 | 27 | #tiptip_content { 28 | font-size: 12px; 29 | color: #fff; 30 | text-shadow: 0 0 2px #000; 31 | padding: 4px 8px; 32 | border: 1px solid rgba(255,255,255,0.25); 33 | background-color: rgb(35,35,35); 34 | border-radius: 3px; 35 | -webkit-border-radius: 3px; 36 | -moz-border-radius: 3px; 37 | box-shadow: 0 0 3px #555; 38 | -webkit-box-shadow: 0 0 3px #555; 39 | -moz-box-shadow: 0 0 3px #555; 40 | width: 580px; 41 | } 42 | 43 | #tiptip_arrow, #tiptip_arrow_inner { 44 | position: absolute; 45 | border-color: transparent; 46 | border-style: solid; 47 | border-width: 6px; 48 | height: 0; 49 | width: 0; 50 | } 51 | 52 | #tiptip_holder.tip_top #tiptip_arrow { 53 | border-top-color: #fff; 54 | } 55 | 56 | #tiptip_holder.tip_bottom #tiptip_arrow { 57 | border-bottom-color: #fff; 58 | } 59 | 60 | #tiptip_holder.tip_right #tiptip_arrow { 61 | border-right-color: #fff; 62 | } 63 | 64 | #tiptip_holder.tip_left #tiptip_arrow { 65 | border-left-color: #fff; 66 | } 67 | 68 | #tiptip_holder.tip_top #tiptip_arrow_inner { 69 | margin-top: -7px; 70 | margin-left: -6px; 71 | border-top-color: rgb(25,25,25); 72 | } 73 | 74 | #tiptip_holder.tip_bottom #tiptip_arrow_inner { 75 | margin-top: -5px; 76 | margin-left: -6px; 77 | border-bottom-color: rgb(25,25,25); 78 | } 79 | 80 | #tiptip_holder.tip_right #tiptip_arrow_inner { 81 | margin-top: -6px; 82 | margin-left: -5px; 83 | border-right-color: rgb(25,25,25); 84 | } 85 | 86 | #tiptip_holder.tip_left #tiptip_arrow_inner { 87 | margin-top: -6px; 88 | margin-left: -7px; 89 | border-left-color: rgb(25,25,25); 90 | } 91 | 92 | /* Webkit Hacks */ 93 | @media screen and (-webkit-min-device-pixel-ratio:0) { 94 | #tiptip_content { 95 | padding: 4px 8px 5px 8px; 96 | background-color: rgba(45,45,45,1.0); 97 | } 98 | #tiptip_holder.tip_bottom #tiptip_arrow_inner { 99 | border-bottom-color: rgba(45,45,45,1.0); 100 | } 101 | #tiptip_holder.tip_top #tiptip_arrow_inner { 102 | border-top-color: rgba(20,20,20,1.0); 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /src/clj-jvm/scripts/run.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | CMD="lein run" 4 | 5 | set -x 6 | 7 | # 3 choices for links: none, to clojure.github.org, or to 8 | # clojuredocs.org: 9 | 10 | #LINK_TARGET=nolinks 11 | #LINK_TARGET=links-to-clojure 12 | LINK_TARGET=links-to-clojuredocs 13 | #LINK_TARGET=links-to-grimoire 14 | 15 | TOOLTIPS=no-tooltips 16 | #TOOLTIPS=use-title-attribute 17 | #TOOLTIPS=tiptip 18 | 19 | CLOJUREDOCS_SNAPSHOT="" 20 | #CLOJUREDOCS_SNAPSHOT="$clojuredocs-snapshot.edn" 21 | 22 | # Optionally produce PDF files by running LaTeX. See README.markdown 23 | # for notes on what parts of LaTeX are enough for this to work. 24 | 25 | #PRODUCE_PDF="no" 26 | PRODUCE_PDF="yes" 27 | 28 | ###################################################################### 29 | # Make embeddable version for clojure.org/cheatsheet 30 | ###################################################################### 31 | echo "Generating embeddable version for clojure.org/cheatsheet ..." 32 | ${CMD} links-to-clojuredocs use-title-attribute 33 | EXIT_STATUS=$? 34 | 35 | if [ ${EXIT_STATUS} != 0 ] 36 | then 37 | echo "Exit status ${EXIT_STATUS} from ${CMD}" 38 | exit ${EXIT_STATUS} 39 | fi 40 | /bin/mv cheatsheet-embeddable.html cheatsheet-embeddable-for-clojure.org.html 41 | 42 | if [ ${PRODUCE_PDF} == "yes" ] 43 | then 44 | for PAPER in a4 usletter 45 | do 46 | for COLOR in color grey bw 47 | do 48 | BASENAME="cheatsheet-${PAPER}-${COLOR}" 49 | latex ${BASENAME} 50 | dvipdfm ${BASENAME} 51 | 52 | # Clean up some files created by latex 53 | /bin/rm -f ${BASENAME}.aux ${BASENAME}.dvi ${BASENAME}.log ${BASENAME}.out 54 | done 55 | done 56 | /bin/mv *.pdf ../../pdf 57 | fi 58 | 59 | # Useful to uncomment this, to generate LaTeX and PDF only, for faster 60 | # iteration on problems with LaTeX files. 61 | #exit 0 62 | 63 | ###################################################################### 64 | # Make multiple full versions for those who prefer something else, 65 | # e.g. no tooltips. 66 | ###################################################################### 67 | for TOOLTIPS in tiptip use-title-attribute no-tooltips 68 | do 69 | for CDOCS_SUMMARY in cdocs-summary no-cdocs-summary 70 | do 71 | case "${CDOCS_SUMMARY}" in 72 | no-cdocs-summary) CLOJUREDOCS_SNAPSHOT="" 73 | ;; 74 | cdocs-summary) CLOJUREDOCS_SNAPSHOT="clojuredocs-export.json" 75 | ;; 76 | esac 77 | TARGET="cheatsheet-${TOOLTIPS}-${CDOCS_SUMMARY}.html" 78 | echo "Generating ${TARGET} ..." 79 | ${CMD} ${LINK_TARGET} ${TOOLTIPS} ${CLOJUREDOCS_SNAPSHOT} 80 | EXIT_STATUS=$? 81 | 82 | if [ ${EXIT_STATUS} != 0 ] 83 | then 84 | echo "Exit status ${EXIT_STATUS} from ${CMD}" 85 | exit ${EXIT_STATUS} 86 | fi 87 | /bin/mv cheatsheet-full.html cheatsheet-${TOOLTIPS}-${CDOCS_SUMMARY}.html 88 | # Uncomment following line if you want to test new changes 89 | # with generating only the first variant of the cheatsheet. 90 | #exit 0 91 | done 92 | done 93 | -------------------------------------------------------------------------------- /src/clj-jvm/test/generator/core_test.clj: -------------------------------------------------------------------------------- 1 | (ns generator.core-test 2 | (:require [clojure.test :refer :all] 3 | [generator.core :refer :all])) 4 | 5 | 6 | (deftest test-table-cmds-to-str 7 | (doseq [expand? [false true]] 8 | (let [most-opts {:fmt :html 9 | :colors :color 10 | :symbol-name-to-url (hash-from-pairs 11 | (symbol-url-pairs :links-to-grimoire)) 12 | :tooltips :no-tooltips 13 | :clojuredocs-snapshot {} 14 | } 15 | opts (merge most-opts 16 | {:expand-common-prefixes-or-suffixes expand?})] 17 | 18 | (testing (str "expand? " expand? " String that is not a symbol. Should pass through unchanged.") 19 | (is (= (table-cmds-to-str opts "(1.6)") 20 | "(1.6)"))) 21 | 22 | (testing (str "expand? " expand? " Single symbol that is a clojure.core var. Gets a URL associated with it.") 23 | (is (= (table-cmds-to-str opts 'bit-and) 24 | "bit-and"))) 25 | 26 | (testing (str "expand? " expand? " Several symbols with :common-prefix") 27 | (is (= (table-cmds-to-str opts '[:common-prefix bit- and or]) 28 | (if expand? 29 | (str "bit-and" 30 | " " 31 | "bit-or") 32 | (str "bit-" 33 | "{" 34 | "and" 35 | ", " 36 | "or" 37 | "}"))))) 38 | 39 | (testing (str "expand? " expand? " Several symbols with :common-suffix") 40 | (is (= (table-cmds-to-str 41 | opts '[:common-suffix -thread-bindings get push]) 42 | (if expand? 43 | (str "get-thread-bindings" 44 | " " 45 | "push-thread-bindings") 46 | (str "{" 47 | "get" 48 | ", " 49 | "push" 50 | "}" 51 | "-thread-bindings"))))) 52 | 53 | (testing (str "expand? " expand? " Several symbols with :common-prefix-suffix") 54 | (is (= (table-cmds-to-str 55 | opts '[:common-prefix-suffix unchecked- -int add dec]) 56 | (if expand? 57 | (str "unchecked-add-int" 58 | " " 59 | "unchecked-dec-int") 60 | (str "unchecked-" 61 | "{" 62 | "add" 63 | ", " 64 | "dec" 65 | "}" 66 | "-int"))))) 67 | ))) 68 | -------------------------------------------------------------------------------- /src/clj-jvm/scratch.clj: -------------------------------------------------------------------------------- 1 | (require '[generator.core :as g] 2 | '[clojure.data.json :as json] 3 | '[clojure.string :as str] 4 | '[clojure.java.io :as io]) 5 | 6 | (pprint (ns-publics 'clojure.data.json)) 7 | (doc json/read-json) 8 | (doc sorted-set) 9 | 10 | (pst) 11 | 12 | (def fname1 "clojuredocs-snapshot.edn") 13 | (def d1 (g/read-safely fname1)) 14 | 15 | (def fname5 "clojuredocs-export.json") 16 | (def d5 (json/read-json (io/reader fname5))) 17 | 18 | (:created-at d5) 19 | (def java-date (java.util.Date. (:created-at d5))) 20 | java-date 21 | ;; This is the format that :snapshot-time is in clojuredocs-snapshot.edn 22 | ;; {:snapshot-time "Fri Aug 29 06:53:55 PDT 2014", 23 | (.getDay java-date) 24 | (.getMonth java-date) 25 | (.getHours java-date) 26 | (.toGMTString java-date) 27 | ;; "20 Nov 2018 23:55:16 GMT" 28 | (.toLocaleString java-date) 29 | ;; "Nov 20, 2018, 3:55:16 PM" 30 | (.toString java-date) 31 | ;; "Tue Nov 20 15:55:16 PST 2018" 32 | (def java-inst (.toInstant java-date)) 33 | java-inst 34 | ;; #object[java.time.Instant 0x20d059cb "2018-11-20T23:55:16.890Z"] 35 | (def utc-zoneoffset java.time.ZoneOffset/UTC) 36 | utc-zoneoffset 37 | 38 | (def java-zoneddatetime (.atZone java-inst utc-zoneoffset)) 39 | (.toString java-zoneddatetime) 40 | (def formatter (java.time.format.DateTimeFormatter/ofPattern "EEE MMM dd HH:mm:ss yyyy")) 41 | (.format java-zoneddatetime formatter) 42 | 43 | (java.time.ZoneOffset/of "-8") 44 | 45 | 46 | (def snap-time (g/epoch-millis->utc-time-date-string (:created-at d5))) 47 | snap-time 48 | (def snap-time2 (g/simplify-time-str snap-time)) 49 | snap-time2 50 | 51 | (def sym-info (update-in (nth (:vars d5) 3) 52 | [:see-alsos] add-see-also-names)) 53 | 54 | (g/clojuredocs-content-summary snap-time2 sym-info) 55 | 56 | (def d5b (g/read-clojuredocs-export-json fname5)) 57 | 58 | (g/epoch-millis->utc-time-date-string 1542758116890) 59 | ;; "Tue Nov 20 23:55:16 Z 2018" 60 | (g/epoch-millis->utc-time-date-string 1577062122059) 61 | ;; "Mon Dec 23 00:48:42 Z 2019" 62 | 63 | (re-find #"^(\S+ \S+ \d+)\s+.*\s+(\d+)$" s1) 64 | 65 | (defn remove-uninteresting-keys [x] 66 | (dissoc x :added :file :line :column 67 | :macro :special-form :static :dynamic 68 | :arglists :forms :deprecated :tag :type :url)) 69 | 70 | (def d5b (assoc d5 :vars (mapv remove-uninteresting-keys (:vars d5)))) 71 | (frequencies (map (fn [x] (apply sorted-set (keys x))) (:vars d5b))) 72 | 73 | (type (first (:vars d5))) 74 | (keys (first (:vars d5))) 75 | (keys (dissoc (first (:vars d5)) :href :arglists)) 76 | (keys (remove-uninteresting-keys (first (:vars d5)))) 77 | 78 | (frequencies (map (fn [x] (:type x)) (:vars d5))) 79 | (frequencies (map (fn [x] (type (:column x))) (:vars d5b))) 80 | ;; {"var" 146, "function" 1065, "macro" 185} 81 | 82 | 83 | (keys d5) 84 | (frequencies (map (fn [x] (type (:column x))) (:vars d5b))) 85 | 86 | (def fname2 "export.edn") 87 | (def fname3 "export.compact.edn") 88 | (def fname4 "export.compact.min.edn") 89 | (def d2 (g/read-safely fname2)) 90 | (def d3 (g/read-safely fname3)) 91 | (def d4 (g/read-safely fname4)) 92 | (= d3 d4) 93 | ;; true 94 | 95 | (count d1) 96 | (keys d1) 97 | (def d2 (-> d1 :snapshot-info)) 98 | (type d2) 99 | ;; map 100 | (count d2) 101 | 102 | (frequencies (map type (keys d2))) 103 | ;; {java.lang.String 3574} 104 | 105 | (frequencies (map type (vals d2))) 106 | ;; {clojure.lang.PersistentArrayMap 3574} 107 | 108 | (frequencies (map (fn [m] (-> m keys set)) (vals d2))) 109 | ;; {#{:ns :name :comments :see-alsos :examples :id :url} 3574} 110 | 111 | (frequencies (map (fn [m] (-> m :ns type)) (vals d2))) 112 | ;; {java.lang.String 3574} 113 | 114 | (frequencies (map (fn [m] (-> m :name type)) (vals d2))) 115 | ;; {java.lang.String 3574} 116 | 117 | (frequencies (map (fn [m] (-> m :comments type)) (vals d2))) 118 | ;; {clojure.lang.PersistentVector 3444, clojure.lang.PersistentList 130} 119 | 120 | (def nec (filter #(not (empty? %)) (map (fn [m] (-> m :comments)) (vals d2)))) 121 | (count nec) 122 | 123 | (pprint (take 3 nec)) 124 | (frequencies (map count nec)) 125 | -------------------------------------------------------------------------------- /src/clj-jvm/src/generator/clojure_metadata_checks.clj: -------------------------------------------------------------------------------- 1 | (ns generator.clojure-metadata-checks) 2 | 3 | (set! *warn-on-reflection* true) 4 | 5 | 6 | 7 | (def ^:dynamic *auto-flush* true) 8 | 9 | ;; The list below was created by starting with the list of all 10 | ;; namespaces in a Clojure 1.10.0-RC1 run, with no dependencies other 11 | ;; than the spec ones that Clojure needs to run, using these commands: 12 | 13 | ;; $ clj -Sdeps '{:deps {org.clojure/clojure {:mvn/version "1.10.0-RC1"}}}' 14 | ;; Clojure 1.10.0-RC1 15 | ;; user=> (pprint (->> (all-ns) (map str) sort)) 16 | 17 | ;; That list was then augmented by grep'ing all .clj files in the 18 | ;; Clojure 1.10.0-RC2 source code for 'ns' forms. Not all namespaces 19 | ;; included in Clojure are loaded by default using the commands above. 20 | 21 | ;; See also +common-namespaces-to-remove-from-shown-symbols+ 22 | 23 | (def all-clojure-built-in-namespaces 24 | '[clojure.core 25 | clojure.core.protocols 26 | clojure.core.reducers 27 | clojure.core.server 28 | clojure.core.specs.alpha 29 | clojure.data 30 | clojure.datafy 31 | clojure.edn 32 | clojure.inspector 33 | clojure.instant 34 | clojure.java.browse 35 | clojure.java.browse-ui 36 | clojure.java.io 37 | clojure.java.javadoc 38 | clojure.java.shell 39 | clojure.main 40 | clojure.math 41 | ;; clojure.parallel - deprecated, so leave out 42 | clojure.pprint 43 | clojure.reflect 44 | clojure.repl 45 | clojure.set 46 | clojure.stacktrace 47 | clojure.string 48 | clojure.template 49 | clojure.test 50 | clojure.test.junit 51 | clojure.test.tap 52 | clojure.uuid 53 | clojure.walk 54 | clojure.xml 55 | clojure.zip 56 | 57 | ;; These are not built into Clojure itself, but _are_ depended on 58 | ;; by Clojure 59 | clojure.spec.alpha 60 | clojure.spec.gen.alpha 61 | ]) 62 | 63 | 64 | (defn printf-to-writer [w fmt-str & args] 65 | (binding [*out* w] 66 | (apply clojure.core/printf fmt-str args) 67 | (when *auto-flush* (flush)))) 68 | 69 | 70 | (defn iprintf [fmt-str-or-writer & args] 71 | (if (instance? CharSequence fmt-str-or-writer) 72 | (apply printf-to-writer *out* fmt-str-or-writer args) 73 | (apply printf-to-writer fmt-str-or-writer args))) 74 | 75 | 76 | (defn public-vars-in-ns [ns] 77 | (vals (ns-publics ns))) 78 | 79 | (defn all-loaded-public-vars [] 80 | (mapcat public-vars-in-ns (all-ns))) 81 | 82 | (defn try-require-nss [nss] 83 | (loop [nss nss 84 | ret []] 85 | (if-let [s (seq nss)] 86 | (let [err (try 87 | (require (first s)) 88 | nil 89 | (catch Exception e 90 | e))] 91 | (recur (rest s) (conj ret {:ns (first s), 92 | :err err}))) 93 | ret))) 94 | 95 | (defn print-results [m] 96 | (let [wrtr *out*] 97 | (iprintf wrtr "Clojure version: %s\n" (clojure-version)) 98 | (iprintf wrtr "Requiring namespaces ...\n") 99 | (let [nss-results (try-require-nss all-clojure-built-in-namespaces) 100 | _ (doseq [{:keys [ns err]} nss-results] 101 | (iprintf wrtr " %s ... %s\n" 102 | ns (if err "exception" "ok"))) 103 | nss-successfully-loaded (->> nss-results 104 | (filter #(nil? (:err %))) 105 | (map :ns)) 106 | all-ns-names-sorted (->> (all-ns) (map str) sort) 107 | public-var-no-docstring (remove #(contains? (meta %) :doc) 108 | (all-loaded-public-vars)) 109 | public-builtin-vars-no-added-meta (remove #(contains? (meta %) :added) 110 | (mapcat public-vars-in-ns nss-successfully-loaded))] 111 | (iprintf wrtr "\n\nSorted list of %d namespace names currently existing:\n\n" 112 | (count all-ns-names-sorted)) 113 | (doseq [s all-ns-names-sorted] 114 | (iprintf wrtr "%s\n" s)) 115 | (iprintf wrtr "\n\nSorted list of %d public Vars in all currently loaded namespaces that have no doc string:\n\n" 116 | (count public-var-no-docstring)) 117 | (doseq [var (sort-by str public-var-no-docstring)] 118 | (iprintf wrtr "%s\n" var)) 119 | (iprintf wrtr "\n\nSorted list of %d public Vars in namespaces built into Clojure that has no :added metadata:\n\n" 120 | (count public-builtin-vars-no-added-meta)) 121 | (doseq [var (sort-by str public-builtin-vars-no-added-meta)] 122 | (iprintf wrtr "%s\n" var))))) 123 | 124 | (defn -main [& args] 125 | (print-results {})) 126 | 127 | (comment 128 | 129 | (clojure-version) 130 | (require '[generator.clojure-metadata-checks :as mc]) 131 | (use 'clojure.pprint) 132 | (use 'clojure.repl) 133 | (in-ns 'generator.clojure-metadata-checks) 134 | (print-results {}) 135 | (pst) 136 | 137 | (map class all-clojure-built-in-namespaces) 138 | (nth all-clojure-built-in-namespaces 1) 139 | (pprint (sort-by str (all-ns))) 140 | 141 | (def sym1 'clojure.data) 142 | (require sym1) 143 | 144 | (doseq [sym '[clojure.core.reducers]] 145 | (println " " sym "...") 146 | (require sym)) 147 | 148 | ) 149 | -------------------------------------------------------------------------------- /src/clj-jvm/README.markdown: -------------------------------------------------------------------------------- 1 | # Clojure/Java cheat sheet generator 2 | 3 | The program `src/generator/generator.clj` and accompanying shell script 4 | `./scripts/run.sh` can generate HTML and LaTeX versions of the Clojure/Java 5 | cheat sheet. A suitable LaTeX installation on your computer can then 6 | be used to generate PDF files as well. They are all generated with 7 | structure and symbols specified in the value of `cheatsheet-structure` 8 | in the Clojure source file. They contain clickable links to the 9 | documentation on either [clojure.github.com][clojure github] or 10 | [clojuredocs.org][clojuredocs] (or no links at all). 11 | 12 | [clojure github]: http://clojure.github.com 13 | [clojuredocs]: http://clojuredocs.org 14 | 15 | 16 | # Installation 17 | 18 | ## For Ubuntu 18.04 or 20.04 Linux 19 | 20 | Starting from a minimal Ubuntu 18.04 or 20.04 Linux installation, here 21 | is what you need to install in order to run the cheatsheet generator. 22 | 23 | + Some version of the JDK, e.g. OpenJDK 11 can be installed via the 24 | command: `sudo apt-get install default-jdk` 25 | + Leiningen. The `lein` bash script available from 26 | https://leiningen.org is enough here. 27 | 28 | The above is sufficient if you are not generating the PDF versions of 29 | the cheatsheet. If you want to generate the PDF versions, you also 30 | need to install these LaTeX packages: 31 | 32 | + `sudo apt-get install texlive-latex-base texlive-latex-extra` 33 | 34 | 35 | ## Mac OS X 36 | 37 | As above, you must also install some version of the JDK and Leiningen. 38 | 39 | On a Mac with MacPorts 2.0.3, the following two packages, plus what 40 | they depend upon, are sufficient for generating PDF files: 41 | 42 | * `texlive-latex-recommended` (needed for scrreprt.cls) 43 | * `texlive-fonts-recommended` (needed for the lmodern font) 44 | 45 | This command will install these packages: 46 | 47 | ```bash 48 | sudo port install texlive-latex-recommended texlive-fonts-recommended 49 | ``` 50 | 51 | 52 | # Generating cheat sheet files 53 | 54 | ## Getting an updated copy of the contents of the ClojureDocs web site 55 | 56 | ```bash 57 | curl -O https://clojuredocs.org/clojuredocs-export.json 58 | ``` 59 | 60 | ## Running the cheatsheet generator 61 | 62 | Edit `./scripts/run.sh` to specify the values of `LINK_TARGET` and `PRODUCE_PDF` 63 | variables to your liking. If you want to produce PDF files, you must 64 | have a suitable LaTeX installation on your system (see Installation 65 | above). 66 | 67 | Run this command: 68 | 69 | ```bash 70 | ./scripts/run.sh 71 | ``` 72 | 73 | Output files are: 74 | 75 | * `cheatsheet-no-tooltips-no-cdocs-summary.html` 76 | * `cheatsheet-tiptip-cdocs-summary.html` 77 | * `cheatsheet-tiptip-no-cdocs-summary.html` 78 | * `cheatsheet-use-title-attribute-cdocs-summary.html` 79 | * `cheatsheet-use-title-attribute-no-cdocs-summary.html` 80 | 81 | Five different full versions of the standalone HTML files are 82 | generated, plus one "embeddable" version (see below). The full 83 | versions are standalone HTML files that are useful for viewing 84 | locally with a web browser while testing changes to the program, 85 | or for publishing on the web. Several contain links to files in 86 | the cheatsheet_files subdirectory, and those must also be 87 | published. 88 | 89 | They differ only in whether they have tooltip text on the Clojure 90 | symbols or not, and if so, whether those use HTML-standard title 91 | attribute text or a JavaScript-based method using TipTip and 92 | jQuery. Another variation between tooltip-enhanced versions are 93 | whether the tooltip text includes only the doc string for the 94 | symbol, or in addition a 1- or 2-line summary of how many examples 95 | and comments exist for the symbol on ClojureDocs.org. 96 | 97 | * `cheatsheet-embeddable-for-clojure.org.html` 98 | 99 | The embeddable version is almost the same, except only 100 | includes those things needed for publishing easily at 101 | [http://clojure.org/cheatsheet][cheatsheet]. 102 | 103 | [cheatsheet]: http://clojure.org/cheatsheet 104 | 105 | * `warnings.log` 106 | 107 | Warning messages about any symbols for which no links to 108 | documentation could be found in the internal map called 109 | `symbol-name-to-url`. Also a list of all symbols that are in that 110 | map which are not mentioned in the cheat sheet. These may be 111 | useful to add to future revisions of the cheat sheet, if they are 112 | considered important enough. 113 | 114 | * `cheatsheet-usletter-grey.tex` 115 | * `cheatsheet-usletter-color.tex` 116 | * `cheatsheet-usletter-bw.tex` 117 | * `cheatsheet-a4-grey.tex` 118 | * `cheatsheet-a4-color.tex` 119 | * `cheatsheet-a4-bw.tex` 120 | 121 | LaTeX source files for black & white (bw), grayscale, and color 122 | versions of the cheat sheet, on either A4 or US letter size paper. 123 | The font size has been tuned by hand so that everything fits onto 124 | 2 pages on either size of paper. Search for `fontsize` in the 125 | Clojure source file if future modifications to the cheat sheet 126 | warrant further modification of these. 127 | 128 | If you enable it in `./scripts/run.sh`, corresponding PDF files will also be 129 | generated for each of the LaTeX files. 130 | 131 | 132 | Things still missing: 133 | 134 | * No footer with version number, date, and attributions at the bottom. 135 | 136 | 137 | # License 138 | 139 | Copyright (C) 2012-2020 Andy Fingerhut 140 | 141 | Distributed under the Eclipse Public License, the same as Clojure. 142 | -------------------------------------------------------------------------------- /src/clj-jvm/cheatsheet_files/jquery.tipTip.js: -------------------------------------------------------------------------------- 1 | /* 2 | * TipTip 3 | * Copyright 2010 Drew Wilson 4 | * www.drewwilson.com 5 | * code.drewwilson.com/entry/tiptip-jquery-plugin 6 | * 7 | * Version 1.3 - Updated: Mar. 23, 2010 8 | * 9 | * This Plug-In will create a custom tooltip to replace the default 10 | * browser tooltip. It is extremely lightweight and very smart in 11 | * that it detects the edges of the browser window and will make sure 12 | * the tooltip stays within the current window size. As a result the 13 | * tooltip will adjust itself to be displayed above, below, to the left 14 | * or to the right depending on what is necessary to stay within the 15 | * browser window. It is completely customizable as well via CSS. 16 | * 17 | * This TipTip jQuery plug-in is dual licensed under the MIT and GPL licenses: 18 | * http://www.opensource.org/licenses/mit-license.php 19 | * http://www.gnu.org/licenses/gpl.html 20 | */ 21 | 22 | (function($){ 23 | $.fn.tipTip = function(options) { 24 | var defaults = { 25 | activation: "hover", 26 | keepAlive: false, 27 | maxWidth: "620px", 28 | edgeOffset: 3, 29 | defaultPosition: "bottom", 30 | delay: 200, 31 | fadeIn: 100, 32 | fadeOut: 100, 33 | attribute: "title", 34 | content: false, // HTML or String to fill TipTIp with 35 | enter: function(){}, 36 | exit: function(){} 37 | }; 38 | var opts = $.extend(defaults, options); 39 | 40 | // Setup tip tip elements and render them to the DOM 41 | if($("#tiptip_holder").length <= 0){ 42 | var tiptip_holder = $('
'); 43 | var tiptip_content = $(''); 44 | var tiptip_arrow = $(''); 45 | $("body").append(tiptip_holder.html(tiptip_content).prepend(tiptip_arrow.html(''))); 46 | } else { 47 | var tiptip_holder = $("#tiptip_holder"); 48 | var tiptip_content = $("#tiptip_content"); 49 | var tiptip_arrow = $("#tiptip_arrow"); 50 | } 51 | 52 | return this.each(function(){ 53 | var org_elem = $(this); 54 | if(opts.content){ 55 | var org_title = opts.content; 56 | } else { 57 | var org_title = org_elem.attr(opts.attribute); 58 | } 59 | if(org_title != ""){ 60 | if(!opts.content){ 61 | org_elem.removeAttr(opts.attribute); //remove original Attribute 62 | } 63 | var timeout = false; 64 | 65 | if(opts.activation == "hover"){ 66 | org_elem.hover(function(){ 67 | active_tiptip(); 68 | }, function(){ 69 | if(!opts.keepAlive){ 70 | deactive_tiptip(); 71 | } 72 | }); 73 | if(opts.keepAlive){ 74 | tiptip_holder.hover(function(){}, function(){ 75 | deactive_tiptip(); 76 | }); 77 | } 78 | } else if(opts.activation == "focus"){ 79 | org_elem.focus(function(){ 80 | active_tiptip(); 81 | }).blur(function(){ 82 | deactive_tiptip(); 83 | }); 84 | } else if(opts.activation == "click"){ 85 | org_elem.click(function(){ 86 | active_tiptip(); 87 | return false; 88 | }).hover(function(){},function(){ 89 | if(!opts.keepAlive){ 90 | deactive_tiptip(); 91 | } 92 | }); 93 | if(opts.keepAlive){ 94 | tiptip_holder.hover(function(){}, function(){ 95 | deactive_tiptip(); 96 | }); 97 | } 98 | } 99 | 100 | function active_tiptip(){ 101 | opts.enter.call(this); 102 | tiptip_content.html(org_title); 103 | tiptip_holder.hide().removeAttr("class").css("margin","0"); 104 | tiptip_arrow.removeAttr("style"); 105 | 106 | var top = parseInt(org_elem.offset()['top']); 107 | var left = parseInt(org_elem.offset()['left']); 108 | var org_width = parseInt(org_elem.outerWidth()); 109 | var org_height = parseInt(org_elem.outerHeight()); 110 | var tip_w = tiptip_holder.outerWidth(); 111 | var tip_h = tiptip_holder.outerHeight(); 112 | var w_compare = Math.round((org_width - tip_w) / 2); 113 | var t_class = ""; 114 | 115 | var tip_height_with_margin = (tip_h + 15); 116 | var tip_top_if_below = Math.round(top + org_height + opts.edgeOffset); 117 | var tip_top_if_above = Math.round(top - (opts.edgeOffset + tip_height_with_margin)); 118 | var window_top = parseInt($(window).scrollTop()); 119 | var window_bottom = window_top + parseInt($(window).height()); 120 | 121 | if ((tip_top_if_below + tip_height_with_margin) <= window_bottom){ 122 | t_class = "_bottom"; 123 | marg_top = tip_top_if_below; 124 | arrow_top = -12; 125 | } else if (tip_top_if_above >= window_top){ 126 | t_class = "_top"; 127 | marg_top = tip_top_if_above; 128 | arrow_top = tip_h; 129 | } else { 130 | t_class = "_bottom"; 131 | marg_top = tip_top_if_below; 132 | arrow_top = -12; 133 | } 134 | 135 | var window_left = parseInt($(window).scrollLeft()); 136 | var window_right = window_left + parseInt($(window).width()); 137 | var marg_left = Math.round(left + w_compare); 138 | if (marg_left < window_left + 10){ 139 | marg_left = window_left + 10; 140 | } else if ((marg_left + tip_w) > window_right - 10){ 141 | marg_left = window_right - 10 - tip_w; 142 | } 143 | var arrow_left = Math.round(left + (org_width / 2) - marg_left); 144 | 145 | tiptip_arrow.css({"margin-left": arrow_left+"px", "margin-top": arrow_top+"px"}); 146 | tiptip_holder.css({"margin-left": marg_left+"px", "margin-top": marg_top+"px"}).attr("class","tip"+t_class); 147 | 148 | if (timeout){ clearTimeout(timeout); } 149 | timeout = setTimeout(function(){ tiptip_holder.stop(true,true).fadeIn(opts.fadeIn); }, opts.delay); 150 | } 151 | 152 | function deactive_tiptip(){ 153 | opts.exit.call(this); 154 | if (timeout){ clearTimeout(timeout); } 155 | tiptip_holder.fadeOut(opts.fadeOut); 156 | } 157 | } 158 | }); 159 | } 160 | })(jQuery); 161 | -------------------------------------------------------------------------------- /src/clj-jvm/cheatsheet_files/style.css: -------------------------------------------------------------------------------- 1 | body {margin: 0;padding:0;} 2 | 3 | .wiki ol.includeWikiList { list-style: none; margin-left: 6px; padding: 0; text-indent: -6px; } 4 | /* Wiki Rendered Styles */ 5 | .wiki { line-height: 150%; font-family: arial, helvetica, sans-serif; font-size: small; } 6 | .wiki h1 { font-weight: bold; padding: 5px 0 0 0; margin: 0; font-size: 1.4em; } 7 | .wiki h2 { font-weight: bold; padding: 5px 0 0 0; margin: 0; font-size: 1.3em; } 8 | .wiki h3 { font-weight: bold; padding: 5px 0 0 0; margin: 0; font-size: 1.1em; } 9 | .wiki h4 { font-weight: normal; padding: 5px 0 0 0; margin: 0; font-size: 1.066em; } 10 | .wiki h5 { font-weight: normal; padding: 5px 0 0 0; margin: 0; font-size: 1.033em; } 11 | .wiki h6 { font-weight: normal; padding: 5px 0 0 0; margin: 0; font-size: 1.0em; } 12 | .wiki table { border-collapse: collapse; margin: 10px 0; font-size: 1em; } 13 | .wiki p { margin: 0; padding: 0; padding: 5px 0; } 14 | .wiki td { border: 1px solid #DDD; } 15 | .wiki #toc { border: 1px solid #AAA; background: #fff; padding: 5px; margin: 0 0 10px 10px; width: 25%; float: right; clear: right;} 16 | .wiki #toc h1 { font-weight: normal; font-size: 1.2em; padding: 0; } 17 | .wiki #toc a:hover { color: #00D; background: #FFD; } 18 | .wiki pre { background-color: #EEE; border: 1px solid #CCC; padding: 10px; font-size: small;} 19 | .wiki .nob td { border: 0; } 20 | .wiki hr { height: 1px; color: #AAA; background-color: #AAA; border: 0; margin: 0 10px; } 21 | .wiki ul { padding: .5em 0 0 3em; margin: 0; } 22 | .wiki ol { padding: .5em 0 0 3em; margin: 0; } 23 | .wiki ul.quotelist { list-style: none; } 24 | .wiki a.ext { background: url(/i/a.gif) center right no-repeat; padding-right: 10px; } 25 | .wiki a.wiki_link_new { color: #600; } 26 | .wiki a.wiki_link_ext { background: url(/i/a.gif) center right no-repeat; padding-right: 10px; } 27 | .wiki tt { font-size: small; } 28 | .wiki img { border: 0; padding: 4px; } 29 | 30 | .wiki .includeBodyActive { border-right: 1px #888888 solid; border-bottom: 1px #888888 solid; border-left: 1px #CCCCCC solid; border-top: 1px #CCCCCC solid; background: #fffacd; clear: left; } 31 | .wiki .includeBody { background: inherit; border: 1px transparent solid; clear: left; } 32 | .wiki .includeHeader { padding: 2px; padding-top: 2px; } 33 | .wiki .includeTitle { font-size: 120%; font-weight: bold; } 34 | .wiki .includeEditButton { float: right; padding-left: 10px; padding-right: 10px;} 35 | .wiki .includeEditButtonActive { float: right; padding-left: 10px; padding-right: 10px; } 36 | .wiki .includeEditButton a { color: #888888; font-size: 80%; text-decoration: none; } 37 | .wiki .includeEditButtonActive a { color: black; font-size: 80%; text-decoration: none; } 38 | 39 | .wiki .captionBox { border: thin gray solid; padding: 5px; margin: 2px; } 40 | .wiki .imageCaption { text-align: center; } 41 | 42 | .wiki .RssAuthor { color: #666; font-size: 80%; } 43 | .wiki .RssDate { color: #666; font-size: 80%; } 44 | 45 | .wiki .userLink { font-weight: bold; } 46 | .wiki .userLinkGuest { font-weight: bold; } 47 | 48 | /* Comments Include styles */ 49 | .wiki table.includeComments { border-collapse: collapse; padding: 0; margin: 0; width: 100%; } 50 | .wiki table.includeComments td, .wiki table.includeComments th { border: 1px solid #DDD; padding: 4px; margin: 0; } 51 | .wiki table.includeComments th { color: #333; padding: 4px; margin: 0; text-align: center; white-space: nowrap; } 52 | .wiki table.includeComments thead th { background:url(/i/gradient_grey.gif) top left repeat-x #FFF; } 53 | .wiki table.includeComments tfoot th { background-color: #EEE; } 54 | 55 | /* History Include styles */ 56 | .wiki table.includeHistory { border-collapse: collapse; padding: 0; margin: 0; width: 100%; } 57 | .wiki table.includeHistory td, .wiki table.includeHistory th { border: 1px solid #DDD; padding: 4px; margin: 0; } 58 | .wiki table.includeHistory th { color: #333; padding: 4px; margin: 0; text-align: center; white-space: nowrap; } 59 | .wiki table.includeHistory thead th { background:url(/i/gradient_grey.gif) top left repeat-x #FFF; } 60 | .wiki table.includeHistory tfoot th { background-color: #EEE; } 61 | 62 | /* Backlinks Include styles */ 63 | .wiki table.includeBacklinks { border-collapse: collapse; padding: 0; margin: 0; width: 100%; } 64 | .wiki table.includeBacklinks td, .wiki table.includeBacklinks th { border: 1px solid #DDD; padding: 4px; margin: 0; } 65 | .wiki table.includeBacklinks th { color: #333; padding: 4px; margin: 0; text-align: center; white-space: nowrap; } 66 | .wiki table.includeBacklinks thead th { background:url(/i/gradient_grey.gif) top left repeat-x #FFF; } 67 | .wiki table.includeBacklinks tfoot th { background-color: #EEE; } 68 | 69 | /* Editors Include Styles */ 70 | .wiki ul.includeEditorsLarge { list-style: none; display: inline; padding: 0; } 71 | .wiki ul.includeEditorsSmall { list-style: none; display: inline; padding: 0; } 72 | .wiki ul.includeEditorsLarge li { display: inline; padding: 2px; } 73 | .wiki ul.includeEditorsSmall li { display: block; padding: 2px; } 74 | 75 | /* Page List Include Styles */ 76 | .wiki ol.includePageList { list-style: none; padding: 0; } 77 | 78 | /* Tag Cloud Include Styles */ 79 | .wiki ol.includeTagCloud { list-style: none; display: inline; padding: 0; } 80 | .wiki ol.includeTagCloud li { display: inline; padding: 2px;} 81 | 82 | /* Adjust custom nav list padding */ 83 | .WikiCustomNav ol, .WikiCustomNav ul { padding-left: 0; } 84 | 85 | 86 | /* Search styles */ 87 | 88 | .search { 89 | padding: 0.3em 0.3em 0; 90 | } 91 | 92 | #search { 93 | margin: 0; 94 | display: block; 95 | border-radius: 5px; 96 | border: 1px solid #ddd; 97 | background: #ebebeb; 98 | padding: 5px; 99 | font-size: 1.5em; 100 | font-weight: bold; 101 | outline: none; 102 | box-sizing: border-box; 103 | width: 100%; 104 | } 105 | 106 | #search:focus { 107 | border: 1px solid #999; 108 | } 109 | 110 | #search.highlight { 111 | background: red; 112 | } 113 | 114 | .highlight { 115 | background: yellow; 116 | } 117 | 118 | /* Responsive styles */ 119 | 120 | .page { 121 | float: left; 122 | } 123 | 124 | .column { 125 | min-width: 30em; 126 | } 127 | 128 | @media only screen and (min-width: 801px) { 129 | .page { 130 | max-width: 73em; 131 | } 132 | 133 | .search { 134 | max-width: 29em; 135 | } 136 | } 137 | 138 | 139 | @media only screen and (max-width: 800px) { 140 | .wiki { 141 | font-size: 10px; 142 | } 143 | } 144 | 145 | @media only screen and (max-width: 620px) { 146 | .page .column { 147 | width: 100%; 148 | } 149 | } 150 | -------------------------------------------------------------------------------- /src/cljs-cheatsheet.tex: -------------------------------------------------------------------------------- 1 | \documentclass[footexclude,twocolumn,DIV25,fontsize=10pt]{scrreprt} 2 | 3 | % Author: Fogus (based on Steve Tayon's Clojure and David Liebke's Incanter cheat sheets) 4 | % Comments, errors, suggestions: fogus -at- clojure -dot- com 5 | 6 | % License 7 | % Eclipse Public License v1.0 8 | % http://opensource.org/licenses/eclipse-1.0.php 9 | 10 | % Packages 11 | \usepackage[utf8]{inputenc} 12 | \usepackage[T1]{fontenc} 13 | \usepackage{textcomp} 14 | \usepackage[english]{babel} 15 | \usepackage{tabularx} 16 | \usepackage{verbatim} 17 | \usepackage[table]{xcolor} 18 | 19 | % Set column space 20 | \setlength{\columnsep}{0.25em} 21 | 22 | % Define colours 23 | \definecolorset{hsb}{}{}{red,0,.4,0.95;orange,.1,.4,0.95;green,.25,.4,0.95;yellow,.15,.4,0.95} 24 | \definecolorset{hsb}{}{}{blue,.55,.4,0.95;purple,.7,.4,0.95;pink,.8,.4,0.95;blue2,.58,.4,0.95} 25 | \definecolorset{hsb}{}{}{magenta,.9,.4,0.95;green2,.29,.4,0.95} 26 | 27 | \definecolor{Brown}{cmyk}{0,0.81,1,0.60} 28 | \definecolor{OliveGreen}{cmyk}{0.64,0,0.95,0.40} 29 | \definecolor{CadetBlue}{cmyk}{0.62,0.57,0.23,0} 30 | \definecolor{lightlightgray}{gray}{0.9} 31 | 32 | % Redefine sections 33 | \makeatletter 34 | \renewcommand{\section}{\@startsection{section}{1}{0mm} 35 | {-1.7ex}{0.7ex}{\normalfont\large\bfseries}} 36 | \renewcommand{\subsection}{\@startsection{subsection}{2}{0mm} 37 | {-1.7ex}{0.5ex}{\normalfont\normalsize\bfseries}} 38 | \makeatother 39 | 40 | % No section numbers 41 | \setcounter{secnumdepth}{0} 42 | 43 | % No indentation 44 | \setlength{\parindent}{0em} 45 | 46 | % No header and footer 47 | \pagestyle{empty} 48 | 49 | 50 | % A few shortcuts 51 | \newcommand{\cmd}[1] {\texttt{\textbf{{#1}}}} 52 | \newcommand{\cmdline}[1] { 53 | \begin{tabularx}{\hsize}{X} 54 | \texttt{\textbf{{#1}}} 55 | \end{tabularx} 56 | } 57 | 58 | \newcommand{\colouredbox}[2] { 59 | \colorbox{#1!40}{ 60 | \begin{minipage}{0.95\linewidth} 61 | { 62 | \rowcolors[]{1}{#1!20}{#1!10} 63 | #2 64 | } 65 | \end{minipage} 66 | } 67 | } 68 | 69 | \usepackage{color} 70 | \usepackage{xcolor} 71 | \usepackage{listings} 72 | \usepackage[small,bf]{caption} 73 | 74 | \DeclareCaptionFont{white}{\color{white}} 75 | \DeclareCaptionFormat{listing}{\colorbox{yellow}{\parbox{0.95\linewidth}{\hspace{15pt}#1#2#3}}} 76 | \captionsetup[lstlisting]{format=listing} 77 | 78 | \begin{document} 79 | 80 | \centerline{\Large{\textbf{ClojureScript Cheat Sheet}}} 81 | \centerline{{\large{\textbf{\textit{http://github.com/clojure/clojurescript}}}}} 82 | 83 | \colouredbox{green}{ 84 | \section{Documentation} 85 | \textmd{\textrm{http://github.com/clojure/clojurescript/wiki}} 86 | } 87 | 88 | \lstset{ 89 | language=Lisp, % Code langugage 90 | basicstyle=\ttfamily, 91 | keywordstyle=\color{OliveGreen}, 92 | morekeywords={require, use, ns, require-macros, use-macros, as, only}, 93 | frame=none, 94 | } 95 | 96 | \begin{lstlisting}[label=ns,caption=Example Namespace Declaration] 97 | (ns my-cool-lib 98 | (:require [some-lib :as lib]) 99 | (:use [another-lib :only (a-func)]) 100 | (:require-macros [my.macros :as macs]) 101 | (:use-macros [mo.macs :only (my-mac)])) 102 | \end{lstlisting} 103 | 104 | 105 | \colouredbox{red}{ 106 | \section{Rich Data Literals} 107 | \begin{tabularx}{\hsize}{lX} 108 | Maps: & \cmd{\{:key1 :val1, :key2 :val2\}} \\ 109 | Vectors: & \cmd{[1 2 3 4 :a :b :c 1 2]} \\ 110 | Sets: & \cmd{\#\{:a :b :c 1 2 3\}} \\ 111 | Truth and nullity: & \cmd{true, false, nil} \\ 112 | Keywords: & \cmd{:kw, :a-2, :prefix/kw, ::pi} \\ 113 | Symbols: & \cmd{sym, sym-2, prefix/sym} \\ 114 | Characters: & \cmd{\textbackslash a, \textbackslash u1123, \textbackslash space} \\ 115 | Numbers/Strings: & same as in JavaScript \\ 116 | \end{tabularx} 117 | 118 | } 119 | 120 | 121 | \colouredbox{blue}{ 122 | \section{Frequently Used Functions} 123 | \begin{tabularx}{\hsize}{lX} 124 | Math:& \cmd{+ - * / quot rem mod inc dec max min}\\ 125 | Comparison:& \cmd{= == not= < > <= >=}\\ 126 | Tests:& \cmd{nil? identical? zero? pos? neg? even? odd? true? false? nil?} \\ 127 | Keywords:& \cmd{keyword keyword?} \\ 128 | Symbols:& \cmd{symbol symbol? gensym} \\ 129 | Data Processing:& \cmd{map reduce filter partition split-at split-with} \\ 130 | Data Create:& \cmd{vector vec hash-map set list list* for} \\ 131 | Data Examination:& \cmd{first rest count get nth get get-in contains? find keys vals} \\ 132 | Data Manipulation:& \cmd{seq into conj cons assoc assoc-in dissoc zipmap merge merge-with select-keys update-in}\\ 133 | Arrays:& \cmd{into-array to-array aget aset amap areduce alength}\\ 134 | \end{tabularx} 135 | 136 | \subsection{More information} 137 | \begin{tabularx}{\hsize}{lX} 138 | \centerline{{\large{\textbf{\textit{http://clojuredocs.org}}}}} 139 | \end{tabularx} 140 | 141 | } 142 | 143 | 144 | \colouredbox{pink}{ 145 | \section{Frequently Used Macros} 146 | \begin{tabularx}{\hsize}{lX} 147 | Defining:& \cmd{defmacro}\\ 148 | Macros:& \cmd{if if-let cond and or -> ->> doto when when-let ..}\\ 149 | Implementation:& Must be written in Clojure \\ 150 | Emission:& Must emit ClojureScript \\ 151 | \end{tabularx} 152 | 153 | } 154 | 155 | 156 | \colouredbox{orange}{ 157 | \section{Abstraction (http://clojure.org/protocols)} 158 | 159 | \subsection{Protocols} 160 | \begin{tabularx}{\hsize}{lX} 161 | Definition:& \cmd{(defprotocol Slicey (slice [at]))} \\ 162 | Extend:& \cmd{(extend-type js/String Slicey (slice [at] ...))} \\ 163 | Extend null:& \cmd{(extend-type nil Slicey (slice [\_] nil))} \\ 164 | Reify:& \cmd{(reify Slicey (slice [at] ...))}\\ 165 | \end{tabularx} 166 | 167 | \subsection{Records} 168 | \begin{tabularx}{\hsize}{lX} 169 | Definition:& \cmd{(defrecord Pair [h t])} \\ 170 | Access:& \cmd{(:h (Pair. 1 2)) ;=> 1} \\ 171 | Constructing:& \cmd{Pair. ->Pair map->Pair} \\ 172 | \end{tabularx} 173 | 174 | \subsection{Types} 175 | \begin{tabularx}{\hsize}{lX} 176 | Definition:& \cmd{(deftype Pair [h t])} \\ 177 | Access:& \cmd{(.-h (Pair. 1 2)) ;=> 1} \\ 178 | Constructing:& \cmd{Pair. ->Pair} \\ 179 | With Method(s):& \cmd{(deftype Pair [h t] Object (toString [] ...))} \\ 180 | \end{tabularx} 181 | 182 | \subsection{Multimethods} 183 | \begin{tabularx}{\hsize}{lX} 184 | Definition:& \cmd{(defmulti my-mm dispatch-function)}\\ 185 | Method Define:& \cmd{(defmethod my-mm :dispatch-value [args] ...)}\\ 186 | \end{tabularx} 187 | 188 | } 189 | 190 | \colouredbox{yellow}{ 191 | \section{JS Interop (http://fogus.me/cljs-js)} 192 | \begin{tabularx}{\hsize}{lX} 193 | Method Call: & \cmd{(.meth obj args)} \\ 194 | Method Call: & \cmd{(. obj (meth args))} \\ 195 | Property Access: & \cmd{(. obj -prop)} \\ 196 | Property Access: & \cmd{(.-prop obj)} \\ 197 | Set Property: & \cmd{(set! (.-prop obj) val)} \\ 198 | JS Global Access: & \cmd{js/window} \\ 199 | JS \cmd{this}: & \cmd{(this-as me (.method me))} \\ 200 | Create JS Object: & \cmd{(js-obj)} \\ 201 | \end{tabularx} 202 | 203 | } 204 | 205 | 206 | \colouredbox{blue2}{ 207 | \section{Compilation (http://fogus.me/cljsc)} 208 | \begin{tabularx}{\hsize}{lX} 209 | Simple Compile: & \cmdline{cljsc src-home '\{:optimizations :simple :pretty-print true\}'} \\ 210 | Advanced Compile: & \cmdline{cljsc src-home '\{:optimizations :advanced\}'} \\ 211 | \end{tabularx} 212 | 213 | } 214 | 215 | 216 | \colouredbox{pink}{ 217 | \section{Extra ClojureScript Libraries} 218 | \cmd{clojure.\{string set zipper\} clojure.browser.\{dom event net repl\}}\\ 219 | 220 | } 221 | 222 | 223 | \colouredbox{green}{ 224 | \section{Other Useful Libraries} 225 | \begin{tabularx}{\hsize}{lX} 226 | App Sample: & http://clojurescriptone.com \\ 227 | Client/Server: & http://github.com/ibdknox/fetch \\ 228 | Data Viz: & http://github.com/lynaghk/cljs-d3 \\ 229 | DOM: & http://github.com/levand/domina \\ 230 | jQuery: & http://github.com/ibdknox/jayq \\ 231 | Templating: & http://github.com/ibdknox/crate \\ 232 | \end{tabularx} 233 | 234 | } 235 | 236 | 237 | \begin{flushright} 238 | \footnotesize 239 | \rule{0.7\linewidth}{0.25pt} 240 | \verb!$Revision: 1.0, $Date: Feb 08, 2012!\\ 241 | \verb!Fogus (fogus -at- clojure -dot- com)! 242 | \end{flushright} 243 | \end{document} 244 | -------------------------------------------------------------------------------- /src/clj-jvm/unused-symbols.txt: -------------------------------------------------------------------------------- 1 | Partial contents of warnings.log file from a run of run.sh done on 2 | 2020-Jul-12: 3 | 4 | Sorted list of 415 symbols in lookup table that were never used: 5 | 6 | *allow-unresolved-vars* 7 | *assert* 8 | *compiler-options* 9 | *flush-on-newline* 10 | *fn-loader* 11 | *math-context* 12 | *print-namespace-maps* 13 | *read-eval* 14 | *reader-resolver* 15 | *source-path* 16 | *suppress-read* 17 | *use-context-classloader* 18 | *verbose-defrecords* 19 | ->ArrayChunk 20 | ->Eduction 21 | ->Vec 22 | ->VecNode 23 | ->VecSeq 24 | -cache-protocol-fn 25 | -reset-methods 26 | EMPTY-NODE 27 | Inst 28 | PrintWriter-on 29 | accessor 30 | add-classpath 31 | agent-errors 32 | await1 33 | chunk 34 | chunk-append 35 | chunk-buffer 36 | chunk-cons 37 | chunk-first 38 | chunk-next 39 | chunk-rest 40 | chunked-seq? 41 | clear-agent-errors 42 | clojure.core.protocols/CollReduce 43 | clojure.core.protocols/Datafiable 44 | clojure.core.protocols/IKVReduce 45 | clojure.core.protocols/InternalReduce 46 | clojure.core.protocols/Navigable 47 | clojure.core.protocols/coll-reduce 48 | clojure.core.protocols/datafy 49 | clojure.core.protocols/internal-reduce 50 | clojure.core.protocols/kv-reduce 51 | clojure.core.protocols/nav 52 | clojure.core.reducers/->Cat 53 | clojure.core.reducers/CollFold 54 | clojure.core.reducers/append! 55 | clojure.core.reducers/cat 56 | clojure.core.reducers/coll-fold 57 | clojure.core.reducers/drop 58 | clojure.core.reducers/filter 59 | clojure.core.reducers/fjtask 60 | clojure.core.reducers/flatten 61 | clojure.core.reducers/fold 62 | clojure.core.reducers/foldcat 63 | clojure.core.reducers/folder 64 | clojure.core.reducers/map 65 | clojure.core.reducers/mapcat 66 | clojure.core.reducers/monoid 67 | clojure.core.reducers/pool 68 | clojure.core.reducers/reduce 69 | clojure.core.reducers/reducer 70 | clojure.core.reducers/remove 71 | clojure.core.reducers/take 72 | clojure.core.reducers/take-while 73 | clojure.core.server/*session* 74 | clojure.core.server/io-prepl 75 | clojure.core.server/prepl 76 | clojure.core.server/remote-prepl 77 | clojure.core.server/repl 78 | clojure.core.server/repl-init 79 | clojure.core.server/repl-read 80 | clojure.core.server/start-server 81 | clojure.core.server/start-servers 82 | clojure.core.server/stop-server 83 | clojure.core.server/stop-servers 84 | clojure.core.specs.alpha/even-number-of-forms? 85 | clojure.data/Diff 86 | clojure.data/EqualityPartition 87 | clojure.data/diff-similar 88 | clojure.data/equality-partition 89 | clojure.inspector/atom? 90 | clojure.inspector/collection-tag 91 | clojure.inspector/get-child 92 | clojure.inspector/get-child-count 93 | clojure.inspector/inspect 94 | clojure.inspector/inspect-table 95 | clojure.inspector/inspect-tree 96 | clojure.inspector/is-leaf 97 | clojure.inspector/list-model 98 | clojure.inspector/list-provider 99 | clojure.inspector/old-table-model 100 | clojure.inspector/table-model 101 | clojure.inspector/tree-model 102 | clojure.instant/parse-timestamp 103 | clojure.instant/read-instant-calendar 104 | clojure.instant/read-instant-date 105 | clojure.instant/read-instant-timestamp 106 | clojure.instant/validated 107 | clojure.java.browse/*open-url-script* 108 | clojure.java.io/Coercions 109 | clojure.java.io/IOFactory 110 | clojure.java.io/default-streams-impl 111 | clojure.java.io/make-input-stream 112 | clojure.java.io/make-output-stream 113 | clojure.java.io/make-parents 114 | clojure.java.io/make-reader 115 | clojure.java.io/make-writer 116 | clojure.java.javadoc/*core-java-api* 117 | clojure.java.javadoc/*feeling-lucky* 118 | clojure.java.javadoc/*feeling-lucky-url* 119 | clojure.java.javadoc/*local-javadocs* 120 | clojure.java.javadoc/*remote-javadocs* 121 | clojure.java.javadoc/add-local-javadoc 122 | clojure.java.javadoc/add-remote-javadoc 123 | clojure.java.shell/*sh-dir* 124 | clojure.java.shell/*sh-env* 125 | clojure.main/demunge 126 | clojure.main/load-script 127 | clojure.main/main 128 | clojure.main/renumbering-read 129 | clojure.main/repl 130 | clojure.main/repl-caught 131 | clojure.main/repl-exception 132 | clojure.main/repl-prompt 133 | clojure.main/repl-read 134 | clojure.main/repl-requires 135 | clojure.main/root-cause 136 | clojure.main/skip-if-eol 137 | clojure.main/skip-whitespace 138 | clojure.main/stack-element-str 139 | clojure.main/with-bindings 140 | clojure.main/with-read-known 141 | clojure.pprint/*print-base* 142 | clojure.pprint/*print-miser-width* 143 | clojure.pprint/*print-pprint-dispatch* 144 | clojure.pprint/*print-pretty* 145 | clojure.pprint/*print-radix* 146 | clojure.pprint/*print-right-margin* 147 | clojure.pprint/*print-suppress-namespaces* 148 | clojure.pprint/code-dispatch 149 | clojure.pprint/formatter 150 | clojure.pprint/formatter-out 151 | clojure.pprint/fresh-line 152 | clojure.pprint/get-pretty-writer 153 | clojure.pprint/pp 154 | clojure.pprint/pprint-indent 155 | clojure.pprint/pprint-logical-block 156 | clojure.pprint/pprint-newline 157 | clojure.pprint/pprint-tab 158 | clojure.pprint/print-length-loop 159 | clojure.pprint/set-pprint-dispatch 160 | clojure.pprint/simple-dispatch 161 | clojure.pprint/with-pprint-dispatch 162 | clojure.pprint/write 163 | clojure.pprint/write-out 164 | clojure.reflect/->AsmReflector 165 | clojure.reflect/->Constructor 166 | clojure.reflect/->Field 167 | clojure.reflect/->JavaReflector 168 | clojure.reflect/->Method 169 | clojure.reflect/ClassResolver 170 | clojure.reflect/Reflector 171 | clojure.reflect/TypeReference 172 | clojure.reflect/do-reflect 173 | clojure.reflect/flag-descriptors 174 | clojure.reflect/map->Constructor 175 | clojure.reflect/map->Field 176 | clojure.reflect/map->Method 177 | clojure.reflect/reflect 178 | clojure.reflect/resolve-class 179 | clojure.reflect/type-reflect 180 | clojure.reflect/typename 181 | clojure.repl/demunge 182 | clojure.repl/dir-fn 183 | clojure.repl/root-cause 184 | clojure.repl/set-break-handler! 185 | clojure.repl/source-fn 186 | clojure.repl/stack-element-str 187 | clojure.repl/thread-stopper 188 | clojure.spec.alpha/*coll-check-limit* 189 | clojure.spec.alpha/*coll-error-limit* 190 | clojure.spec.alpha/*compile-asserts* 191 | clojure.spec.alpha/*fspec-iterations* 192 | clojure.spec.alpha/*recursion-limit* 193 | clojure.spec.alpha/Spec 194 | clojure.spec.alpha/Specize 195 | clojure.spec.alpha/abbrev 196 | clojure.spec.alpha/alt-impl 197 | clojure.spec.alpha/amp-impl 198 | clojure.spec.alpha/and-spec-impl 199 | clojure.spec.alpha/assert* 200 | clojure.spec.alpha/cat-impl 201 | clojure.spec.alpha/conform* 202 | clojure.spec.alpha/def-impl 203 | clojure.spec.alpha/describe* 204 | clojure.spec.alpha/every-impl 205 | clojure.spec.alpha/explain* 206 | clojure.spec.alpha/explain-data* 207 | clojure.spec.alpha/fspec-impl 208 | clojure.spec.alpha/gen* 209 | clojure.spec.alpha/invalid? 210 | clojure.spec.alpha/map-spec-impl 211 | clojure.spec.alpha/maybe-impl 212 | clojure.spec.alpha/merge-spec-impl 213 | clojure.spec.alpha/multi-spec-impl 214 | clojure.spec.alpha/nilable-impl 215 | clojure.spec.alpha/nonconforming 216 | clojure.spec.alpha/or-spec-impl 217 | clojure.spec.alpha/regex-spec-impl 218 | clojure.spec.alpha/regex? 219 | clojure.spec.alpha/rep+impl 220 | clojure.spec.alpha/rep-impl 221 | clojure.spec.alpha/spec-impl 222 | clojure.spec.alpha/specize* 223 | clojure.spec.alpha/tuple 224 | clojure.spec.alpha/tuple-impl 225 | clojure.spec.alpha/unform* 226 | clojure.spec.alpha/with-gen* 227 | clojure.spec.gen.alpha/any 228 | clojure.spec.gen.alpha/any-printable 229 | clojure.spec.gen.alpha/bind 230 | clojure.spec.gen.alpha/boolean 231 | clojure.spec.gen.alpha/bytes 232 | clojure.spec.gen.alpha/cat 233 | clojure.spec.gen.alpha/char 234 | clojure.spec.gen.alpha/char-alpha 235 | clojure.spec.gen.alpha/char-alphanumeric 236 | clojure.spec.gen.alpha/char-ascii 237 | clojure.spec.gen.alpha/choose 238 | clojure.spec.gen.alpha/delay 239 | clojure.spec.gen.alpha/delay-impl 240 | clojure.spec.gen.alpha/double 241 | clojure.spec.gen.alpha/double* 242 | clojure.spec.gen.alpha/elements 243 | clojure.spec.gen.alpha/fmap 244 | clojure.spec.gen.alpha/for-all* 245 | clojure.spec.gen.alpha/frequency 246 | clojure.spec.gen.alpha/gen-for-name 247 | clojure.spec.gen.alpha/gen-for-pred 248 | clojure.spec.gen.alpha/generate 249 | clojure.spec.gen.alpha/hash-map 250 | clojure.spec.gen.alpha/int 251 | clojure.spec.gen.alpha/keyword 252 | clojure.spec.gen.alpha/keyword-ns 253 | clojure.spec.gen.alpha/large-integer 254 | clojure.spec.gen.alpha/large-integer* 255 | clojure.spec.gen.alpha/lazy-combinator 256 | clojure.spec.gen.alpha/lazy-combinators 257 | clojure.spec.gen.alpha/lazy-prim 258 | clojure.spec.gen.alpha/lazy-prims 259 | clojure.spec.gen.alpha/list 260 | clojure.spec.gen.alpha/map 261 | clojure.spec.gen.alpha/not-empty 262 | clojure.spec.gen.alpha/one-of 263 | clojure.spec.gen.alpha/quick-check 264 | clojure.spec.gen.alpha/ratio 265 | clojure.spec.gen.alpha/return 266 | clojure.spec.gen.alpha/sample 267 | clojure.spec.gen.alpha/set 268 | clojure.spec.gen.alpha/shuffle 269 | clojure.spec.gen.alpha/simple-type 270 | clojure.spec.gen.alpha/simple-type-printable 271 | clojure.spec.gen.alpha/string 272 | clojure.spec.gen.alpha/string-alphanumeric 273 | clojure.spec.gen.alpha/string-ascii 274 | clojure.spec.gen.alpha/such-that 275 | clojure.spec.gen.alpha/symbol 276 | clojure.spec.gen.alpha/symbol-ns 277 | clojure.spec.gen.alpha/tuple 278 | clojure.spec.gen.alpha/uuid 279 | clojure.spec.gen.alpha/vector 280 | clojure.spec.gen.alpha/vector-distinct 281 | clojure.stacktrace/e 282 | clojure.stacktrace/print-cause-trace 283 | clojure.stacktrace/print-stack-trace 284 | clojure.stacktrace/print-throwable 285 | clojure.stacktrace/print-trace-element 286 | clojure.stacktrace/root-cause 287 | clojure.template/apply-template 288 | clojure.template/do-template 289 | clojure.test.junit/*depth* 290 | clojure.test.junit/*var-context* 291 | clojure.test.junit/element-content 292 | clojure.test.junit/error-el 293 | clojure.test.junit/failure-el 294 | clojure.test.junit/finish-case 295 | clojure.test.junit/finish-element 296 | clojure.test.junit/finish-suite 297 | clojure.test.junit/indent 298 | clojure.test.junit/junit-report 299 | clojure.test.junit/message-el 300 | clojure.test.junit/package-class 301 | clojure.test.junit/start-case 302 | clojure.test.junit/start-element 303 | clojure.test.junit/start-suite 304 | clojure.test.junit/suite-attrs 305 | clojure.test.junit/test-name 306 | clojure.test.junit/with-junit-output 307 | clojure.test.tap/print-diagnostics 308 | clojure.test.tap/print-tap-diagnostic 309 | clojure.test.tap/print-tap-fail 310 | clojure.test.tap/print-tap-pass 311 | clojure.test.tap/print-tap-plan 312 | clojure.test.tap/tap-report 313 | clojure.test.tap/with-tap-output 314 | clojure.test/*initial-report-counters* 315 | clojure.test/*load-tests* 316 | clojure.test/*report-counters* 317 | clojure.test/*stack-trace-depth* 318 | clojure.test/*test-out* 319 | clojure.test/*testing-contexts* 320 | clojure.test/*testing-vars* 321 | clojure.test/are 322 | clojure.test/assert-any 323 | clojure.test/assert-expr 324 | clojure.test/assert-predicate 325 | clojure.test/compose-fixtures 326 | clojure.test/deftest 327 | clojure.test/deftest- 328 | clojure.test/do-report 329 | clojure.test/file-position 330 | clojure.test/function? 331 | clojure.test/get-possibly-unbound-var 332 | clojure.test/inc-report-counter 333 | clojure.test/is 334 | clojure.test/join-fixtures 335 | clojure.test/report 336 | clojure.test/run-all-tests 337 | clojure.test/run-tests 338 | clojure.test/set-test 339 | clojure.test/successful? 340 | clojure.test/test-all-vars 341 | clojure.test/test-ns 342 | clojure.test/test-var 343 | clojure.test/test-vars 344 | clojure.test/testing 345 | clojure.test/testing-contexts-str 346 | clojure.test/testing-vars-str 347 | clojure.test/try-expr 348 | clojure.test/use-fixtures 349 | clojure.test/with-test 350 | clojure.test/with-test-out 351 | clojure.walk/keywordize-keys 352 | clojure.walk/stringify-keys 353 | clojure.xml/*current* 354 | clojure.xml/*sb* 355 | clojure.xml/*stack* 356 | clojure.xml/*state* 357 | clojure.xml/attrs 358 | clojure.xml/content 359 | clojure.xml/content-handler 360 | clojure.xml/element 361 | clojure.xml/emit 362 | clojure.xml/emit-element 363 | clojure.xml/startparse-sax 364 | clojure.xml/tag 365 | create-struct 366 | defstruct 367 | delay? 368 | denominator 369 | destructure 370 | find-protocol-impl 371 | find-protocol-method 372 | hash-combine 373 | hash-ordered-coll 374 | hash-unordered-coll 375 | inst-ms 376 | inst-ms* 377 | method-sig 378 | mix-collection-hash 379 | munge 380 | namespace-munge 381 | numerator 382 | primitives-classnames 383 | print-ctor 384 | print-dup 385 | print-method 386 | print-simple 387 | proxy-call-with-super 388 | proxy-name 389 | read 390 | read+string 391 | read-string 392 | reader-conditional 393 | reader-conditional? 394 | refer-clojure 395 | replicate 396 | special-symbol? 397 | struct 398 | struct-map 399 | tagged-literal 400 | tagged-literal? 401 | unchecked-add-int 402 | unchecked-byte 403 | unchecked-char 404 | unchecked-dec-int 405 | unchecked-divide-int 406 | unchecked-double 407 | unchecked-float 408 | unchecked-inc-int 409 | unchecked-int 410 | unchecked-long 411 | unchecked-multiply-int 412 | unchecked-negate-int 413 | unchecked-remainder-int 414 | unchecked-short 415 | unchecked-subtract-int 416 | unquote 417 | unquote-splicing 418 | with-bindings 419 | with-bindings* 420 | with-loading-context 421 | 422 | 423 | Sorted list of 114 namespace names currently existing: 424 | 425 | cemerick.url 426 | clojure.core 427 | clojure.core.async 428 | clojure.core.async.impl.buffers 429 | clojure.core.async.impl.channels 430 | clojure.core.async.impl.concurrent 431 | clojure.core.async.impl.dispatch 432 | clojure.core.async.impl.exec.threadpool 433 | clojure.core.async.impl.ioc-macros 434 | clojure.core.async.impl.mutex 435 | clojure.core.async.impl.protocols 436 | clojure.core.async.impl.timers 437 | clojure.core.cache 438 | clojure.core.memoize 439 | clojure.core.protocols 440 | clojure.core.reducers 441 | clojure.core.rrb-vector 442 | clojure.core.rrb-vector.fork-join 443 | clojure.core.rrb-vector.interop 444 | clojure.core.rrb-vector.nodes 445 | clojure.core.rrb-vector.protocols 446 | clojure.core.rrb-vector.rrbt 447 | clojure.core.rrb-vector.transients 448 | clojure.core.server 449 | clojure.core.specs.alpha 450 | clojure.data 451 | clojure.data.avl 452 | clojure.data.int-map 453 | clojure.data.json 454 | clojure.data.priority-map 455 | clojure.datafy 456 | clojure.edn 457 | clojure.inspector 458 | clojure.instant 459 | clojure.java.browse 460 | clojure.java.browse-ui 461 | clojure.java.io 462 | clojure.java.javadoc 463 | clojure.java.shell 464 | clojure.main 465 | clojure.pprint 466 | clojure.reflect 467 | clojure.repl 468 | clojure.set 469 | clojure.spec.alpha 470 | clojure.spec.gen.alpha 471 | clojure.spec.test.alpha 472 | clojure.spec.test.check 473 | clojure.stacktrace 474 | clojure.string 475 | clojure.template 476 | clojure.test 477 | clojure.test.check.generators 478 | clojure.test.check.random 479 | clojure.test.check.rose-tree 480 | clojure.test.junit 481 | clojure.test.tap 482 | clojure.tools.analyzer 483 | clojure.tools.analyzer.ast 484 | clojure.tools.analyzer.env 485 | clojure.tools.analyzer.jvm 486 | clojure.tools.analyzer.jvm.utils 487 | clojure.tools.analyzer.passes 488 | clojure.tools.analyzer.passes.add-binding-atom 489 | clojure.tools.analyzer.passes.cleanup 490 | clojure.tools.analyzer.passes.constant-lifter 491 | clojure.tools.analyzer.passes.elide-meta 492 | clojure.tools.analyzer.passes.emit-form 493 | clojure.tools.analyzer.passes.jvm.analyze-host-expr 494 | clojure.tools.analyzer.passes.jvm.annotate-host-info 495 | clojure.tools.analyzer.passes.jvm.annotate-loops 496 | clojure.tools.analyzer.passes.jvm.annotate-tag 497 | clojure.tools.analyzer.passes.jvm.box 498 | clojure.tools.analyzer.passes.jvm.classify-invoke 499 | clojure.tools.analyzer.passes.jvm.constant-lifter 500 | clojure.tools.analyzer.passes.jvm.emit-form 501 | clojure.tools.analyzer.passes.jvm.fix-case-test 502 | clojure.tools.analyzer.passes.jvm.infer-tag 503 | clojure.tools.analyzer.passes.jvm.validate 504 | clojure.tools.analyzer.passes.jvm.validate-loop-locals 505 | clojure.tools.analyzer.passes.jvm.validate-recur 506 | clojure.tools.analyzer.passes.jvm.warn-on-reflection 507 | clojure.tools.analyzer.passes.source-info 508 | clojure.tools.analyzer.passes.trim 509 | clojure.tools.analyzer.passes.uniquify 510 | clojure.tools.analyzer.passes.warn-earmuff 511 | clojure.tools.analyzer.utils 512 | clojure.tools.macro 513 | clojure.tools.reader 514 | clojure.tools.reader.default-data-readers 515 | clojure.tools.reader.edn 516 | clojure.tools.reader.impl.commons 517 | clojure.tools.reader.impl.errors 518 | clojure.tools.reader.impl.inspect 519 | clojure.tools.reader.impl.utils 520 | clojure.tools.reader.reader-types 521 | clojure.uuid 522 | clojure.walk 523 | clojure.xml 524 | clojure.zip 525 | flatland.ordered.common 526 | flatland.ordered.map 527 | flatland.ordered.set 528 | flatland.useful.debug 529 | flatland.useful.experimental.delegate 530 | flatland.useful.fn 531 | flatland.useful.map 532 | flatland.useful.ns 533 | flatland.useful.utils 534 | generator.core 535 | grimoire.util 536 | guten-tag.core 537 | pathetic.core 538 | user 539 | -------------------------------------------------------------------------------- /src/clj-jvm/TODO.txt: -------------------------------------------------------------------------------- 1 | Add string literal and character literal examples to strings section, 2 | preferably with common escape sequences like \n \t and hex and octal, 3 | with link to a complete list. Fiddly bit is figuring out how to 4 | escape these properly when generating LaTeX. 5 | 6 | Possibly useful Java doc link for escape sequences inside strings: 7 | http://docs.oracle.com/javase/specs/jls/se7/html/jls-3.html#jls-3.10.6 8 | 9 | start at a diff that doesn't work for LaTeX: 10 | 11 | - :html "See also IO/to string"}]] 12 | + :html "See also IO/to string"} 13 | + "Literals:" 14 | + "\"foo\"" 15 | + "\"newline \\n tab \\t\"" 16 | + "\"quote \\\" backslash \\\\\"" 17 | +;; {:latex " \\href{http://en.wikipedia.org/wiki/UTF-16}{UTF-16}:" 18 | +;; :html "UTF-16:"} 19 | +;; "\"\\ua028 octal \\177\\"" 20 | + 21 | + ]] 22 | 23 | 24 | Other links within Clojure docs that might be linked to directly at 25 | appropriate places: 26 | 27 | http://clojure.org/reader#The%20Reader--extensible%20data%20notation%20%28edn%29 28 | http://clojure.org/reader#The%20Reader--Tagged%20Literals 29 | 30 | 31 | Links to tutorial-style articles for these topics: 32 | parsing/generating XML 33 | 34 | zippers - I found these nice blog articles linked to from the 35 | Clojure 1.2 version of clojure.zip/zipper on clojuredocs.org. I 36 | added the URLs to the Clojure 1.3 version, too. 37 | Brian Marick: "Editing" trees in Clojure with clojure.zip 38 | http://www.exampler.com/blog/2010/09/01/editing-trees-in-clojure-with-clojurezip/ 39 | Alex Miller: Zippers with records in Clojure 40 | http://tech.puredanger.com/2010/10/22/zippers-with-records-in-clojure/ 41 | 42 | Leiningen 43 | Java classpaths, JARs, etc. 44 | Maybe this would be a good quick start to Leiningen and Java classpaths? 45 | http://www.unexpected-vortices.com/clojure/brief-beginners-guide/ 46 | 47 | This briefly describes several resources for those wanting to 48 | learn the Clojure language: 49 | http://www.elangocheran.com/blog/2012/03/the-newbies-guide-learning-clojure/ 50 | 51 | Introductory material on Lisp family languages, but not Clojure in particular: 52 | http://www.lisperati.com/clojure-spels/casting.html 53 | 54 | Intermediate to advanced material on Common Lisp macros: 55 | "On Lisp", Paul Graham, TBD: find link to free copy 56 | 57 | Add tooltips for links that do not go to clojuredocs.org. They don't 58 | have to be anything fancy -- just something that makes it obvious they 59 | are not doc strings, and the web page isn't 'broken'. 60 | 61 | Add some brief notes about how different types of arithmetic work: 62 | bigint contagion, operators that auto-convert to bigint if needed, 63 | unchecked operators intended only for primitive arith types. How to 64 | format/printf bigints and ratios. What else? 65 | 66 | ---------------------------------------- 67 | Symbols from more namespaces, or at least links to the namespaces: 68 | 69 | There are new contrib namespaces that are not mentioned anywhere. 70 | Make a list of all of them, annotated with which are in now, and which 71 | are not. Consider creating a link to documentation for the entire 72 | namespace somewhere on the cheatsheet, even if we don't include its 73 | individual symbols. 74 | 75 | Is this a complete list of new (i.e. Clojure 1.3) contrib libraries? 76 | 77 | http://clojure.github.com/ 78 | 79 | Is that list complete? Are there any on the following page that are 80 | not on the one above? 81 | 82 | https://github.com/clojure 83 | 84 | Which ones worth adding to cheatsheet? As of this time, it seems that 85 | there are no documentation pages for any of these on clojuredocs.org 86 | (I've filed a request asking if they plan to do so), but there are on 87 | clojure.github.com (linked to from the page above). 88 | 89 | 90 | Add links to entire namespaces on clojuredocs.org, e.g.: 91 | 92 | http://clojuredocs.org/clojure_core/clojure.java.io 93 | 94 | 95 | therenow clojure.core 96 | notthere clojure.core.protocols (and keep it notthere?) 97 | TBD clojure.core.reducers 98 | therenow clojure.data 99 | TBD clojure.inspector 100 | therenow clojure.java.browse (only clojure.java.browse/browse-url) 101 | notthere clojure.java.browse-ui (and keep it notthere?) 102 | therenow clojure.java.io 103 | therenow clojure.java.javadoc 104 | therenow clojure.java.shell (only sh, with-sh-env, with-sh-dir) 105 | TBD clojure.main (TBD: What is worth adding to cheatsheet, if any?) 106 | therenow clojure.pprint 107 | TBD clojure.reflect (only reflect) 108 | therenow clojure.repl 109 | therenow clojure.set 110 | TBD clojure.stacktrace (TBD: What is worth adding to cheatsheet, if any? Is anything here more useful in any way than clojure.repl/pst ?) 111 | therenow clojure.string 112 | TBDlo clojure.template 113 | TBD clojure.test 114 | therenow clojure.walk 115 | therenow clojure.xml (only parse so far. TBD: Anything else worth adding?) 116 | therenow clojure.zip 117 | 118 | Pages listing other Clojure libraries: 119 | http://www.clojure-toolbox.com/ 120 | http://cnlojure.org/open.html 121 | http://clojure-libraries.appspot.com/ 122 | 123 | TBD: Is there any chance of merging the above efforts into 1 site 124 | maintained at least as well as any of the existing ones? 125 | ---------------------------------------- 126 | 127 | 128 | Find good places to link to for macro things like the special syntax ` 129 | ~ ~@, and perhaps also link to there from the Macros section header. 130 | 131 | 132 | Give examples of syntax for type-hinting Java arrays of arbitrary Java 133 | classes, with the link below for details: 134 | 135 | http://docs.oracle.com/javase/6/docs/api/java/lang/Class.html#getName%28%29 136 | 137 | Example in Abstractions section for extend-protocol 138 | 139 | Consider adding (def f ns/g) and (def f #'ns/g) distinction, and what 140 | it will do differently. Any good article or docs to link to for that? 141 | 142 | 143 | 144 | ---------------------------------------------------------------------- 145 | ns, require, use, import 146 | ---------------------------------------------------------------------- 147 | 148 | Give most common examples of ns use, with :import, :require, and :use 149 | 150 | Maybe also give the REPL equivalents of those expressions? 151 | 152 | See this article for ideas of things that could be adapted to put 153 | right into the cheatsheet: 154 | 155 | http://blog.8thlight.com/colin-jones/2010/12/05/clojure-libs-and-namespaces-require-use-import-and-ns.html 156 | ---------------------------------------------------------------------- 157 | 158 | 159 | Add java.io.DataOutputStream / java.io.DataInputStream links for 160 | binary I/O? 161 | 162 | java.util.Scanner might be nice to know about. 163 | 164 | distinct? doesn't really operate on collections. It is more like max, 165 | min, and some others in taking an arbitrarily large but variable 166 | number of arguments. Is there a better place it belongs than 167 | Collections/Content tests? 168 | 169 | Decide which if any of the following symbols should be included in the 170 | cheatsheet, and if so, where. 171 | 172 | First, a short list of things that seems like they are among the more 173 | significant ones to know about: 174 | 175 | bases 176 | class 177 | clojure.repl/dir 178 | clojure.repl/root-cause 179 | definterface 180 | extend 181 | extend-protocol 182 | extenders 183 | extends? 184 | satisfies? 185 | supers 186 | trampoline 187 | type 188 | underive 189 | with-bindings 190 | 191 | 192 | Next, a short list of deprecated things that definitely should not be 193 | in the cheat sheet: 194 | 195 | add-classpath :deprecated "1.1" (no documented replacement) 196 | agent-errors :deprecated "1.2" (use agent-error, which is in sheet) 197 | clear-agent-errors :deprecated "1.2" (use restart-agent, which is in sheet) 198 | replicate :deprecated "1.3" (use repeat, which is in sheet) 199 | 200 | There are a few other things in clojure.test, clojure.parallel (the 201 | whole namespace), and contrib lib tools.namespace, but that appears to 202 | be all of the Vars that are deprecated. 203 | 204 | 205 | 206 | 207 | Sorted list of 423 symbols in lookup table that were never used: 208 | 209 | *allow-unresolved-vars* 210 | *assert* 211 | *compiler-options* 212 | *flush-on-newline* 213 | *fn-loader* 214 | *math-context* 215 | *print-namespace-maps* 216 | *read-eval* 217 | *reader-resolver* 218 | *source-path* 219 | *suppress-read* 220 | *use-context-classloader* 221 | *verbose-defrecords* 222 | ->ArrayChunk 223 | ->Eduction 224 | ->Vec 225 | ->VecNode 226 | ->VecSeq 227 | -cache-protocol-fn 228 | -reset-methods 229 | EMPTY-NODE 230 | Inst 231 | PrintWriter-on 232 | Throwable->map 233 | accessor 234 | add-classpath 235 | add-tap 236 | agent-errors 237 | await1 238 | chunk 239 | chunk-append 240 | chunk-buffer 241 | chunk-cons 242 | chunk-first 243 | chunk-next 244 | chunk-rest 245 | chunked-seq? 246 | clear-agent-errors 247 | clojure.core.protocols/CollReduce 248 | clojure.core.protocols/Datafiable 249 | clojure.core.protocols/IKVReduce 250 | clojure.core.protocols/InternalReduce 251 | clojure.core.protocols/Navigable 252 | clojure.core.protocols/coll-reduce 253 | clojure.core.protocols/datafy 254 | clojure.core.protocols/internal-reduce 255 | clojure.core.protocols/kv-reduce 256 | clojure.core.protocols/nav 257 | clojure.core.reducers/->Cat 258 | clojure.core.reducers/CollFold 259 | clojure.core.reducers/append! 260 | clojure.core.reducers/cat 261 | clojure.core.reducers/coll-fold 262 | clojure.core.reducers/drop 263 | clojure.core.reducers/filter 264 | clojure.core.reducers/fjtask 265 | clojure.core.reducers/flatten 266 | clojure.core.reducers/fold 267 | clojure.core.reducers/foldcat 268 | clojure.core.reducers/folder 269 | clojure.core.reducers/map 270 | clojure.core.reducers/mapcat 271 | clojure.core.reducers/monoid 272 | clojure.core.reducers/pool 273 | clojure.core.reducers/reduce 274 | clojure.core.reducers/reducer 275 | clojure.core.reducers/remove 276 | clojure.core.reducers/take 277 | clojure.core.reducers/take-while 278 | clojure.core.server/*session* 279 | clojure.core.server/io-prepl 280 | clojure.core.server/prepl 281 | clojure.core.server/remote-prepl 282 | clojure.core.server/repl 283 | clojure.core.server/repl-init 284 | clojure.core.server/repl-read 285 | clojure.core.server/start-server 286 | clojure.core.server/start-servers 287 | clojure.core.server/stop-server 288 | clojure.core.server/stop-servers 289 | clojure.core.specs.alpha/even-number-of-forms? 290 | clojure.data/Diff 291 | clojure.data/EqualityPartition 292 | clojure.data/diff-similar 293 | clojure.data/equality-partition 294 | clojure.datafy/datafy 295 | clojure.datafy/nav 296 | clojure.inspector/atom? 297 | clojure.inspector/collection-tag 298 | clojure.inspector/get-child 299 | clojure.inspector/get-child-count 300 | clojure.inspector/inspect 301 | clojure.inspector/inspect-table 302 | clojure.inspector/inspect-tree 303 | clojure.inspector/is-leaf 304 | clojure.inspector/list-model 305 | clojure.inspector/list-provider 306 | clojure.inspector/old-table-model 307 | clojure.inspector/table-model 308 | clojure.inspector/tree-model 309 | clojure.instant/parse-timestamp 310 | clojure.instant/read-instant-calendar 311 | clojure.instant/read-instant-date 312 | clojure.instant/read-instant-timestamp 313 | clojure.instant/validated 314 | clojure.java.browse/*open-url-script* 315 | clojure.java.io/Coercions 316 | clojure.java.io/IOFactory 317 | clojure.java.io/default-streams-impl 318 | clojure.java.io/make-input-stream 319 | clojure.java.io/make-output-stream 320 | clojure.java.io/make-parents 321 | clojure.java.io/make-reader 322 | clojure.java.io/make-writer 323 | clojure.java.javadoc/*core-java-api* 324 | clojure.java.javadoc/*feeling-lucky* 325 | clojure.java.javadoc/*feeling-lucky-url* 326 | clojure.java.javadoc/*local-javadocs* 327 | clojure.java.javadoc/*remote-javadocs* 328 | clojure.java.javadoc/add-local-javadoc 329 | clojure.java.javadoc/add-remote-javadoc 330 | clojure.java.shell/*sh-dir* 331 | clojure.java.shell/*sh-env* 332 | clojure.main/demunge 333 | clojure.main/err->msg 334 | clojure.main/load-script 335 | clojure.main/main 336 | clojure.main/renumbering-read 337 | clojure.main/repl 338 | clojure.main/repl-caught 339 | clojure.main/repl-exception 340 | clojure.main/repl-prompt 341 | clojure.main/repl-read 342 | clojure.main/repl-requires 343 | clojure.main/report-error 344 | clojure.main/root-cause 345 | clojure.main/skip-if-eol 346 | clojure.main/skip-whitespace 347 | clojure.main/stack-element-str 348 | clojure.main/with-bindings 349 | clojure.main/with-read-known 350 | clojure.pprint/*print-base* 351 | clojure.pprint/*print-miser-width* 352 | clojure.pprint/*print-pprint-dispatch* 353 | clojure.pprint/*print-pretty* 354 | clojure.pprint/*print-radix* 355 | clojure.pprint/*print-right-margin* 356 | clojure.pprint/*print-suppress-namespaces* 357 | clojure.pprint/code-dispatch 358 | clojure.pprint/formatter 359 | clojure.pprint/formatter-out 360 | clojure.pprint/fresh-line 361 | clojure.pprint/get-pretty-writer 362 | clojure.pprint/pp 363 | clojure.pprint/pprint-indent 364 | clojure.pprint/pprint-logical-block 365 | clojure.pprint/pprint-newline 366 | clojure.pprint/pprint-tab 367 | clojure.pprint/print-length-loop 368 | clojure.pprint/set-pprint-dispatch 369 | clojure.pprint/simple-dispatch 370 | clojure.pprint/with-pprint-dispatch 371 | clojure.pprint/write 372 | clojure.pprint/write-out 373 | clojure.reflect/->AsmReflector 374 | clojure.reflect/->Constructor 375 | clojure.reflect/->Field 376 | clojure.reflect/->JavaReflector 377 | clojure.reflect/->Method 378 | clojure.reflect/ClassResolver 379 | clojure.reflect/Reflector 380 | clojure.reflect/TypeReference 381 | clojure.reflect/do-reflect 382 | clojure.reflect/flag-descriptors 383 | clojure.reflect/map->Constructor 384 | clojure.reflect/map->Field 385 | clojure.reflect/map->Method 386 | clojure.reflect/reflect 387 | clojure.reflect/resolve-class 388 | clojure.reflect/type-reflect 389 | clojure.reflect/typename 390 | clojure.repl/demunge 391 | clojure.repl/dir-fn 392 | clojure.repl/root-cause 393 | clojure.repl/set-break-handler! 394 | clojure.repl/source-fn 395 | clojure.repl/stack-element-str 396 | clojure.repl/thread-stopper 397 | clojure.spec.alpha/*coll-check-limit* 398 | clojure.spec.alpha/*coll-error-limit* 399 | clojure.spec.alpha/*compile-asserts* 400 | clojure.spec.alpha/*fspec-iterations* 401 | clojure.spec.alpha/*recursion-limit* 402 | clojure.spec.alpha/Spec 403 | clojure.spec.alpha/Specize 404 | clojure.spec.alpha/abbrev 405 | clojure.spec.alpha/alt-impl 406 | clojure.spec.alpha/amp-impl 407 | clojure.spec.alpha/and-spec-impl 408 | clojure.spec.alpha/assert* 409 | clojure.spec.alpha/cat-impl 410 | clojure.spec.alpha/conform* 411 | clojure.spec.alpha/def-impl 412 | clojure.spec.alpha/describe* 413 | clojure.spec.alpha/every-impl 414 | clojure.spec.alpha/explain* 415 | clojure.spec.alpha/explain-data* 416 | clojure.spec.alpha/fspec-impl 417 | clojure.spec.alpha/gen* 418 | clojure.spec.alpha/invalid? 419 | clojure.spec.alpha/map-spec-impl 420 | clojure.spec.alpha/maybe-impl 421 | clojure.spec.alpha/merge-spec-impl 422 | clojure.spec.alpha/multi-spec-impl 423 | clojure.spec.alpha/nilable-impl 424 | clojure.spec.alpha/nonconforming 425 | clojure.spec.alpha/or-spec-impl 426 | clojure.spec.alpha/regex-spec-impl 427 | clojure.spec.alpha/regex? 428 | clojure.spec.alpha/rep+impl 429 | clojure.spec.alpha/rep-impl 430 | clojure.spec.alpha/spec-impl 431 | clojure.spec.alpha/specize* 432 | clojure.spec.alpha/tuple 433 | clojure.spec.alpha/tuple-impl 434 | clojure.spec.alpha/unform* 435 | clojure.spec.alpha/with-gen* 436 | clojure.spec.gen.alpha/any 437 | clojure.spec.gen.alpha/any-printable 438 | clojure.spec.gen.alpha/bind 439 | clojure.spec.gen.alpha/boolean 440 | clojure.spec.gen.alpha/bytes 441 | clojure.spec.gen.alpha/cat 442 | clojure.spec.gen.alpha/char 443 | clojure.spec.gen.alpha/char-alpha 444 | clojure.spec.gen.alpha/char-alphanumeric 445 | clojure.spec.gen.alpha/char-ascii 446 | clojure.spec.gen.alpha/choose 447 | clojure.spec.gen.alpha/delay 448 | clojure.spec.gen.alpha/delay-impl 449 | clojure.spec.gen.alpha/double 450 | clojure.spec.gen.alpha/double* 451 | clojure.spec.gen.alpha/elements 452 | clojure.spec.gen.alpha/fmap 453 | clojure.spec.gen.alpha/for-all* 454 | clojure.spec.gen.alpha/frequency 455 | clojure.spec.gen.alpha/gen-for-name 456 | clojure.spec.gen.alpha/gen-for-pred 457 | clojure.spec.gen.alpha/generate 458 | clojure.spec.gen.alpha/hash-map 459 | clojure.spec.gen.alpha/int 460 | clojure.spec.gen.alpha/keyword 461 | clojure.spec.gen.alpha/keyword-ns 462 | clojure.spec.gen.alpha/large-integer 463 | clojure.spec.gen.alpha/large-integer* 464 | clojure.spec.gen.alpha/lazy-combinator 465 | clojure.spec.gen.alpha/lazy-combinators 466 | clojure.spec.gen.alpha/lazy-prim 467 | clojure.spec.gen.alpha/lazy-prims 468 | clojure.spec.gen.alpha/list 469 | clojure.spec.gen.alpha/map 470 | clojure.spec.gen.alpha/not-empty 471 | clojure.spec.gen.alpha/one-of 472 | clojure.spec.gen.alpha/quick-check 473 | clojure.spec.gen.alpha/ratio 474 | clojure.spec.gen.alpha/return 475 | clojure.spec.gen.alpha/sample 476 | clojure.spec.gen.alpha/set 477 | clojure.spec.gen.alpha/shuffle 478 | clojure.spec.gen.alpha/simple-type 479 | clojure.spec.gen.alpha/simple-type-printable 480 | clojure.spec.gen.alpha/string 481 | clojure.spec.gen.alpha/string-alphanumeric 482 | clojure.spec.gen.alpha/string-ascii 483 | clojure.spec.gen.alpha/such-that 484 | clojure.spec.gen.alpha/symbol 485 | clojure.spec.gen.alpha/symbol-ns 486 | clojure.spec.gen.alpha/tuple 487 | clojure.spec.gen.alpha/uuid 488 | clojure.spec.gen.alpha/vector 489 | clojure.spec.gen.alpha/vector-distinct 490 | clojure.stacktrace/e 491 | clojure.stacktrace/print-cause-trace 492 | clojure.stacktrace/print-stack-trace 493 | clojure.stacktrace/print-throwable 494 | clojure.stacktrace/print-trace-element 495 | clojure.stacktrace/root-cause 496 | clojure.template/apply-template 497 | clojure.template/do-template 498 | clojure.test.junit/*depth* 499 | clojure.test.junit/*var-context* 500 | clojure.test.junit/element-content 501 | clojure.test.junit/error-el 502 | clojure.test.junit/failure-el 503 | clojure.test.junit/finish-case 504 | clojure.test.junit/finish-element 505 | clojure.test.junit/finish-suite 506 | clojure.test.junit/indent 507 | clojure.test.junit/junit-report 508 | clojure.test.junit/message-el 509 | clojure.test.junit/package-class 510 | clojure.test.junit/start-case 511 | clojure.test.junit/start-element 512 | clojure.test.junit/start-suite 513 | clojure.test.junit/suite-attrs 514 | clojure.test.junit/test-name 515 | clojure.test.junit/with-junit-output 516 | clojure.test.tap/print-diagnostics 517 | clojure.test.tap/print-tap-diagnostic 518 | clojure.test.tap/print-tap-fail 519 | clojure.test.tap/print-tap-pass 520 | clojure.test.tap/print-tap-plan 521 | clojure.test.tap/tap-report 522 | clojure.test.tap/with-tap-output 523 | clojure.test/*initial-report-counters* 524 | clojure.test/*load-tests* 525 | clojure.test/*report-counters* 526 | clojure.test/*stack-trace-depth* 527 | clojure.test/*test-out* 528 | clojure.test/*testing-contexts* 529 | clojure.test/*testing-vars* 530 | clojure.test/are 531 | clojure.test/assert-any 532 | clojure.test/assert-expr 533 | clojure.test/assert-predicate 534 | clojure.test/compose-fixtures 535 | clojure.test/deftest 536 | clojure.test/deftest- 537 | clojure.test/do-report 538 | clojure.test/file-position 539 | clojure.test/function? 540 | clojure.test/get-possibly-unbound-var 541 | clojure.test/inc-report-counter 542 | clojure.test/is 543 | clojure.test/join-fixtures 544 | clojure.test/report 545 | clojure.test/run-all-tests 546 | clojure.test/run-tests 547 | clojure.test/set-test 548 | clojure.test/successful? 549 | clojure.test/test-all-vars 550 | clojure.test/test-ns 551 | clojure.test/test-var 552 | clojure.test/test-vars 553 | clojure.test/testing 554 | clojure.test/testing-contexts-str 555 | clojure.test/testing-vars-str 556 | clojure.test/try-expr 557 | clojure.test/use-fixtures 558 | clojure.test/with-test 559 | clojure.test/with-test-out 560 | clojure.walk/keywordize-keys 561 | clojure.walk/stringify-keys 562 | clojure.xml/*current* 563 | clojure.xml/*sb* 564 | clojure.xml/*stack* 565 | clojure.xml/*state* 566 | clojure.xml/attrs 567 | clojure.xml/content 568 | clojure.xml/content-handler 569 | clojure.xml/element 570 | clojure.xml/emit 571 | clojure.xml/emit-element 572 | clojure.xml/startparse-sax 573 | clojure.xml/tag 574 | create-struct 575 | defstruct 576 | delay? 577 | denominator 578 | destructure 579 | find-protocol-impl 580 | find-protocol-method 581 | hash-combine 582 | hash-ordered-coll 583 | hash-unordered-coll 584 | inst-ms 585 | inst-ms* 586 | method-sig 587 | mix-collection-hash 588 | munge 589 | namespace-munge 590 | numerator 591 | primitives-classnames 592 | print-ctor 593 | print-dup 594 | print-method 595 | print-simple 596 | proxy-call-with-super 597 | proxy-name 598 | read 599 | read+string 600 | read-string 601 | reader-conditional 602 | reader-conditional? 603 | refer-clojure 604 | remove-tap 605 | replicate 606 | special-symbol? 607 | struct 608 | struct-map 609 | tagged-literal 610 | tagged-literal? 611 | tap> 612 | unchecked-add-int 613 | unchecked-byte 614 | unchecked-char 615 | unchecked-dec-int 616 | unchecked-divide-int 617 | unchecked-double 618 | unchecked-float 619 | unchecked-inc-int 620 | unchecked-int 621 | unchecked-long 622 | unchecked-multiply-int 623 | unchecked-negate-int 624 | unchecked-remainder-int 625 | unchecked-short 626 | unchecked-subtract-int 627 | unquote 628 | unquote-splicing 629 | with-bindings 630 | with-bindings* 631 | with-loading-context 632 | -------------------------------------------------------------------------------- /src/clj-jvm/CHANGELOG.txt: -------------------------------------------------------------------------------- 1 | --------------------------------------------------------------------- 2 | April 19, 2022 - Clojure 1.8 - 1.11, sheet v55 3 | 4 | I forgot about the new clojure.math namespace added to Clojure 1.11, 5 | and so neglected to document which of the new Vars added to that 6 | namespace were added to the cheatsheet, versus which were not. Here 7 | is a complete list of them, without their "clojure.math/" namespace 8 | qualifier: 9 | 10 | New things in clojure.math namespace of Clojure 1.11 that have _not_ 11 | been added to the sheet at this time: 12 | 13 | IEEE-remainder add-exact copy-sign cosh decrement-exact 14 | get-exponent hypot increment-exact multiply-exact negate-exact 15 | next-after next-down next-up scalb signum sinh subtract-exact tanh 16 | to-degrees to-radians ulp 17 | 18 | New things in clojure.math namespace of Clojure 1.11 that have been 19 | added to the sheet in this version: 20 | 21 | Added to Primitives / Numbers / Arithmetic section: 22 | 23 | floor-div floor-mod 24 | ceil floor rint round 25 | pow sqrt cbrt 26 | E exp expm1 log log10 log1p 27 | PI sin cos tan asin acos atan atan2 28 | 29 | Added to Primitives / Numbers / Random section: 30 | 31 | random 32 | 33 | Changed links to a couple of Github repos in organization 34 | https://github.com/amalloy to point to to their new home in 35 | https://github.com/clj-commons 36 | 37 | Updated links to new Vars in Clojure 1.10 to point at ClojureDocs.org 38 | web site. When I created the first version of the cheatsheet with 39 | these then-new Clojure 1.10 Vars, they did not exist yet on 40 | ClojureDocs.org, so I made their occurrences on the cheatsheet link to 41 | their official API docs instead. 42 | 43 | --------------------------------------------------------------------- 44 | April 15, 2022 - Clojure 1.8 - 1.11, sheet v54 45 | 46 | New things for Clojure 1.11 that have been added to the sheet in this 47 | version: 48 | 49 | Added to Sequences / Creating a Lazy Seq / From producer fn section: 50 | 51 | iteration 52 | 53 | Unless the subtle bugs in the core.rrb-vector library are fixed, it 54 | seems best not to point people towards it in the cheatsheet. Removed 55 | all mentions of it in this version. 56 | 57 | --------------------------------------------------------------------- 58 | April 15, 2022 - Clojure 1.8 - 1.11, sheet v53 59 | 60 | Made 'minimum version' Clojure 1.8, removing all (1.8) tags marking 61 | things as new in 1.8. Tags for things new in (1.9) (1.10) are still 62 | present, as are tags (1.11) for things new in Clojure 1.11.0. 63 | 64 | New things for Clojure 1.11 that have _not_ been added to the sheet at 65 | this time: 66 | 67 | clojure.test/run-test 68 | clojure.test/run-test-var 69 | clojure.xml/disable-external-entities 70 | clojure.xml/sax-parser 71 | clojure.xml/startparse-sax-safe 72 | seq-to-map-for-destructuring 73 | iteration (I plan to add iteration soon, after getting 74 | recommendations on where to add it.) 75 | 76 | New things for Clojure 1.11 that have been added to the sheet in this 77 | version: 78 | 79 | Added to Primitives / Numbers / Arithmetic section: 80 | 81 | abs 82 | 83 | Added to Primitives / Numbers / Test section: 84 | 85 | NaN? infinite? 86 | 87 | Added to Primitives / Strings / Use section: 88 | 89 | parse-boolean parse-double parse-long parse-uuid 90 | 91 | Added to Collections / Maps / 'Change' section: 92 | 93 | update-keys update-vals 94 | 95 | Added to Other / Misc section: 96 | 97 | random-uuid 98 | 99 | --------------------------------------------------------------------- 100 | September 28, 2020 - Clojure 1.7 - 1.10, sheet v52 101 | 102 | Updated the version of Clojure used to generate the cheatsheet from 103 | 1.10.1 to 10.10.2-alpha2, which corrected the doc strings printed for 104 | special forms, no longer repeating a significant part of their 105 | contents twice. 106 | 107 | Also updated the version of many other libraries such as data.json, 108 | core.async, etc. The only effect of this was that one of the 109 | core.async functions or macros had an additional couple of sentences 110 | in its doc string. 111 | 112 | Removed one dependency in the cheat sheet generator program, by 113 | copying the one tiny function used from there (same EPL license) into 114 | the generator program. 115 | 116 | --------------------------------------------------------------------- 117 | December 23, 2019 - Clojure 1.7 - 1.10, sheet v51 118 | 119 | --------------------------------------------------------------------- 120 | December 22, 2019 - Clojure 1.7 - 1.10, sheet v50 121 | 122 | For those variants of the cheatsheet that included summary data about 123 | the number of ClojureDocs examples and notes there are, and what the 124 | see-also symbols are, they are now generated from a version of the 125 | ClojureDocs.org site data from late 2018, instead of late 2014 as it 126 | has been for 5 years now. 127 | 128 | --------------------------------------------------------------------- 129 | June 20, 2019 - Clojure 1.7 - 1.10, sheet v49 130 | 131 | Added new section Datafy with these functions: 132 | 133 | clojure.datafy/datafy 134 | clojure.datafy/nav 135 | 136 | Added new section IO / tap with these functions: 137 | 138 | tap> add-tap remove-tap 139 | 140 | Added these functions to section Java Interoperation / Exceptions: 141 | 142 | clojure.core/Throwable->map 143 | clojure.main/err->msg 144 | clojure.main/report-error 145 | 146 | --------------------------------------------------------------------- 147 | June 14, 2019 - Clojure 1.7 - 1.10, sheet v48 148 | 149 | Added these two functions, which were somehow left out before: 150 | 151 | clojure.edn/read 152 | clojure.edn/read-string 153 | 154 | --------------------------------------------------------------------- 155 | December 17, 2018 - Clojure 1.7 - 1.10, sheet v47 156 | 157 | Additional new things in Clojure 1.10, not mentioned in v46 comments 158 | below, that have _not_ been added to the sheet at this time: 159 | 160 | clojure.datafy/datafy 161 | clojure.datafy/nav 162 | clojure.main/renumbering-read 163 | 164 | Additional new things for Clojure 1.10 that have been added to the 165 | sheet in this version: 166 | 167 | Added to Namespace / From symbol section: 168 | 169 | requiring-resolve 170 | 171 | --------------------------------------------------------------------- 172 | October 12, 2018 - Clojure 1.7 - 1.10, sheet v46 173 | 174 | Made 'minimum version' Clojure 1.7, removing all (1.7) tags marking 175 | things as new in 1.7. Tags for things new in (1.8) (1.9) are still 176 | present, as are tags (1.10) for things new in Clojure 1.10.0. 177 | 178 | New things for Clojure 1.10 that have _not_ been added to the sheet at 179 | this time: 180 | 181 | PrintWriter-on read+string 182 | add-tap remove-tap tap> 183 | 184 | clojure.core.protocols/Datafiable clojure.core.protocols/Navigable 185 | clojure.core.protocols/datafy clojure.core.protocols/nav 186 | 187 | clojure.core.server/io-prepl clojure.core.server/prepl 188 | clojure.core.server/remote-prepl 189 | 190 | clojure.core.specs.alpha/even-number-of-forms? 191 | clojure.spec.gen.alpha/shuffle 192 | 193 | New things for Clojure 1.10 that have been added to the sheet in this 194 | version: 195 | 196 | Added to Java Interoperation / Exceptions section: 197 | 198 | ex-cause ex-message clojure.main/ex-str 199 | 200 | --------------------------------------------------------------------- 201 | August 28, 2018 - Clojure 1.6 - 1.9, sheet v45 202 | 203 | Added #: and ## to Special Characters section. 204 | 205 | Corrected link to Java .lastIndexOf method to be in class 206 | java.util.List, which is the interface that Clojure's lists and 207 | vectors implement, not interface java.util.Vector as the link was 208 | before. 209 | 210 | --------------------------------------------------------------------- 211 | March 19, 2018 - Clojure 1.6 - 1.9, sheet v44 212 | 213 | Corrected link to Spec guide page on clojure.org 214 | 215 | Added these predicates for numbers, added in Clojure 1.9, to the 216 | section Primitives / Numbers / Test: 217 | 218 | double? int? nat-int? neg-int? pos-int? 219 | 220 | They were added to the new "Spec" section of the cheatsheet earlier, 221 | but it seems reasonable to add them in Primitives / Numbers / Test, 222 | too. 223 | 224 | 225 | --------------------------------------------------------------------- 226 | December 16, 2017 - Clojure 1.6 - 1.9, sheet v43 227 | 228 | Categorization of spec-related functions and macros from Alex Miller: 229 | 230 | Operations: 231 | valid? conform unform 232 | explain explain-data explain-str explain-out 233 | form describe 234 | assert check-asserts check-asserts? 235 | 236 | Generator operations: 237 | gen 238 | exercise exercise-fn 239 | 240 | Spec definitions and registry: 241 | def fdef 242 | registry 243 | get-spec 244 | spec? 245 | spec with-gen 246 | 247 | Logical specs: 248 | and, or 249 | 250 | Collection specs: 251 | coll-of, map-of - fully realizing coll specs 252 | every, every-kv - sampling coll specs 253 | keys - attribute maps 254 | merge - combining map specs 255 | 256 | Regex specs: 257 | cat alt * + ? & keys* 258 | 259 | Range specs: 260 | int-in inst-in double-in 261 | int-in-range? inst-in-range? 262 | 263 | Other spec functions: 264 | nilable (also nonconforming which is currently undocumented, but useful) 265 | multi-spec - multimethod spec 266 | fspec - anonymous function spec 267 | conformer 268 | 269 | Custom explain printer: 270 | explain-printer 271 | *explain-out* 272 | 273 | --------------------------------------------------------------------- 274 | December 14, 2017 - Clojure 1.6 - 1.9, sheet v42 275 | 276 | Made 'minimum version' Clojure 1.6, removing all (1.6) tags marking 277 | things as new in 1.6. Tags for things new in (1.7) (1.8) are still 278 | present, as are tags (1.9) for things new in Clojure 1.9.0. 279 | 280 | New things for Clojure 1.9 that have _not_ been added to the sheet at 281 | this time: 282 | 283 | *print-namespace-maps* *reader-resolver* Inst inst-ms inst-ms* 284 | 285 | New things for Clojure 1.9 that have been added to the sheet in this 286 | version: 287 | 288 | New in Concurrency / Atoms: reset-vals! swap-vals! 289 | New in Collections / Collections / Generic Ops: bounded-count 290 | New in Transducers / Off the shelf: halt-when 291 | New in Java Interoperation / Exceptions: StackTraceElement->vec 292 | 293 | Predicate functions that all have generators defined for them in 294 | version 0.9.0 of test.check are listed below, divided into a few 295 | categories. Many are new in Clojure 1.9, but many existed before. 296 | 297 | numbers: (pre 1.9) number? rational? integer? ratio? decimal? 298 | float? zero? (1.9) double? int? nat-int? neg-int? pos-int? 299 | 300 | symbols, keywords: (pre 1.9) keyword? symbol? (1.9) ident? 301 | qualified-ident? qualified-keyword? qualified-symbol? 302 | simple-ident? simple-keyword? simple-symbol? 303 | 304 | other scalar types: (pre 1.9) string? true? false? nil? some? 305 | (1.9) boolean? bytes? inst? uri? uuid? 306 | 307 | collections: (pre 1.9) list? map? set? vector? associative? coll? 308 | sequential? seq? empty? (1.9) indexed? seqable? 309 | 310 | other: (1.9) any? 311 | 312 | The functions below have no generator defined for them in version 313 | 0.9.0 of test.check. They are listed here solely because I was 314 | composing a list of all predicate functions in Clojure, to determine 315 | which ones had generators in test.check, vs. which did not. 316 | 317 | Those that take any type of argument, without throwing exceptions: 318 | 319 | reduced? sorted? counted? reversible? record? map-entry? fn? ifn? 320 | var? future? volatile? class? 321 | 322 | Those that throw exceptions for some types of arguments: 323 | 324 | pos? neg? even? odd? realized? bound? thread-bound? future-done? 325 | future-cancelled? 326 | 327 | Vars in clojure.spec.alpha and related namespaces documented in spec 328 | guide at: https://clojure.org/guides/spec 329 | 330 | I will try to categorize these and add them to the sheet in a future 331 | version. I don't know enough to give them a good categorization yet. 332 | 333 | (require '[clojure.spec.alpha :as s]) 334 | (require '[clojure.spec.gen.alpha :as gen]) 335 | (require '[clojure.spec.test.alpha :as stest]) 336 | 337 | s/conform s/valid? s/def s/explain s/explain-data s/keys s/keys* s/merge 338 | s/and s/or s/nilable s/multi-spec s/coll-of s/tuple s/cat s/map-of 339 | s/alt s/* s/+ s/? s/& s/spec 340 | s/assert s/check-asserts s/fdef s/fspec 341 | s/gen 342 | gen/generate gen/sample 343 | s/exercise s/exercise-fn 344 | gen/fmap gen/such-that gen/string-alphanumeric gen/tuple 345 | s/with-gen 346 | s/int-in s/inst-in s/double-in 347 | 348 | stest/instrument stest/check stest/abbrev-result 349 | stest/enumerate-namespace stest/summarize-results 350 | stest/unstrument 351 | 352 | Predicates from earlier versions of Clojure that can only take 353 | particular types as arguments, or else they throw an exception: 354 | 355 | zero? pos? neg? even? odd? clojure.string/blank? realized? 356 | clojure.zip/branch? clojure.zip/end? empty? bound? thread-bound? 357 | future-done? future-cancelled? 358 | 359 | Predicates in earlier versions of Clojure that require more than one 360 | argument: 361 | 362 | clojure.string/starts-with? clojure.string/ends-with? 363 | clojure.string/includes? identical? instance? every? not-every? 364 | not-any? contains? clojure.set/subseT? clojure.set/superset? 365 | satisfies? extends? isa? distinct? 366 | 367 | distinct? doesn't require more than one argument, but is really meant 368 | for collections, not individual values. 369 | 370 | --------------------------------------------------------------------- 371 | November 11, 2017 - Clojure 1.5 - 1.8, sheet v41 372 | 373 | Updated list of keyword literal examples in Primitives/Other section. 374 | Added the ::namespace-alias/kw case, which had not been mentioned 375 | before. Replace "ns" abbreviations with "namespace". 376 | 377 | --------------------------------------------------------------------- 378 | July 12, 2017 - Clojure 1.5 - 1.8, sheet v40 379 | 380 | Update org.flatland/ordered dependency to newly released version 381 | 1.5.5, which has updated doc strings for the ordered-set and 382 | ordered-map functions. Better tooltips in the cheatsheet! 383 | 384 | --------------------------------------------------------------------- 385 | June 17, 2017 - Clojure 1.5 - 1.8, sheet v39 386 | 387 | Update links from http to https, except for this one, which doesn't 388 | support https: http://www.regular-expressions.info 389 | 390 | Update Oracle documentation links from JDK7 to JDK8. State of Clojure 391 | 2016 survey indicates that over 90% of Clojure/Java users use JDK8. 392 | 393 | Fixed a couple of stale links to anchors within the page 394 | https://clojure.org/reference/reader 395 | 396 | --------------------------------------------------------------------- 397 | June 17, 2017 - Clojure 1.5 - 1.8, sheet v38 398 | 399 | Replace link from blog article "Weird and Wonderful Characters of 400 | Clojure" to instead link link to the new "Reading Clojure Characters" 401 | Clojure guide that started from the blog article, then enhanced it: 402 | https://clojure.org/guides/weird_characters 403 | 404 | Add to "Special Characters" section the core.async macros >!! ! 405 | ->> 527 | *foo* earmuffs - convention to indicate dynamic vars 528 || t |