├── .editorconfig ├── .gitignore ├── Gruntfile.js ├── LICENSE.md ├── README.md ├── cljs-client └── cljs_cheatsheet_client │ ├── core.cljs │ ├── dom.cljs │ ├── html.cljs │ ├── state.cljs │ ├── tooltips.cljs │ └── util.cljs ├── cljs-server └── cljs_cheatsheet_server │ └── core.cljs ├── cljs-shared └── cljs_cheatsheet │ └── util.cljs ├── default.nix ├── design.md ├── docfiles ├── cljs.core_-.cljsdoc ├── cljs.core_-GT.cljsdoc ├── cljs.core_-GTGT.cljsdoc ├── cljs.core_=.cljsdoc ├── cljs.core_==.cljsdoc ├── cljs.core_DOT.cljsdoc ├── cljs.core_DOTDOT.cljsdoc ├── cljs.core_EQ.cljsdoc ├── cljs.core_EQEQ.cljsdoc ├── cljs.core_GT.cljsdoc ├── cljs.core_GT=.cljsdoc ├── cljs.core_GTEQ.cljsdoc ├── cljs.core_LT.cljsdoc ├── cljs.core_LT=.cljsdoc ├── cljs.core_LTEQ.cljsdoc ├── cljs.core_PLUS.cljsdoc ├── cljs.core_SLASH.cljsdoc ├── cljs.core_STAR.cljsdoc ├── cljs.core_aclone.cljsdoc ├── cljs.core_add-watch.cljsdoc ├── cljs.core_aget.cljsdoc ├── cljs.core_alength.cljsdoc ├── cljs.core_amap.cljsdoc ├── cljs.core_and.cljsdoc ├── cljs.core_apply.cljsdoc ├── cljs.core_areduce.cljsdoc ├── cljs.core_array-map.cljsdoc ├── cljs.core_array-seq.cljsdoc ├── cljs.core_array.cljsdoc ├── cljs.core_arrayQMARK.cljsdoc ├── cljs.core_as-GT.cljsdoc ├── cljs.core_aset.cljsdoc ├── cljs.core_assert.cljsdoc ├── cljs.core_assoc-in.cljsdoc ├── cljs.core_assoc.cljsdoc ├── cljs.core_assocBANG.cljsdoc ├── cljs.core_associativeQMARK.cljsdoc ├── cljs.core_atom.cljsdoc ├── cljs.core_binding.cljsdoc ├── cljs.core_bit-and-not.cljsdoc ├── cljs.core_bit-and.cljsdoc ├── cljs.core_bit-clear.cljsdoc ├── cljs.core_bit-flip.cljsdoc ├── cljs.core_bit-not.cljsdoc ├── cljs.core_bit-or.cljsdoc ├── cljs.core_bit-set.cljsdoc ├── cljs.core_bit-shift-left.cljsdoc ├── cljs.core_bit-shift-right.cljsdoc ├── cljs.core_bit-test.cljsdoc ├── cljs.core_bit-xor.cljsdoc ├── cljs.core_butlast.cljsdoc ├── cljs.core_case.cljsdoc ├── cljs.core_catch.cljsdoc ├── cljs.core_char.cljsdoc ├── cljs.core_clj-GTjs.cljsdoc ├── cljs.core_collQMARK.cljsdoc ├── cljs.core_comp.cljsdoc ├── cljs.core_compare-and-setBANG.cljsdoc ├── cljs.core_compare.cljsdoc ├── cljs.core_complement.cljsdoc ├── cljs.core_concat.cljsdoc ├── cljs.core_cond-GT.cljsdoc ├── cljs.core_cond-GTGT.cljsdoc ├── cljs.core_cond.cljsdoc ├── cljs.core_condp.cljsdoc ├── cljs.core_conj.cljsdoc ├── cljs.core_cons.cljsdoc ├── cljs.core_constantly.cljsdoc ├── cljs.core_containsQMARK.cljsdoc ├── cljs.core_count.cljsdoc ├── cljs.core_countedQMARK.cljsdoc ├── cljs.core_cycle.cljsdoc ├── cljs.core_dec.cljsdoc ├── cljs.core_declare.cljsdoc ├── cljs.core_def.cljsdoc ├── cljs.core_defn-.cljsdoc ├── cljs.core_defn.cljsdoc ├── cljs.core_deref.cljsdoc ├── cljs.core_disj.cljsdoc ├── cljs.core_dissoc.cljsdoc ├── cljs.core_distinct.cljsdoc ├── cljs.core_distinctQMARK.cljsdoc ├── cljs.core_doall.cljsdoc ├── cljs.core_dorun.cljsdoc ├── cljs.core_doseq.cljsdoc ├── cljs.core_dotimes.cljsdoc ├── cljs.core_drop-last.cljsdoc ├── cljs.core_drop-while.cljsdoc ├── cljs.core_drop.cljsdoc ├── cljs.core_empty.cljsdoc ├── cljs.core_emptyQMARK.cljsdoc ├── cljs.core_evenQMARK.cljsdoc ├── cljs.core_every-pred.cljsdoc ├── cljs.core_everyQMARK.cljsdoc ├── cljs.core_falseQMARK.cljsdoc ├── cljs.core_ffirst.cljsdoc ├── cljs.core_filter.cljsdoc ├── cljs.core_filterv.cljsdoc ├── cljs.core_finally.cljsdoc ├── cljs.core_find.cljsdoc ├── cljs.core_first.cljsdoc ├── cljs.core_flatten.cljsdoc ├── cljs.core_fn.cljsdoc ├── cljs.core_fnQMARK.cljsdoc ├── cljs.core_fnext.cljsdoc ├── cljs.core_fnil.cljsdoc ├── cljs.core_for.cljsdoc ├── cljs.core_frequencies.cljsdoc ├── cljs.core_get-in.cljsdoc ├── cljs.core_get-validator.cljsdoc ├── cljs.core_get.cljsdoc ├── cljs.core_group-by.cljsdoc ├── cljs.core_hash-map.cljsdoc ├── cljs.core_hash-set.cljsdoc ├── cljs.core_identicalQMARK.cljsdoc ├── cljs.core_identity.cljsdoc ├── cljs.core_if-let.cljsdoc ├── cljs.core_if-not.cljsdoc ├── cljs.core_if-some.cljsdoc ├── cljs.core_if.cljsdoc ├── cljs.core_ifnQMARK.cljsdoc ├── cljs.core_inc.cljsdoc ├── cljs.core_instanceQMARK.cljsdoc ├── cljs.core_int.cljsdoc ├── cljs.core_integerQMARK.cljsdoc ├── cljs.core_interleave.cljsdoc ├── cljs.core_interpose.cljsdoc ├── cljs.core_into-array.cljsdoc ├── cljs.core_into.cljsdoc ├── cljs.core_iterate.cljsdoc ├── cljs.core_js-GTclj.cljsdoc ├── cljs.core_js-delete.cljsdoc ├── cljs.core_js-obj.cljsdoc ├── cljs.core_juxt.cljsdoc ├── cljs.core_keep-indexed.cljsdoc ├── cljs.core_keep.cljsdoc ├── cljs.core_key.cljsdoc ├── cljs.core_keys.cljsdoc ├── cljs.core_last.cljsdoc ├── cljs.core_lazy-cat.cljsdoc ├── cljs.core_lazy-seq.cljsdoc ├── cljs.core_let.cljsdoc ├── cljs.core_letfn.cljsdoc ├── cljs.core_list.cljsdoc ├── cljs.core_listQMARK.cljsdoc ├── cljs.core_listSTAR.cljsdoc ├── cljs.core_make-array.cljsdoc ├── cljs.core_map-indexed.cljsdoc ├── cljs.core_map.cljsdoc ├── cljs.core_mapQMARK.cljsdoc ├── cljs.core_mapcat.cljsdoc ├── cljs.core_mapv.cljsdoc ├── cljs.core_max-key.cljsdoc ├── cljs.core_max.cljsdoc ├── cljs.core_memoize.cljsdoc ├── cljs.core_merge-with.cljsdoc ├── cljs.core_merge.cljsdoc ├── cljs.core_min-key.cljsdoc ├── cljs.core_min.cljsdoc ├── cljs.core_mod.cljsdoc ├── cljs.core_name.cljsdoc ├── cljs.core_negQMARK.cljsdoc ├── cljs.core_next.cljsdoc ├── cljs.core_nfirst.cljsdoc ├── cljs.core_nilQMARK.cljsdoc ├── cljs.core_nnext.cljsdoc ├── cljs.core_not-anyQMARK.cljsdoc ├── cljs.core_not-empty.cljsdoc ├── cljs.core_not-everyQMARK.cljsdoc ├── cljs.core_not.cljsdoc ├── cljs.core_not=.cljsdoc ├── cljs.core_notEQ.cljsdoc ├── cljs.core_ns.cljsdoc ├── cljs.core_nth.cljsdoc ├── cljs.core_nthnext.cljsdoc ├── cljs.core_nthrest.cljsdoc ├── cljs.core_numberQMARK.cljsdoc ├── cljs.core_objectQMARK.cljsdoc ├── cljs.core_oddQMARK.cljsdoc ├── cljs.core_or.cljsdoc ├── cljs.core_partial.cljsdoc ├── cljs.core_partition-all.cljsdoc ├── cljs.core_partition-by.cljsdoc ├── cljs.core_partition.cljsdoc ├── cljs.core_peek.cljsdoc ├── cljs.core_pop.cljsdoc ├── cljs.core_posQMARK.cljsdoc ├── cljs.core_prim-seq.cljsdoc ├── cljs.core_quot.cljsdoc ├── cljs.core_rand-int.cljsdoc ├── cljs.core_rand-nth.cljsdoc ├── cljs.core_rand.cljsdoc ├── cljs.core_range.cljsdoc ├── cljs.core_re-find.cljsdoc ├── cljs.core_re-matches.cljsdoc ├── cljs.core_re-pattern.cljsdoc ├── cljs.core_re-seq.cljsdoc ├── cljs.core_realizedQMARK.cljsdoc ├── cljs.core_reduce-kv.cljsdoc ├── cljs.core_reduce.cljsdoc ├── cljs.core_reductions.cljsdoc ├── cljs.core_rem.cljsdoc ├── cljs.core_remove-watch.cljsdoc ├── cljs.core_remove.cljsdoc ├── cljs.core_repeat.cljsdoc ├── cljs.core_repeatedly.cljsdoc ├── cljs.core_replace.cljsdoc ├── cljs.core_resetBANG.cljsdoc ├── cljs.core_rest.cljsdoc ├── cljs.core_reverse.cljsdoc ├── cljs.core_reversibleQMARK.cljsdoc ├── cljs.core_rseq.cljsdoc ├── cljs.core_rsubseq.cljsdoc ├── cljs.core_second.cljsdoc ├── cljs.core_select-keys.cljsdoc ├── cljs.core_seq.cljsdoc ├── cljs.core_seqQMARK.cljsdoc ├── cljs.core_sequentialQMARK.cljsdoc ├── cljs.core_set-validatorBANG.cljsdoc ├── cljs.core_set.cljsdoc ├── cljs.core_setBANG.cljsdoc ├── cljs.core_setQMARK.cljsdoc ├── cljs.core_shuffle.cljsdoc ├── cljs.core_some-GT.cljsdoc ├── cljs.core_some-GTGT.cljsdoc ├── cljs.core_some-fn.cljsdoc ├── cljs.core_some.cljsdoc ├── cljs.core_someQMARK.cljsdoc ├── cljs.core_sort-by.cljsdoc ├── cljs.core_sort.cljsdoc ├── cljs.core_sorted-map-by.cljsdoc ├── cljs.core_sorted-map.cljsdoc ├── cljs.core_sorted-set-by.cljsdoc ├── cljs.core_sorted-set.cljsdoc ├── cljs.core_sortedQMARK.cljsdoc ├── cljs.core_split-at.cljsdoc ├── cljs.core_split-with.cljsdoc ├── cljs.core_str.cljsdoc ├── cljs.core_stringQMARK.cljsdoc ├── cljs.core_subs.cljsdoc ├── cljs.core_subseq.cljsdoc ├── cljs.core_subvec.cljsdoc ├── cljs.core_swapBANG.cljsdoc ├── cljs.core_take-last.cljsdoc ├── cljs.core_take-nth.cljsdoc ├── cljs.core_take-while.cljsdoc ├── cljs.core_take.cljsdoc ├── cljs.core_throw.cljsdoc ├── cljs.core_to-array-2d.cljsdoc ├── cljs.core_tree-seq.cljsdoc ├── cljs.core_trueQMARK.cljsdoc ├── cljs.core_try.cljsdoc ├── cljs.core_unsigned-bit-shift-right.cljsdoc ├── cljs.core_update-in.cljsdoc ├── cljs.core_val.cljsdoc ├── cljs.core_vals.cljsdoc ├── cljs.core_vec.cljsdoc ├── cljs.core_vector.cljsdoc ├── cljs.core_vectorQMARK.cljsdoc ├── cljs.core_when-first.cljsdoc ├── cljs.core_when-let.cljsdoc ├── cljs.core_when-not.cljsdoc ├── cljs.core_when-some.cljsdoc ├── cljs.core_when.cljsdoc ├── cljs.core_while.cljsdoc ├── cljs.core_zeroQMARK.cljsdoc ├── cljs.core_zipmap.cljsdoc ├── clojure.set_difference.cljsdoc ├── clojure.set_intersection.cljsdoc ├── clojure.set_select.cljsdoc ├── clojure.set_subsetQMARK.cljsdoc ├── clojure.set_supersetQMARK.cljsdoc ├── clojure.set_union.cljsdoc ├── clojure.string_blankQMARK.cljsdoc ├── clojure.string_capitalize.cljsdoc ├── clojure.string_ends-withQMARK.cljsdoc ├── clojure.string_escape.cljsdoc ├── clojure.string_includesQMARK.cljsdoc ├── clojure.string_join.cljsdoc ├── clojure.string_lower-case.cljsdoc ├── clojure.string_replace-first.cljsdoc ├── clojure.string_replace.cljsdoc ├── clojure.string_reverse.cljsdoc ├── clojure.string_split-lines.cljsdoc ├── clojure.string_split.cljsdoc ├── clojure.string_starts-withQMARK.cljsdoc ├── clojure.string_trim-newline.cljsdoc ├── clojure.string_trim.cljsdoc ├── clojure.string_triml.cljsdoc ├── clojure.string_trimr.cljsdoc └── clojure.string_upper-case.cljsdoc ├── less ├── 000-main.less ├── 001-normalize-3.0.3.less └── 010-cheatsheet.less ├── package.json ├── project.clj ├── public ├── apple-touch-icon.png ├── favicon.ico ├── fonts │ ├── DroidSansMono.eot │ ├── DroidSansMono.woff │ ├── OpenSans-Italic.eot │ ├── OpenSans-Italic.woff │ ├── OpenSans-Light.eot │ ├── OpenSans-Light.woff │ ├── OpenSans-Semibold.eot │ ├── OpenSans-Semibold.woff │ ├── OpenSans-SemiboldItalic.eot │ ├── OpenSans-SemiboldItalic.woff │ ├── OpenSans.eot │ ├── OpenSans.woff │ ├── OpenSansLight-Italic.eot │ └── OpenSansLight-Italic.woff └── img │ ├── cljs-ring.svg │ └── info-circle.svg ├── server.js ├── snowflake-css.json └── yarn.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | # This file is for unifying the coding style for different editors and IDEs. 2 | # More information at http://EditorConfig.org 3 | 4 | # Do not check for any .editorconfig files above this directory 5 | root = true 6 | 7 | # All files 8 | [*] 9 | charset = utf-8 10 | end_of_line = lf 11 | indent_size = 2 12 | indent_style = space 13 | insert_final_newline = true 14 | trim_trailing_whitespace = true 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # build directory 2 | 00_build 3 | 4 | # npm libs 5 | node_modules/ 6 | 7 | # CLJS-generated files 8 | target/ 9 | public/js/cheatsheet.js 10 | public/js/cheatsheet.min.js 11 | app.js 12 | 13 | public/css/main.min.css 14 | public/docs.HASHME.json 15 | public/index.html 16 | 17 | symbols.json 18 | 19 | # ignore diff files 20 | *.diff 21 | -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | const md5 = require('md5') 2 | const kidif = require('kidif') 3 | const marked = require('marked') 4 | const shell = require('shelljs') 5 | 6 | const hashLength = 15 7 | 8 | module.exports = function (grunt) { 9 | 'use strict' 10 | 11 | // --------------------------------------------------------------------------- 12 | // Build docs.HASHME.json from kidif files 13 | 14 | function splitSection (str) { 15 | const lines = str.split('\n') 16 | const lines2 = [] 17 | for (let i = 0; i < lines.length; i++) { 18 | const line = lines[i].trim() 19 | if (line !== '') { 20 | lines2.push(line) 21 | } 22 | } 23 | return lines2 24 | } 25 | 26 | function docsToObj (docsArr) { 27 | const docs = {} 28 | 29 | for (let i = 0; i < docsArr.length; i++) { 30 | const symbol = docsArr[i] 31 | 32 | docs[symbol.name] = {} 33 | docs[symbol.name]['full-name'] = symbol.name 34 | docs[symbol.name].signature = splitSection(symbol.signature) 35 | docs[symbol.name]['description-html'] = marked(symbol.description) 36 | 37 | if (symbol.related) { 38 | docs[symbol.name].related = splitSection(symbol.related) 39 | } 40 | 41 | if (symbol.type) { 42 | docs[symbol.name].type = symbol.type 43 | } 44 | } 45 | 46 | return docs 47 | } 48 | 49 | function buildDocs () { 50 | const allDocsArr = kidif('docfiles/*.cljsdoc') 51 | const allDocsObj = docsToObj(allDocsArr) 52 | const symbolsWeNeed = require('./symbols.json') 53 | 54 | // build only the symbols we need for the cheatsheet 55 | const docsWeNeed = {} 56 | for (let i = 0; i < symbolsWeNeed.length; i++) { 57 | const cljsName = symbolsWeNeed[i].replace('clojure.core', 'cljs.core') 58 | const clojureName = symbolsWeNeed[i].replace('cljs.core', 'clojure.core') 59 | 60 | let fullName = null 61 | if (allDocsObj[cljsName]) fullName = cljsName 62 | if (allDocsObj[clojureName]) fullName = clojureName 63 | 64 | // sanity check: make sure we have the docfile for everything in symbols.json 65 | if (!fullName) { 66 | grunt.fail.warn('Missing docfile for ' + symbolsWeNeed[i]) 67 | } 68 | 69 | docsWeNeed[fullName] = allDocsObj[fullName] 70 | } 71 | 72 | grunt.file.write('public/docs.HASHME.json', JSON.stringify(docsWeNeed)) 73 | grunt.log.writeln(symbolsWeNeed.length + ' doc symbols written to public/docs.HASHME.json') 74 | } 75 | 76 | // --------------------------------------------------------------------------- 77 | // Cheatsheet Publish 78 | // --------------------------------------------------------------------------- 79 | 80 | function preBuildSanityCheck () { 81 | if (!grunt.file.exists('public/index.html')) { 82 | grunt.fail.warn('Could not find public/index.html. Please run "node app.js" to generate it. Aborting build...') 83 | } 84 | 85 | if (!grunt.file.exists('public/js/cheatsheet.min.js')) { 86 | grunt.fail.warn('Could not find public/js/cheatsheet.min.js. Please run "lein cljsbuild once cheatsheet-prod" to generate it. Aborting build...') 87 | } 88 | 89 | // TODO: check to make sure the ctime on cheatsheet.min.js is pretty fresh 90 | // (< 5 minutes) 91 | 92 | grunt.log.writeln('Everything looks ok for a build.') 93 | } 94 | 95 | function nowStr () { 96 | const opts = { 97 | day: '2-digit', 98 | hour12: false, 99 | month: '2-digit', 100 | year: 'numeric' 101 | } 102 | const now = new Date() 103 | const timeStr = now.toLocaleTimeString('en-US', opts) 104 | const year = timeStr.substring(6, 10) 105 | const month = timeStr.substring(0, 2) 106 | const day = timeStr.substring(3, 5) 107 | const hours = timeStr.substring(12, 14) 108 | const minutes = timeStr.substring(15, 17) 109 | const seconds = timeStr.substring(18, 20) 110 | 111 | return year + '-' + month + '-' + day + '-' + hours + minutes + seconds 112 | } 113 | 114 | function createReleaseId () { 115 | const gitFullHash = shell.exec('git rev-parse HEAD', { silent: true }).stdout.trim() 116 | const gitShortHash = gitFullHash.substr(0, 10) 117 | return nowStr() + '-' + gitShortHash 118 | } 119 | 120 | // FIXME: re-write this to be more generic please :) 121 | function hashAssets () { 122 | const unhashedDocsFilename = '00_build/docs.HASHME.json' 123 | const docsFileContents = grunt.file.read(unhashedDocsFilename) 124 | const docsHash = md5(docsFileContents).substr(0, hashLength) 125 | 126 | // update cheatsheet.min.js with docs hash 127 | const buildJsFilename = '00_build/js/cheatsheet.min.js' 128 | const jsFileContents1 = grunt.file.read(buildJsFilename) 129 | const jsFileContents2 = jsFileContents1.replace('docs.HASHME.json', 'docs.' + docsHash + '.json') 130 | grunt.file.write(buildJsFilename, jsFileContents2) 131 | 132 | // hash css file 133 | const cssFileContents = grunt.file.read('00_build/css/main.min.css') 134 | const cssHash = md5(cssFileContents).substr(0, hashLength) 135 | 136 | // hash JS file 137 | const jsHash = md5(jsFileContents2).substr(0, hashLength) 138 | 139 | const htmlFile = grunt.file.read('00_build/index.html') 140 | 141 | // write the new files 142 | grunt.file.write('00_build/css/main.min.' + cssHash + '.css', cssFileContents) 143 | grunt.file.write('00_build/docs.' + docsHash + '.json', docsFileContents) 144 | grunt.file.write('00_build/js/cheatsheet.min.' + jsHash + '.js', jsFileContents2) 145 | 146 | // delete the old files 147 | grunt.file.delete('00_build/css/main.min.css') 148 | grunt.file.delete('00_build/docs.HASHME.json') 149 | grunt.file.delete('00_build/js/cheatsheet.min.js') 150 | 151 | // update the HTML file 152 | grunt.file.write('00_build/index.html', 153 | htmlFile.replace('main.min.css', 'main.min.' + cssHash + '.css') 154 | .replace('cheatsheet.min.js', 'cheatsheet.min.' + jsHash + '.js')) 155 | 156 | // show some output 157 | grunt.log.writeln('00_build/css/main.min.css → ' + 158 | '00_build/css/main.min.' + cssHash + '.css') 159 | grunt.log.writeln('00_build/docs.HASHME.json → ' + 160 | '00_build/docs.' + docsHash + '.json') 161 | grunt.log.writeln('00_build/js/cheatsheet.min.js → ' + 162 | '00_build/js/cheatsheet.min.' + jsHash + '.js') 163 | } 164 | 165 | function addReleaseId () { 166 | const htmlFile = grunt.file.read('00_build/index.html') 167 | const releaseId = createReleaseId() 168 | const updatedFile = htmlFile.replace('', '') 169 | 170 | grunt.file.write('00_build/index.html', updatedFile) 171 | grunt.log.writeln('Tagged 00_build/index.html with releaseId: ' + releaseId) 172 | } 173 | 174 | // --------------------------------------------------------------------------- 175 | // Grunt Config 176 | // --------------------------------------------------------------------------- 177 | 178 | grunt.initConfig({ 179 | 180 | clean: { 181 | options: { 182 | force: true 183 | }, 184 | 185 | // remove all the files in the 00_build folder 186 | pre: ['00_build'], 187 | 188 | // remove the uncompressed CLJS client file 189 | post: ['00_build/js/cheatsheet.js'] 190 | }, 191 | 192 | copy: { 193 | cheatsheet: { 194 | files: [ 195 | { expand: true, cwd: 'public/', src: ['**'], dest: '00_build/' } 196 | ] 197 | } 198 | }, 199 | 200 | less: { 201 | options: { 202 | compress: true 203 | }, 204 | 205 | watch: { 206 | files: { 207 | 'public/css/main.min.css': 'less/000-main.less' 208 | } 209 | } 210 | }, 211 | 212 | watch: { 213 | options: { 214 | atBegin: true 215 | }, 216 | 217 | less: { 218 | files: 'less/*.less', 219 | tasks: 'less:watch' 220 | }, 221 | 222 | docs: { 223 | files: 'docfiles/*.cljsdoc', 224 | tasks: 'docs' 225 | } 226 | } 227 | 228 | }) 229 | 230 | // load tasks from npm 231 | grunt.loadNpmTasks('grunt-contrib-clean') 232 | grunt.loadNpmTasks('grunt-contrib-copy') 233 | grunt.loadNpmTasks('grunt-contrib-less') 234 | grunt.loadNpmTasks('grunt-contrib-watch') 235 | 236 | // custom tasks 237 | grunt.registerTask('docs', buildDocs) 238 | grunt.registerTask('pre-build-sanity-check', preBuildSanityCheck) 239 | grunt.registerTask('hash-assets', hashAssets) 240 | grunt.registerTask('add-release-id', addReleaseId) 241 | 242 | grunt.registerTask('build', [ 243 | 'pre-build-sanity-check', 244 | 'clean:pre', 245 | 'copy:cheatsheet', 246 | 'clean:post', 247 | 'hash-assets', 248 | 'add-release-id' 249 | ]) 250 | 251 | grunt.registerTask('default', 'watch') 252 | 253 | // end module.exports 254 | } 255 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Chris Oakman and contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # A ClojureScript Cheatsheet 2 | 3 | This project produces the cheatsheet at [cljs.info/cheatsheet] 4 | 5 | ## Design 6 | 7 | You can read about some of the design decisions that went into the cheatsheet 8 | [here](design.md). 9 | 10 | ## Development Setup 11 | 12 | ### First time setup 13 | 14 | Install [Leiningen], [Node.js], and [Yarn] or use [nix-shell] from the project root. 15 | 16 | ```sh 17 | # install node_modules 18 | yarn install 19 | ``` 20 | 21 | ### Development workflow 22 | 23 | You may wish to run these commands in separate console tabs / screens. 24 | 25 | ```sh 26 | # does two things: 27 | # - compiles LESS into CSS whenever a less/*.less file changes 28 | # - builds public/docs.json whenever a docfiles/*.cljsdoc file changes 29 | npx grunt watch 30 | 31 | # run a local web server on port 9224 32 | # the port is configurable and defaults to 8888 if not provided 33 | node server.js 9224 34 | 35 | # compile ClojureScript files 36 | lein clean && lein cljsbuild auto 37 | 38 | # build public/index.html 39 | # NOTE: app.js is generated from "lein cljsbuild auto" above 40 | node app.js 41 | 42 | # create a build into the 00_build directory 43 | yarn run build-release 44 | ``` 45 | 46 | ## License 47 | 48 | [MIT License] 49 | 50 | [cljs.info/cheatsheet]:https://cljs.info/cheatsheet 51 | [Leiningen]:https://leiningen.org 52 | [Node.js]:https://nodejs.org 53 | [Yarn]:https://yarnpkg.com/ 54 | [nix-shell]:https://nixos.wiki/wiki/Development_environment_with_nix-shell 55 | [MIT License]:https://github.com/oakmac/cljs-cheatsheet/blob/master/LICENSE.md 56 | -------------------------------------------------------------------------------- /cljs-client/cljs_cheatsheet_client/core.cljs: -------------------------------------------------------------------------------- 1 | (ns cljs-cheatsheet-client.core 2 | (:require 3 | [cljs-cheatsheet-client.dom :refer [by-id get-element-box]] 4 | [cljs-cheatsheet-client.state :refer [active-tooltip mousetrap-boxes]] 5 | [cljs-cheatsheet-client.tooltips :as tooltips] 6 | [cljs-cheatsheet-client.util :refer [point-inside-box?]] 7 | [cljs-cheatsheet.util :refer [js-log log]] 8 | [cljsjs.jquery] 9 | [clojure.string :as str] 10 | [goog.functions :refer [once]] 11 | [oops.core :refer [ocall oget oset!]])) 12 | 13 | (def $ js/jQuery) 14 | 15 | (def matched-search-class "matched-e5c67") 16 | (def related-highlight-class "related-35f44") 17 | (def related-highlight-sel (str "." related-highlight-class)) 18 | (def related-link-sel ".related-link-674b6") 19 | (def matched-search-sel (str "." matched-search-class)) 20 | (def no-results-class "no-results-5d3ea") 21 | (def fn-link-sel ".fn-a8476, .inside-fn-c7607") 22 | (def group-sel "section.major-category") 23 | (def section-sel ".section-31efe") 24 | (def search-input-id "searchInput") 25 | (def search-input-sel (str "#" search-input-id)) 26 | 27 | ;;------------------------------------------------------------------------------ 28 | ;; Highlight Related Links 29 | ;;------------------------------------------------------------------------------ 30 | 31 | (def opacity-fade-speed 100) 32 | (def tooltip-opacity 0.5) 33 | 34 | (defn- related-links-underneath-tooltip? [] 35 | (let [tooltip-box (:tooltip @mousetrap-boxes) 36 | any-underneath-tooltip? (atom false) 37 | $related-links ($ related-highlight-sel)] 38 | (.each $related-links (fn [idx el] 39 | (let [el-box (get-element-box el) 40 | x1 (:x1 el-box) 41 | x2 (:x2 el-box) 42 | y1 (:y1 el-box) 43 | y2 (:y2 el-box) 44 | tl? (point-inside-box? {:x x1 :y y1} tooltip-box) 45 | tr? (point-inside-box? {:x x2 :y y1} tooltip-box) 46 | bl? (point-inside-box? {:x x1 :y y2} tooltip-box) 47 | br? (point-inside-box? {:x x2 :y y2} tooltip-box)] 48 | (when (or tl? tr? bl? br?) 49 | (reset! any-underneath-tooltip? true))))) 50 | (deref any-underneath-tooltip?))) 51 | 52 | 53 | (defn- mouseenter-related-link [js-evt] 54 | (let [link-el (oget js-evt "currentTarget") 55 | $link-el ($ link-el) 56 | full-name (.attr $link-el "data-full-name") 57 | sel1 (str ".fn-a8476[data-full-name='" full-name "']") 58 | sel2 (str ".inside-fn-c7607[data-full-name='" full-name "']") 59 | sel3 (str sel1 ", " sel2) 60 | $related-links ($ sel3) 61 | tt-id (:id @active-tooltip) 62 | $tooltip-el ($ (str "#" tt-id))] 63 | ;; highlight the related links 64 | (.addClass $related-links related-highlight-class) 65 | 66 | ;; add some opacity to the tooltip when related links are underneath it 67 | (when (related-links-underneath-tooltip?) 68 | (.fadeTo $tooltip-el opacity-fade-speed tooltip-opacity)))) 69 | 70 | 71 | (defn- mouseleave-related-link [js-evt] 72 | (let [link-el (oget js-evt "currentTarget") 73 | $link-el ($ link-el) 74 | full-name (.attr $link-el "data-full-name") 75 | tt-id (:id @active-tooltip) 76 | $tooltip-el ($ (str "#" tt-id))] 77 | (.fadeTo $tooltip-el opacity-fade-speed 1) 78 | (.removeClass ($ fn-link-sel) related-highlight-class))) 79 | 80 | 81 | ;;------------------------------------------------------------------------------ 82 | ;; Search 83 | ;;------------------------------------------------------------------------------ 84 | 85 | (def search-text (atom "")) 86 | 87 | 88 | (defn- show-all-groups-and-sections! [] 89 | (.show ($ group-sel)) 90 | (.show ($ section-sel))) 91 | 92 | 93 | (defn- toggle-el! 94 | "Show or hide an element based on whether it contains a search match." 95 | [_idx el] 96 | (let [$el ($ el) 97 | $matched (.find $el matched-search-sel) 98 | matches-in-el? (pos? (oget $matched "length"))] 99 | (if matches-in-el? 100 | (.show $el) 101 | (.hide $el)))) 102 | 103 | 104 | (defn- toggle-groups-and-sections! 105 | "Show or hide groups and sections based on whether they contain a search match." 106 | [] 107 | (.each ($ section-sel) toggle-el!) 108 | (.each ($ group-sel) toggle-el!)) 109 | 110 | 111 | (defn- any-matches? 112 | "Did anything match our search text?" 113 | [] 114 | (-> ($ matched-search-sel) 115 | (oget "length") 116 | pos?)) 117 | 118 | 119 | (defn- toggle-fn-link [el search-txt] 120 | (let [$link ($ el) 121 | link-txt (-> $link .text str/lower-case) 122 | match? (not= -1 (.indexOf link-txt search-txt))] 123 | (if match? 124 | (.addClass $link matched-search-class) 125 | (.removeClass $link matched-search-class)))) 126 | 127 | 128 | (defn- toggle-fn-matches! [search-txt] 129 | (let [$links ($ fn-link-sel)] 130 | (.each $links #(toggle-fn-link %2 search-txt)))) 131 | 132 | 133 | (defn- clear-search! [] 134 | (.removeClass ($ search-input-sel) no-results-class) 135 | (.removeClass ($ fn-link-sel) matched-search-class) 136 | (show-all-groups-and-sections!)) 137 | 138 | 139 | (defn- show-no-matches! [] 140 | (.addClass ($ search-input-sel) no-results-class) 141 | (.removeClass ($ fn-link-sel) matched-search-class) 142 | (show-all-groups-and-sections!)) 143 | 144 | 145 | (defn- search! [txt] 146 | (toggle-fn-matches! txt) 147 | (if (any-matches?) 148 | (do 149 | (.removeClass ($ search-input-sel) no-results-class) 150 | (toggle-groups-and-sections!)) 151 | (show-no-matches!))) 152 | 153 | 154 | (defn- change-search-text [_kwd _the-atom _old-txt new-txt] 155 | (if (str/blank? new-txt) 156 | (clear-search!) 157 | (search! new-txt))) 158 | 159 | 160 | (add-watch search-text :main change-search-text) 161 | 162 | 163 | ;;------------------------------------------------------------------------------ 164 | ;; Events 165 | ;;------------------------------------------------------------------------------ 166 | 167 | (defn- change-search-input2 [] 168 | (let [txt (-> ($ search-input-sel) .val str/lower-case)] 169 | (when (not= txt @search-text) 170 | (reset! search-text txt)))) 171 | 172 | 173 | ;; reset the stack so we can grab the value out of the text field 174 | (defn- change-search-input [] 175 | (js/setTimeout change-search-input2 1)) 176 | 177 | 178 | (defn- add-events! [] 179 | (.on ($ "body") "mouseenter" related-link-sel mouseenter-related-link) 180 | (.on ($ "body") "mouseleave" related-link-sel mouseleave-related-link) 181 | (.on ($ search-input-sel) "blur change keydown" change-search-input)) 182 | 183 | 184 | ;;------------------------------------------------------------------------------ 185 | ;; Global Cheatsheet Init 186 | ;;------------------------------------------------------------------------------ 187 | 188 | (def init! 189 | "Global initialization for the cheatsheet page. 190 | NOTE: this function may only be called one time" 191 | (once 192 | (fn [] 193 | ;; initialize tooltip events 194 | (tooltips/init!) 195 | 196 | ;; add search and other events 197 | (add-events!) 198 | 199 | ;; trigger search 200 | (change-search-input2) 201 | 202 | ;; put the focus on the search field 203 | (when-let [search-input-el (by-id search-input-id)] 204 | (ocall search-input-el "focus"))))) 205 | 206 | (init!) 207 | -------------------------------------------------------------------------------- /cljs-client/cljs_cheatsheet_client/dom.cljs: -------------------------------------------------------------------------------- 1 | (ns cljs-cheatsheet-client.dom 2 | "Some DOM helper functions." 3 | (:require 4 | goog.dom 5 | [oops.core :refer [ocall oget oset!]])) 6 | 7 | (def $ js/jQuery) 8 | 9 | (defn by-id [id] 10 | (ocall js/document "getElementById" id)) 11 | 12 | (defn element? [el] 13 | (goog.dom/isElement el)) 14 | 15 | (defn get-value [id] 16 | (oget (by-id id) "value")) 17 | 18 | (defn set-html! [id html] 19 | (oset! (by-id id) "innerHTML" html)) 20 | 21 | (defn show-el! [id] 22 | (oset! (by-id id) "style.display" "")) 23 | 24 | (defn hide-el! [id] 25 | (oset! (by-id id) "style.display" "none")) 26 | 27 | (defn toggle-display! [id] 28 | (let [el (by-id id) 29 | display (oget el "style.display")] 30 | (if (= display "none") 31 | (show-el! id) 32 | (hide-el! id)))) 33 | 34 | ;; NOTE: Surely there must be a jQuery or Google Closure function that does 35 | ;; this already? 36 | (defn get-element-box [el] 37 | (let [$el ($ el) 38 | o (.offset $el) 39 | x (js/parseFloat (oget o "left")) 40 | y (js/parseFloat (oget o "top")) 41 | height (js/parseFloat (ocall $el "outerHeight")) 42 | width (js/parseFloat (ocall $el "outerWidth"))] 43 | {:x1 x 44 | :x2 (+ x width) 45 | :y1 y 46 | :y2 (+ y height)})) 47 | -------------------------------------------------------------------------------- /cljs-client/cljs_cheatsheet_client/html.cljs: -------------------------------------------------------------------------------- 1 | (ns cljs-cheatsheet-client.html 2 | (:require-macros 3 | [hiccups.core :as hiccups]) 4 | (:require 5 | hiccups.runtime 6 | [clojure.string :as str] 7 | [cljs-cheatsheet.util :refer [docs-href js-log log]] 8 | [cljs-cheatsheet-client.util :refer [extract-namespace extract-symbol split-full-name]])) 9 | 10 | (def html-encode js/goog.string.htmlEscape) 11 | (def cljs-core-ns "cljs.core") 12 | 13 | ;;------------------------------------------------------------------------------ 14 | ;; Inline Tooltip 15 | ;;------------------------------------------------------------------------------ 16 | 17 | (defn- code-signature-class [idx] 18 | (str "code-b64c8 " 19 | (if (even? idx) "dark-even-7aff7" "dark-odd-6cd97"))) 20 | 21 | (defn CodeSignature [idx sig nme] 22 | (let [len (count sig) 23 | sig2 (subs sig 1 (dec len))] 24 | [:code {:class (code-signature-class idx)} 25 | "(" nme 26 | (when-not (str/blank? sig2) 27 | (str " " sig2)) 28 | ")"])) 29 | 30 | (defn RelatedFnLink [s] 31 | [:a.related-link-674b6 32 | {:data-full-name (:full-name s) 33 | :href (docs-href (:symbol s) (:namespace s))} 34 | (:symbol s)]) 35 | 36 | (defn RelatedLinksForNs [ns1 all-related] 37 | (let [filtered-related (filter #(= (:namespace %) ns1) all-related)] 38 | (list 39 | (when-not (= ns1 cljs-core-ns) 40 | [:span.tt-literal-3cdfc "(" ns1 "/)"]) 41 | (map RelatedFnLink filtered-related)))) 42 | 43 | (defn RelatedLinks [r] 44 | (let [r2 (map split-full-name r) 45 | namespaces (distinct (map :namespace r2))] 46 | (list 47 | [:h5.related-hdr-915e5 "Related"] 48 | [:div.related-links-f8e49 49 | (map #(RelatedLinksForNs % r2) namespaces)]))) 50 | 51 | (hiccups/defhtml InlineTooltip [tt] 52 | (let [desc-html (:description-html tt) 53 | id (:id tt) 54 | full-name (:full-name tt) 55 | symbol-name (extract-symbol full-name) 56 | ns1 (extract-namespace full-name) 57 | related (:related tt) 58 | signature (:signature tt) 59 | type (if (:type tt) (:type tt))] 60 | [:div.inline-tooltip-8ca2a 61 | {:id id 62 | :style "display:none"} 63 | [:h4.tooltip-hdr-db7c5 64 | (when-not (= cljs-core-ns ns1) 65 | [:span.namespace-2e700 ns1 "/"]) 66 | symbol-name 67 | (when type [:span.type-7920d type])] 68 | [:div.signature-4086a 69 | (map-indexed #(CodeSignature %1 %2 symbol-name) signature)] 70 | [:div 71 | {:dangerously-set-inner-HTML 72 | {:__html (str "
" desc-html "
")}}] 73 | (when (and related (first related) (not (str/blank? (first related)))) 74 | (RelatedLinks related))])) 75 | -------------------------------------------------------------------------------- /cljs-client/cljs_cheatsheet_client/state.cljs: -------------------------------------------------------------------------------- 1 | (ns cljs-cheatsheet-client.state 2 | "Atoms that are referenced in multiple modules.") 3 | 4 | (def active-tooltip (atom nil)) 5 | (def mouse-position (atom nil)) 6 | (def mousetrap-boxes (atom nil)) 7 | -------------------------------------------------------------------------------- /cljs-client/cljs_cheatsheet_client/util.cljs: -------------------------------------------------------------------------------- 1 | (ns cljs-cheatsheet-client.util 2 | (:require 3 | [clojure.walk :refer [keywordize-keys]] 4 | [cognitect.transit :as transit] 5 | [oops.core :refer [ocall oget oset!]])) 6 | 7 | ;;------------------------------------------------------------------------------ 8 | ;; Util Functions 9 | ;;------------------------------------------------------------------------------ 10 | 11 | (defn half [n] 12 | (/ n 2)) 13 | 14 | 15 | (defn extract-namespace [full-name] 16 | (let [first-slash-pos (.indexOf full-name "/")] 17 | (subs full-name 0 first-slash-pos))) 18 | 19 | 20 | (defn extract-symbol [full-name] 21 | (let [first-slash-pos (.indexOf full-name "/")] 22 | (subs full-name (inc first-slash-pos)))) 23 | 24 | 25 | (defn split-full-name [r] 26 | (let [ns1 (extract-namespace r) 27 | symbol-name (extract-symbol r)] 28 | {:full-name r 29 | :namespace ns1 30 | :symbol symbol-name})) 31 | 32 | 33 | (defn point-inside-box? [point box] 34 | (let [px (:x point) 35 | py (:y point)] 36 | (and (>= px (:x1 box)) 37 | (<= px (:x2 box)) 38 | (>= py (:y1 box)) 39 | (<= py (:y2 box))))) 40 | 41 | 42 | ;;------------------------------------------------------------------------------ 43 | ;; AJAX 44 | ;;------------------------------------------------------------------------------ 45 | 46 | (def transit-json-rdr (transit/reader :json)) 47 | 48 | (defn- http-success? [status] 49 | (and (>= status 200) 50 | (< status 400))) 51 | 52 | 53 | (defn- fetch-clj-success [js-evt success-fn error-fn] 54 | (let [status (oget js-evt "target" "status")] 55 | (if-not (http-success? status) 56 | (error-fn) 57 | (let [response-text (oget js-evt "target" "responseText")] 58 | (if-let [clj-result (try (transit/read transit-json-rdr response-text) 59 | (catch js/Error _error nil))] 60 | (success-fn (keywordize-keys clj-result)) 61 | (error-fn)))))) 62 | 63 | 64 | (defn fetch-clj 65 | "Makes an AJAX request to an HTTP GET endpoint expecting JSON. 66 | Parses JSON into CLJ using transit.cljs and keywordizes map keys. 67 | transit.cljs is faster than using js->clj: http://tinyurl.com/ntgxyt8" 68 | ([url success-fn] 69 | (fetch-clj url success-fn (fn [] nil))) 70 | ([url success-fn error-fn] 71 | (doto (js/XMLHttpRequest.) 72 | (.addEventListener "load" #(fetch-clj-success % success-fn error-fn)) 73 | (.addEventListener "error" error-fn) 74 | (.addEventListener "abort" error-fn) 75 | (.open "get" url) 76 | (.send)))) 77 | -------------------------------------------------------------------------------- /cljs-shared/cljs_cheatsheet/util.cljs: -------------------------------------------------------------------------------- 1 | (ns cljs-cheatsheet.util "Utility functions shared on both the client and server." 2 | (:require 3 | [clojure.string :refer [replace]])) 4 | 5 | ;;------------------------------------------------------------------------------ 6 | ;; Logging 7 | ;;------------------------------------------------------------------------------ 8 | 9 | (defn js-log 10 | "Log a JavaScript thing." 11 | [js-thing] 12 | (js/console.log js-thing)) 13 | 14 | (defn log 15 | "Log a Clojure thing." 16 | [clj-thing] 17 | (js-log (pr-str clj-thing))) 18 | 19 | ;;------------------------------------------------------------------------------ 20 | ;; URL Encoding for Clojuredocs.org 21 | ;;------------------------------------------------------------------------------ 22 | 23 | (def uri-encode js/encodeURIComponent) 24 | 25 | (def encode-clojuredocs 26 | {"/" "_fs" 27 | "?" "_q"}) 28 | 29 | (def encode-cljs 30 | {"/" "SLASH" 31 | "?" "QMARK" 32 | "!" "BANG" 33 | ">" "GT" 34 | "<" "LT" 35 | "=" "EQ"}) 36 | 37 | (defn encoder-gen [mapping] 38 | (fn [s] 39 | (reduce-kv 40 | replace 41 | s 42 | mapping))) 43 | 44 | (def encode-symbol-url-clojuredocs 45 | (encoder-gen encode-clojuredocs)) 46 | 47 | (def encode-symbol-url-cljs 48 | (encoder-gen encode-cljs)) 49 | 50 | (defn docs-href [name name-space] 51 | (let [cljsns? (= name-space "cljs.core") 52 | domain (if cljsns? 53 | "http://cljs.github.io/api/" 54 | "http://clojuredocs.org/") 55 | encode-fn (if cljsns? 56 | encode-symbol-url-cljs 57 | encode-symbol-url-clojuredocs)] 58 | (str domain 59 | (uri-encode name-space) 60 | "/" 61 | (uri-encode (encode-fn name))))) 62 | -------------------------------------------------------------------------------- /default.nix: -------------------------------------------------------------------------------- 1 | { nixpkgs ? import { } }: 2 | 3 | let 4 | pkgs = [ 5 | /* Core runtime libraries */ 6 | nixpkgs.nodejs 7 | nixpkgs.yarn 8 | nixpkgs.clojure 9 | nixpkgs.jdk11 10 | nixpkgs.leiningen 11 | 12 | /* Dev Tools */ 13 | nixpkgs.ack 14 | nixpkgs.git 15 | nixpkgs.gnupg 16 | nixpkgs.which 17 | ]; 18 | 19 | in 20 | nixpkgs.stdenv.mkDerivation { 21 | name = "env"; 22 | buildInputs = pkgs; 23 | } 24 | -------------------------------------------------------------------------------- /design.md: -------------------------------------------------------------------------------- 1 | # ClojureScript Cheatsheet Design 2 | 3 | Below are some design notes for the [ClojureScript cheatsheet]. 4 | 5 | ## Type 6 | 7 | Open Sans (weights 300, 400, 600) was chosen for its clean appearance and 8 | excellent legibility. Droid Sans Mono was chosen as a compliment pair for 9 | monospaced code. Both typefaces have a neutral appearance and keep the focus on 10 | the content, not the type. 11 | 12 | Type differentiation is used to distinguish between groups headers, section 13 | headers, row labels, and table symbols. Each has a distinct appearance and can 14 | be recognized at a glance. 15 | 16 | ## Info Tooltips 17 | 18 | Info tooltips (marked with the circle "i" icon) provide context and additional 19 | information helpful to developers coming from other languages. Comparisons to 20 | JavaScript are mentioned as relevant. Tooltips are unobtrusive unless hovered 21 | over. Grey is used to make them visually "wash over" when not needed. 22 | 23 | Tooltips have a small mouse pointer launch target, but once opened the range 24 | expands to allow for the mouse to enter the tooltip body and "explore" the 25 | content. This also allows the user to copy/paste content from a tooltip. 26 | 27 | ## Tables 28 | 29 | Tables contain no additional marks other than labels and content. Color is used 30 | to separate table rows. 31 | 32 | ## Colors 33 | 34 | High contrast colors are used to ensure legibility on a wide range of devices 35 | and screens. 36 | 37 | ## Literal Forms 38 | 39 | Where appropriate, section headers contain the literal representation or 40 | shorthand version of their form. Users already familiar with the literal forms 41 | will instantly recognize their connection to the section. Users unfamiliar with 42 | the literal forms may be confused at first, but should eventually have an 43 | "aha!" moment when they make the connection. This is my favorite feature of the 44 | cheatsheet :) 45 | 46 | ## Search 47 | 48 | Search highlights matching symbols in yellow and leaves the containing section 49 | visible for context. Sections with no match are hidden and the content "folds" 50 | smartly around the matched sections. Red is used in the search bar to indicate 51 | no match. 52 | 53 | ## Inline Tooltips 54 | 55 | Inline tooltips provide rich information about each function, macro, or special 56 | form. Like the info tooltips, inline tooltips allow for the mouse to enter the 57 | body to "explore" the content and copy/paste. 58 | 59 | Mousing over a related symbol in a tooltip highlights it on the page, visually 60 | connecting related sections. When a related symbol is underneath the tooltip 61 | body (as often happens due to the organization of the symbols), opacity is used 62 | to show the location of the related symbol. 63 | 64 | ## Content Organization 65 | 66 | Sections are defined and ordered by common usage first, implementation 67 | organization second. Links are repeated in multiple sections where appropriate. 68 | 69 | ## Footer 70 | 71 | The footer contains no color and provides relevant links to related material. 72 | 73 | ## Documentation 74 | 75 | Documentation is contained in simple [kidif files] that allow for management 76 | and collaboration using existing tools (git, text editors, etc). 77 | 78 | Docstrings were extracted from the code and converted to Markdown format to 79 | allow for more structure than simple text can provide (ie: code highlighting, 80 | links, tables, etc). The descriptions were edited to have consistent voice and 81 | structure. 82 | 83 | ## Responsive Layout 84 | 85 | The content folds into three layouts depending on browser width. The sections 86 | are organized in each layout to fill the space as best they can. 87 | 88 | [ClojureScript cheatsheet]:http://cljs.info/cheatsheet 89 | [kidif files]:https://github.com/oakmac/kidif.js 90 | -------------------------------------------------------------------------------- /docfiles/cljs.core_-.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/- 3 | 4 | ===== Signature 5 | [x] 6 | [x y] 7 | [x y & more] 8 | 9 | ===== Description 10 | 11 | If no `y`s are supplied, returns the negation of `x`, else subtracts the `y`s 12 | from `x` and returns the result. 13 | 14 | ===== Related 15 | cljs.core/+ 16 | 17 | ===== Example#0a974e 18 | 19 | ``` 20 | (- 1) 21 | ;;=> -1 22 | 23 | (- 6 3) 24 | ;;=> 3 25 | 26 | (- 10 3 2) 27 | ;;=> 5 28 | ``` 29 | -------------------------------------------------------------------------------- /docfiles/cljs.core_-GT.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/-> 3 | 4 | ===== Type 5 | macro 6 | 7 | ===== Signature 8 | [x & forms] 9 | 10 | ===== Description 11 | 12 | The thread-first macro "threads" an expression through several forms as the 13 | second item in a list. 14 | 15 | Inserts `x` as the second item in the first form, making a list of it if it is 16 | not a list already. If there are more forms, inserts the first form as the 17 | second item in second form, etc. 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 31 |
CodeExpands To
 27 | (-> x
 28 |   (a b c)
 29 |   d
 30 |   (x y z))
 32 | (x (d (a x b c)) y z)
33 | 34 | ===== Related 35 | cljs.core/->> 36 | 37 | ===== TODO 38 | add threading macro animations link here 39 | 40 | ===== Example#19b460 41 | 42 | The first is arguably a bit more cumbersome to read than the second: 43 | 44 | ``` 45 | (first (.split (.replace (.toUpperCase "a b c d") "A" "X") " ")) 46 | ;;=> "X" 47 | 48 | (-> "a b c d" 49 | .toUpperCase 50 | (.replace "A" "X") 51 | (.split " ") 52 | first) 53 | ;;=> "X" 54 | ``` 55 | ===== Example#78ad8f 56 | 57 | It can also be useful for pulling values out of deeply-nested 58 | data structures: 59 | 60 | ``` 61 | (def person 62 | {:name "Mark Volkmann" 63 | :address {:street "644 Glen Summit" 64 | :city "St. Charles" 65 | :state "Missouri" 66 | :zip 63304} 67 | :employer {:name "Object Computing, Inc." 68 | :address {:street "12140 Woodcrest Dr." 69 | :city "Creve Coeur" 70 | :state "Missouri" 71 | :zip 63141}}}) 72 | 73 | (-> person :employer :address :city) 74 | ;;=> "Creve Coeur" 75 | ``` 76 | 77 | Same as above, but with more nesting: 78 | 79 | ``` 80 | (:city (:address (:employer person))) 81 | ;;=> "Creve Coeur" 82 | ``` 83 | 84 | ===== Example#5fe621 85 | 86 | It can also help with arithmetic: 87 | 88 | ``` 89 | (def c 5) 90 | (-> c (+ 3) (/ 2) (- 1)) 91 | ;;=> 3 92 | ``` 93 | 94 | Same as above, but with more nesting: 95 | 96 | ``` 97 | (- (/ (+ c 3) 2) 1) 98 | ;;=> 3 99 | ``` 100 | 101 | -------------------------------------------------------------------------------- /docfiles/cljs.core_-GTGT.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/->> 3 | 4 | ===== Type 5 | macro 6 | 7 | ===== Signature 8 | [x & forms] 9 | 10 | ===== Description 11 | 12 | The thread-last macro "threads" an expression through several forms as the last 13 | item in a list. 14 | 15 | Inserts `x` as the last item in the first form, making a list of it if it is not 16 | a list already. If there are more forms, inserts the first form as the last item 17 | in second form, etc. 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 31 |
CodeExpands To
27 | (->> x
28 |   (a b c)
29 |   d
30 |   (x y z))
32 | (x y z (d (a b c x)))
33 | 34 | ===== Related 35 | cljs.core/-> 36 | 37 | ===== TODO 38 | add threading macro animations link here 39 | 40 | ===== Example#1dc72c 41 | 42 | Sequence transformation functions often take a sequence as the last argument, 43 | thus the thread-last macro is commonly used with them. Here we compute the sum 44 | of the first 10 even squares: 45 | 46 | `` 47 | (->> (range) 48 | (map #(* % %)) 49 | (filter even?) 50 | (take 10) 51 | (reduce +)) 52 | ;;=> 1140 53 | ``` 54 | 55 | This expands to: 56 | 57 | ``` 58 | (reduce + 59 | (take 10 60 | (filter even? 61 | (map #(* % %) 62 | (range))))) 63 | ;;=> 1140 64 | ``` 65 | 66 | -------------------------------------------------------------------------------- /docfiles/cljs.core_=.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/= 3 | 4 | ===== Signature 5 | [x] 6 | [x y] 7 | [x y & more] 8 | 9 | ===== Description 10 | 11 | Returns true if the value of `x` equals the value of `y`, false otherwise. 12 | 13 | `=` is a value comparison, not an identity comparison. 14 | 15 | All collections can be tested for value, regardless of "depth". 16 | 17 | ===== Related 18 | cljs.core/== 19 | cljs.core/not= 20 | cljs.core/identical? 21 | -------------------------------------------------------------------------------- /docfiles/cljs.core_==.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/== 3 | 4 | ===== Signature 5 | [x] 6 | [x y] 7 | [x y & more] 8 | 9 | ===== Description 10 | 11 | Returns true if all arguments have the same value, false otherwise. 12 | 13 | Behavior on non-number arguments is undefined. 14 | 15 | ===== Related 16 | cljs.core/= 17 | cljs.core/identical? 18 | -------------------------------------------------------------------------------- /docfiles/cljs.core_DOT.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/. 3 | 4 | ===== Type 5 | special form 6 | 7 | ===== Signature 8 | [o -p] 9 | [o m] 10 | [o m 1 2] 11 | [o (m 1 2)] 12 | 13 | ===== Description 14 | 15 | For interop, the `.` special form allows access to member properties of the 16 | given JavaScript object `o`. 17 | 18 | If the second operand is a symbol preceded with a hyphen as in `-p`, the 19 | expression will result in the value of the property named `p`. 20 | 21 | If the second operand is a symbol that is not preceded with a hyphen as in `m`, 22 | the expression will evaluate to a call of the method named `m`. Any additional 23 | operands will be passed as arguments to the method. 24 | 25 | The __preferred, idiomatic__ way to access members of a JavaScript object is to 26 | use the following sugar: 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 |
SugarExpands To
(.-p o)
(. o -p)
(.m o)
(. o m)
(.m o 1 2)
(. o m 1 2)
49 | 50 | ===== Related 51 | cljs.core/.. 52 | cljs.core/aget 53 | 54 | ===== Example#22ccbb 55 | 56 | We can access the JavaScript properties of a string: 57 | 58 | ```js 59 | // JavaScript 60 | var m = "Hello World"; 61 | m.length; 62 | //=> 11 63 | ``` 64 | 65 | ``` 66 | ;; ClojureScript 67 | (def m "Hello World") 68 | (.-length m) 69 | ;;=> 11 70 | ``` 71 | 72 | We can also call member functions on the string: 73 | 74 | ```js 75 | // JavaScript 76 | m.toUpperCase(); 77 | //=> "HELLO WORLD" 78 | 79 | m.replace("H", ""); 80 | //=> "ello World"; 81 | ``` 82 | 83 | ``` 84 | ;; ClojureScript 85 | (.toUpperCase m) 86 | ;;=> "HELLO WORLD" 87 | 88 | (.replace m "H" "") 89 | ;;=> "ello World" 90 | ``` 91 | 92 | ``` 93 | 94 | ===== Example#7c5e58 95 | 96 | Create a JavaScript object `o`: 97 | 98 | ``` 99 | (def o #js {:foo "bar"}) 100 | ``` 101 | 102 | You can get the value at property `"foo"` with any of the following: 103 | 104 | ``` 105 | (. o -foo) 106 | ;;=> "bar" 107 | 108 | (.-foo o) 109 | ;;=> "bar" 110 | 111 | (aget o "foo") 112 | ;;=> "bar" 113 | ``` 114 | 115 | -------------------------------------------------------------------------------- /docfiles/cljs.core_DOTDOT.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/.. 3 | 4 | ===== Type 5 | macro 6 | 7 | ===== Signature 8 | [o form] 9 | [o form & more] 10 | 11 | ===== Description 12 | 13 | For interop, the `..` macro allows method/property chaining on the given JavaScript object `o`. 14 | 15 | It essentially combines the thread-first `->` macro with the `.` operator. 16 | 17 | ===== Related 18 | cljs.core/. 19 | cljs.core/-> 20 | cljs.core/doto 21 | 22 | ===== Example#500658 23 | 24 | ```js 25 | // JavaScript 26 | "a b c d".toUpperCase().replace("A", "X") 27 | //=> "X B C D" 28 | ``` 29 | 30 | ``` 31 | ;; ClojureScript 32 | (.. "a b c d" 33 | toUpperCase 34 | (replace "A" "X")) 35 | ;;=> "X B C D" 36 | ``` 37 | 38 | This is expanded to: 39 | 40 | ``` 41 | (. (. "a b c d" toUpperCase) (replace "A" "X")) 42 | ``` 43 | 44 | 45 | which is equivalent to: 46 | 47 | ``` 48 | (.replace (.toUpperCase "a b c d") "A" "X") 49 | ;;=> "X B C D" 50 | ``` 51 | 52 | Compare to the equivalent form using the thread-first `->` macro: 53 | 54 | ``` 55 | (-> "a b c d" 56 | .toUpperCase 57 | (.replace "A" "X")) 58 | ;;=> "X B C D" 59 | ``` 60 | 61 | -------------------------------------------------------------------------------- /docfiles/cljs.core_EQ.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/= 3 | 4 | ===== Signature 5 | [x] 6 | [x y] 7 | [x y & more] 8 | 9 | ===== Description 10 | 11 | Returns true if the value of `x` equals the value of `y`, false otherwise. 12 | 13 | `=` is a value comparison, not an identity comparison. 14 | 15 | All collections can be tested for value, regardless of "depth". 16 | 17 | ===== Related 18 | cljs.core/== 19 | cljs.core/not= 20 | cljs.core/identical? 21 | 22 | ===== Example#edffb6 23 | 24 | ``` 25 | (= 1) 26 | ;;=> true 27 | 28 | (= 1 1) 29 | ;;=> true 30 | 31 | (= 1 2) 32 | ;;=> false 33 | 34 | (= 1 1 1) 35 | ;;=> true 36 | 37 | (= 1 1 2) 38 | ;;=> false 39 | ``` 40 | 41 | ===== Example#a2d064 42 | 43 | Sequences are considered equal in value if they have the same elements: 44 | 45 | ``` 46 | (= '(1 2) [1 2]) 47 | ;;=> true 48 | ``` 49 | 50 | But you cannot compare JavaScript arrays until you convert them to sequences: 51 | 52 | ``` 53 | (def a #js [1 2]) 54 | (def b #js [1 2]) 55 | (= a b) 56 | ;;=> false 57 | 58 | (= (seq a) (seq b)) 59 | ;;=> true 60 | ``` 61 | 62 | ===== Example#6c8424 63 | 64 | It is natural to compare deeply nested collections since value equality checks 65 | are cheap in ClojureScript: 66 | 67 | ``` 68 | (def a {:foo {:bar "baz"}}) 69 | (def b {:foo {:bar "baz"}}) 70 | (= a b) 71 | ;;=> true 72 | 73 | (= [a b] [a b]) 74 | ;=> true 75 | ``` 76 | 77 | JavaScript objects cannot be compared in this way until they are converted to 78 | ClojureScript collections: 79 | 80 | ``` 81 | (def a #js {:foo #js {:bar "baz"}}) 82 | (def b #js {:foo #js {:bar "baz"}}) 83 | (= a b) 84 | ;;=> false 85 | 86 | (= (js->clj a) 87 | (js->clj b)) 88 | ;;=> true 89 | ``` 90 | 91 | -------------------------------------------------------------------------------- /docfiles/cljs.core_EQEQ.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/== 3 | 4 | ===== Signature 5 | [x] 6 | [x y] 7 | [x y & more] 8 | 9 | ===== Description 10 | 11 | This is an equality check for numbers of different types that was carried over from Clojure, 12 | to allow compatibility when converting code to ClojureScript. 13 | 14 | Since there is only a single number type in JavaScript, 64-bit floating point, there is no 15 | reason to use the `==` operator in ClojureScript. 16 | 17 | Behavior on non-number arguments is undefined. 18 | 19 | ===== Related 20 | cljs.core/= 21 | cljs.core/identical? 22 | 23 | ===== Example#5ac342 24 | 25 | ``` 26 | (== 1 1) 27 | ;;=> true 28 | 29 | (== 1 2) 30 | ;;=> false 31 | ``` 32 | 33 | -------------------------------------------------------------------------------- /docfiles/cljs.core_GT.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/> 3 | 4 | ===== Signature 5 | [x] 6 | [x y] 7 | [x y & more] 8 | 9 | ===== Description 10 | 11 | Returns true if each successive number argument is less than the previous 12 | one, false otherwise. 13 | 14 | ===== Related 15 | cljs.core/>= 16 | 17 | ===== Example#67180c 18 | 19 | ``` 20 | (> 1 2) 21 | ;;=> false 22 | 23 | (> 2 1) 24 | ;;=> true 25 | 26 | (> 2 2) 27 | ;;=> false 28 | 29 | (> 6 5 4 3 2) 30 | ;;=> true 31 | ``` 32 | -------------------------------------------------------------------------------- /docfiles/cljs.core_GT=.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/>= 3 | 4 | ===== Signature 5 | [x] 6 | [x y] 7 | [x y & more] 8 | 9 | ===== Description 10 | 11 | Returns true if each successive number argument is less than or equal to the 12 | previous one, false otherwise. 13 | 14 | ===== Related 15 | cljs.core/> 16 | -------------------------------------------------------------------------------- /docfiles/cljs.core_GTEQ.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/>= 3 | 4 | ===== Signature 5 | [x] 6 | [x y] 7 | [x y & more] 8 | 9 | ===== Description 10 | 11 | Returns true if each successive number argument is less than or equal to the 12 | previous one, false otherwise. 13 | 14 | ===== Related 15 | cljs.core/> 16 | 17 | ===== Example#de73d7 18 | 19 | ``` 20 | (>= 2 1) 21 | ;;=> true 22 | 23 | (>= 2 2) 24 | ;;=> true 25 | 26 | (>= 1 2) 27 | ;;=> false 28 | 29 | (>= 6 5 4 3 2) 30 | ;;=> true 31 | ``` 32 | -------------------------------------------------------------------------------- /docfiles/cljs.core_LT.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/< 3 | 4 | ===== Signature 5 | [x] 6 | [x y] 7 | [x y & more] 8 | 9 | ===== Description 10 | 11 | Returns true if each successive number argument is greater than the previous 12 | one, false otherwise. 13 | 14 | ===== Related 15 | cljs.core/<= 16 | 17 | ===== Example#02e6d3 18 | 19 | ``` 20 | (< 1 2) 21 | ;;=> true 22 | 23 | (< 2 1) 24 | ;;=> false 25 | 26 | (< 1 1) 27 | ;;=> false 28 | 29 | (< 2 3 4 5 6) 30 | ;;=> true 31 | ``` 32 | -------------------------------------------------------------------------------- /docfiles/cljs.core_LT=.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/<= 3 | 4 | ===== Signature 5 | [x] 6 | [x y] 7 | [x y & more] 8 | 9 | ===== Description 10 | 11 | Returns true if each successive number argument is greater than or equal to the 12 | previous one, false otherwise. 13 | 14 | ===== Related 15 | cljs.core/< 16 | -------------------------------------------------------------------------------- /docfiles/cljs.core_LTEQ.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/<= 3 | 4 | ===== Signature 5 | [x] 6 | [x y] 7 | [x y & more] 8 | 9 | ===== Description 10 | 11 | Returns true if each successive number argument is greater than or equal to the 12 | previous one, false otherwise. 13 | 14 | ===== Related 15 | cljs.core/< 16 | 17 | ===== Example#adb3fd 18 | 19 | ``` 20 | (<= 1 2) 21 | ;;=> true 22 | 23 | (<= 2 2) 24 | ;;=> true 25 | 26 | (<= 3 2) 27 | ;;=> false 28 | 29 | (<= 2 3 4 5 6) 30 | ;;=> true 31 | ``` 32 | -------------------------------------------------------------------------------- /docfiles/cljs.core_PLUS.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/+ 3 | 4 | ===== Signature 5 | [] 6 | [x] 7 | [x y] 8 | [x y & more] 9 | 10 | ===== Description 11 | 12 | Returns the sum of nums. 13 | 14 | `(+)` returns 0. 15 | 16 | ===== Related 17 | cljs.core/* 18 | cljs.core/- 19 | 20 | ===== Example#650668 21 | 22 | ``` 23 | (+) 24 | ;;=> 0 25 | 26 | (+ 1) 27 | ;;=> 1 28 | 29 | (+ -10) 30 | ;;=> -10 31 | 32 | (+ 1 2) 33 | ;;=> 3 34 | 35 | (+ 1 2 3) 36 | ;;=> 6 37 | ``` 38 | -------------------------------------------------------------------------------- /docfiles/cljs.core_SLASH.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core// 3 | 4 | ===== Signature 5 | [x] 6 | [x y] 7 | [x y & more] 8 | 9 | ===== Description 10 | 11 | If no denominators are supplied, returns 1/numerator, else returns numerator 12 | divided by all of the denominators. 13 | 14 | ===== Related 15 | cljs.core/* 16 | cljs.core/quot 17 | 18 | ===== Example#5fe621 19 | 20 | ``` 21 | (/ 6 3) 22 | ;;=> 2 23 | 24 | (/ 6 3 2) 25 | ;;=> 1 26 | 27 | (/ 10) 28 | ;;=> 0.1 29 | 30 | (/ 1 3) 31 | ;;=> 0.3333333333333333 32 | ``` 33 | -------------------------------------------------------------------------------- /docfiles/cljs.core_STAR.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/* 3 | 4 | ===== Signature 5 | [] 6 | [x] 7 | [x y] 8 | [x y & more] 9 | 10 | ===== Description 11 | 12 | Returns the product of nums. 13 | 14 | `(*)` returns 1. 15 | 16 | ===== Related 17 | cljs.core/+ 18 | cljs.core// 19 | 20 | ===== Example#bc4a1f 21 | 22 | ``` 23 | ;; there is an implicit 1 24 | (*) 25 | ;;=> 1 26 | 27 | ;; the implicit 1 comes into play 28 | (* 6) 29 | ;;=> 6 30 | 31 | (* 2 3) 32 | ;;=> 6 33 | 34 | (* 2 3 4) 35 | ;;=> 24 36 | ``` 37 | -------------------------------------------------------------------------------- /docfiles/cljs.core_aclone.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/aclone 3 | 4 | ===== Signature 5 | [arr] 6 | 7 | ===== Description 8 | 9 | Creates a clone of the given JavaScript array `arr`. The result is a new 10 | JavaScript array, which is a shallow copy, not a deep copy. 11 | 12 | ===== Related 13 | cljs.core/array 14 | cljs.core/make-array 15 | 16 | ===== Example#422c4e 17 | 18 | ``` 19 | (def a #js [1 2 3]) 20 | (def b (aclone a)) 21 | (aset b 0 4) 22 | 23 | a 24 | ;;=> #js [1 2 3] 25 | 26 | b 27 | ;;=> #js [4 2 3] 28 | ``` 29 | -------------------------------------------------------------------------------- /docfiles/cljs.core_add-watch.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/add-watch 3 | 4 | ===== Signature 5 | [a key f] 6 | 7 | ===== Description 8 | 9 | Adds a watch function `f` to atom `a` that will execute when the value of `a` 10 | changes. 11 | 12 | The watch function takes 4 arguments: a key, the atom, its old state, and its 13 | new state. 14 | 15 | `key` should be a keyword and can be used with `remove-watch` to remove the 16 | watch function. 17 | 18 | ===== Related 19 | cljs.core/remove-watch 20 | 21 | ===== Example#2f2fe0 22 | 23 | ``` 24 | (def a (atom {})) 25 | 26 | (add-watch a :logger 27 | (fn [_key _atom old-state new-state] 28 | (println "old:" old-state) 29 | (println "new:" new-state))) 30 | 31 | (swap! a assoc :foo "bar") 32 | ;;=> will print the following: 33 | ;; old: {} 34 | ;; new: {:foo "bar"} 35 | ``` 36 | -------------------------------------------------------------------------------- /docfiles/cljs.core_aget.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/aget 3 | 4 | ===== Signature 5 | [array i] 6 | [array i & idxs] 7 | 8 | ===== Description 9 | 10 | Returns the value at index `i` from JavaScript arrays and objects. 11 | 12 | Can be used to retrieve nested properties with the additional `idxs` arguments. 13 | 14 | ===== Related 15 | cljs.core/.. 16 | cljs.core/aset 17 | cljs.core/get 18 | cljs.core/nth 19 | 20 | ===== Example#e36007 21 | 22 | ```js 23 | // JavaScript 24 | var a = {"foo": [5, 6]}; 25 | 26 | a["foo"]; 27 | //=> [5, 6] 28 | 29 | a["foo"][0]; 30 | //=> 5 31 | ``` 32 | 33 | ``` 34 | ;; ClojureScript 35 | (def a #js {:foo #js [5 6]}) 36 | 37 | (aget a "foo") 38 | ;;=> #js [5 6] 39 | 40 | (aget a "foo" 0) 41 | ;;=> 5 42 | ``` 43 | 44 | ===== Example#c9029e 45 | 46 | ```js 47 | // JavaScript 48 | document.location.href; 49 | //=> "http://example.com" 50 | ``` 51 | 52 | The following are equivalent: 53 | 54 | ``` 55 | ;; ClojureScript 56 | (aget js/document "location" "href") 57 | ;;=> "http://example.com" 58 | 59 | (.. js/document -location -href) 60 | ;;=> "http://example.com" 61 | ``` 62 | 63 | -------------------------------------------------------------------------------- /docfiles/cljs.core_alength.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/alength 3 | 4 | ===== Signature 5 | [a] 6 | 7 | ===== Description 8 | 9 | For interop, it returns the length of a JavaScript array or string. 10 | 11 | ===== Related 12 | cljs.core/count 13 | 14 | ===== Example#26f79f 15 | 16 | ``` 17 | (def a #js [1 2 3]) 18 | 19 | (alength a) 20 | ;;=> 3 21 | 22 | (.-length a) 23 | ;;=> 3 24 | 25 | (aget a "length") 26 | ;;=> 3 27 | 28 | (count a) 29 | ;;=> 3 30 | ``` 31 | -------------------------------------------------------------------------------- /docfiles/cljs.core_amap.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/amap 3 | 4 | ===== Signature 5 | [a idx ret expr] 6 | 7 | ===== Description 8 | 9 | For quickly creating a new JavaScript array by mapping an expression `expr` 10 | across a JavaScript array `a`. The expression can use `ret` as the current 11 | result, which is initialized to `a`. It can also use `idx` to get the current 12 | index. 13 | 14 | ===== Related 15 | cljs.core/map 16 | 17 | ===== Example#3a7471 18 | 19 | ``` 20 | (def a #js [1 2 3]) 21 | (amap a i ret (* 10 (aget a i))) 22 | ;;=> #js [10 20 30] 23 | ``` 24 | 25 | ===== Example#0f57af 26 | 27 | You can also use `ret` inside the mapped expression if you want to use the 28 | current result: 29 | 30 | ``` 31 | (def a #js [1 2 3]) 32 | (amap a i ret (+ (if (pos? i) 33 | (aget ret (dec i)) 34 | 0) 35 | (* 10 (aget a i)))) 36 | ;;=> #js [10 30 60] 37 | ``` 38 | 39 | -------------------------------------------------------------------------------- /docfiles/cljs.core_and.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/and 3 | 4 | ===== Type 5 | macro 6 | 7 | ===== Signature 8 | [] 9 | [x] 10 | [x & next] 11 | 12 | ===== Description 13 | 14 | Evaluates arguments one at a time from left to right. If an argument returns 15 | logical false (nil or false), `and` returns that value and doesn't evaluate any 16 | of the other arguments, otherwise it returns the value of the last argument. 17 | 18 | `(and)` returns true. 19 | 20 | ===== Related 21 | cljs.core/or 22 | cljs.core/if 23 | 24 | ===== Example#a39a73 25 | 26 | ``` 27 | (and) 28 | ;;=> true 29 | 30 | (and false) 31 | ;;=> false 32 | 33 | (and true) 34 | ;;=> true 35 | 36 | (and true true) 37 | ;;=> true 38 | 39 | (and true false) 40 | ;;=> false 41 | 42 | (and false false) 43 | ;;=> false 44 | ``` 45 | 46 | ===== Example#766638 47 | 48 | `nil` and `false` are the only falsy values and everything else is truthy: 49 | 50 | ``` 51 | (and "foo" "bar") 52 | ;;=> "bar" 53 | 54 | (and "foo" nil) 55 | ;;=> nil 56 | 57 | (and "foo" false) 58 | ;;=> false 59 | 60 | (and nil "foo") 61 | ;;=> nil 62 | 63 | (and false "foo") 64 | ;;=> false 65 | ``` 66 | -------------------------------------------------------------------------------- /docfiles/cljs.core_apply.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/apply 3 | 4 | ===== Signature 5 | [f args] 6 | [f x args] 7 | [f x y args] 8 | [f x y z args] 9 | [f a b c d & args] 10 | 11 | ===== Description 12 | 13 | Applies function `f` to the argument list formed by prepending intervening 14 | arguments to `args`. 15 | 16 | ===== Related 17 | cljs.core/map 18 | 19 | ===== Example#174052 20 | 21 | ``` 22 | (max 1 2 3) 23 | ;;=> 3 24 | 25 | (apply max [1 2 3]) 26 | ;;=> 3 27 | 28 | (apply max 1 [2 3]) 29 | ;;=> 3 30 | ``` 31 | 32 | -------------------------------------------------------------------------------- /docfiles/cljs.core_areduce.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/areduce 3 | 4 | ===== Signature 5 | [a idx ret init expr] 6 | 7 | ===== Description 8 | 9 | For quickly reducing an expression `expr` across a JavaScript array `a`. The 10 | expression can use `ret` as the current result, which is initialized to `init`. 11 | It can also use `idx` to get the current index. 12 | 13 | ===== Related 14 | cljs.core/reduce 15 | 16 | ===== Example#20a389 17 | 18 | ``` 19 | (def a #js [1 2 3]) 20 | (areduce a i ret 0 (+ ret (aget a i))) 21 | ;;=> 6 22 | ``` 23 | -------------------------------------------------------------------------------- /docfiles/cljs.core_array-map.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/array-map 3 | 4 | ===== Signature 5 | [& keyvals] 6 | 7 | ===== Description 8 | 9 | Returns a new array map (a map implemented with arrays) with the supplied mappings. 10 | 11 | `keyvals` must be an even number of forms. 12 | 13 | ===== Related 14 | cljs.core/assoc 15 | cljs.core/hash-map 16 | cljs.core/sorted-map 17 | 18 | ===== Example#198026 19 | 20 | ``` 21 | (array-map :a 10) 22 | ;;=> {:a 10} 23 | 24 | (array-map :a 10 :b 20) 25 | ;;=> {:a 10 :b 20} 26 | ``` 27 | -------------------------------------------------------------------------------- /docfiles/cljs.core_array-seq.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/array-seq 3 | 4 | ===== Signature 5 | [array] 6 | [array i] 7 | 8 | ===== Description 9 | 10 | Creates a `seq` from a JavaScript array or array-like object, starting at index `i` if given. 11 | 12 | ===== Related 13 | cljs.core/prim-seq 14 | -------------------------------------------------------------------------------- /docfiles/cljs.core_array.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/array 3 | 4 | ===== Signature 5 | [& args] 6 | 7 | ===== Description 8 | 9 | Creates a JavaScript array containing `args`. 10 | 11 | The tagged literal `#js [1 2 3]` is equivalent to `(array 1 2 3)` 12 | 13 | ===== Related 14 | cljs.core/aclone 15 | cljs.core/make-array 16 | cljs.core/clj->js 17 | 18 | ===== Example#3a546d 19 | 20 | ``` 21 | (array 1 2 3) 22 | ;;=> #js [1 2 3] 23 | 24 | (apply array [1 2 3]) 25 | ;;=> #js [1 2 3] 26 | 27 | #js [1 2 3] 28 | ;;=> #js [1 2 3] 29 | ``` 30 | 31 | ===== Example#cca945 32 | 33 | When creating nested JavaScript arrays, you can opt to use `clj->js` instead: 34 | 35 | ``` 36 | (array 1 2 (array 3 4)) 37 | ;;=> #js [1 2 #js [3 4]] 38 | 39 | (clj->js [1 2 [3 4]]) 40 | ;;=> #js [1 2 #js [3 4]] 41 | ``` 42 | 43 | -------------------------------------------------------------------------------- /docfiles/cljs.core_arrayQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/array? 3 | 4 | ===== Signature 5 | [x] 6 | 7 | ===== Description 8 | 9 | Returns true if `x` is a JavaScript array, false otherwise. 10 | 11 | ===== Related 12 | cljs.core/object? 13 | 14 | ===== Example#39913c 15 | 16 | ``` 17 | (array? #js [1 2 3]) 18 | ;;=> true 19 | 20 | (array? [1 2 3]) 21 | ;;=> false 22 | 23 | (array? "hi") 24 | ;;=> false 25 | ``` 26 | -------------------------------------------------------------------------------- /docfiles/cljs.core_as-GT.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/as-> 3 | 4 | ===== Type 5 | macro 6 | 7 | ===== Signature 8 | [expr name & forms] 9 | 10 | ===== Description 11 | 12 | Binds `name` to `expr`, evaluates the first form in the lexical context of that 13 | binding, then binds `name` to that result, repeating for each successive form, 14 | returning the result of the last form. 15 | 16 | Useful for when you want a threading macro to use different "places" at each 17 | form. 18 | 19 | ===== Related 20 | cljs.core/-> 21 | cljs.core/->> 22 | cljs.core/cond-> 23 | cljs.core/cond->> 24 | cljs.core/some-> 25 | cljs.core/some->> 26 | 27 | ===== TODO 28 | add threading macro animations link here 29 | 30 | ===== Example#5e7eef 31 | 32 | ``` 33 | (as-> [1 2 3 4] x 34 | (reduce + x) 35 | (/ x 2)) 36 | ;;=> 5 37 | ``` 38 | -------------------------------------------------------------------------------- /docfiles/cljs.core_aset.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/aset 3 | 4 | ===== Signature 5 | [array i val] 6 | [array idx idx2 & idxv] 7 | 8 | ===== Description 9 | 10 | Sets `val` at index `i` in JavaScript arrays and objects. 11 | 12 | Can be used to set nested properties with the additional `idxs` arguments. 13 | 14 | ===== Related 15 | cljs.core/aget 16 | cljs.core/set! 17 | cljs.core/assoc-in 18 | 19 | ===== Example#d1aa58 20 | 21 | ```js 22 | // JavaScript 23 | var a = {"foo": 3, "bar": [4, 5]}; 24 | 25 | a["foo"] = 4; 26 | a; 27 | //=> {"foo": 4, "bar": [4, 5]} 28 | 29 | a["bar"][0] = 6; 30 | a; 31 | //=> {"foo": 4, "bar": [6, 5]} 32 | ``` 33 | 34 | ``` 35 | ;; ClojureScript 36 | (def a #js {:foo 3, :bar #js [4 5]}) 37 | 38 | (aset a "foo" 4) 39 | a 40 | ;;=> #js {:foo 4, :bar #js [4 5]} 41 | 42 | (aset a "bar" 0 6) 43 | a 44 | ;;=> #js {:foo 4, :bar #js [6 5]} 45 | ``` 46 | 47 | ===== Example#34bbf3 48 | 49 | ```js 50 | // JavaScript 51 | document.location.href = "http://example.com"; 52 | ``` 53 | 54 | ``` 55 | ;; ClojureScript 56 | (aset js/document "location" "href" "http://example.com") 57 | ``` 58 | 59 | -------------------------------------------------------------------------------- /docfiles/cljs.core_assert.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/assert 3 | 4 | ===== Signature 5 | [expr] 6 | [expr message] 7 | 8 | ===== Description 9 | 10 | Evaluates expression `expr` and throws an exception if it does not evaluate to 11 | logical true. Exception will include `message` if given. 12 | 13 | Returns `nil`. 14 | 15 | ===== Example#1dc16f 16 | 17 | ``` 18 | (assert true) 19 | ;;=> nil 20 | 21 | (assert false) 22 | ;;=> Uncaught Error: Assert failed: false 23 | 24 | (assert (= 1 2) "1 is not 2") 25 | ;;=> Uncaught Error: Assert failed: 1 is not 2 26 | ;; (= 1 2) 27 | ``` 28 | 29 | -------------------------------------------------------------------------------- /docfiles/cljs.core_assoc-in.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/assoc-in 3 | 4 | ===== Signature 5 | [m [k & ks] v] 6 | 7 | ===== Description 8 | 9 | Associates a value in a nested associative structure, where `ks` is a sequence 10 | of keys and `v` is the new value. Returns a new nested structure. 11 | 12 | If any levels do not exist, hash-maps will be created. 13 | 14 | ===== Related 15 | cljs.core/assoc 16 | cljs.core/update-in 17 | cljs.core/get-in 18 | 19 | ===== Example#e76f20 20 | 21 | ``` 22 | (def users [{:name "James" :age 26} 23 | {:name "John" :age 43}]) 24 | ``` 25 | 26 | Update the age of the second (index 1) user: 27 | 28 | ``` 29 | (assoc-in users [1 :age] 44) 30 | ;;=> [{:name "James", :age 26} 31 | ;; {:name "John", :age 44}] 32 | ``` 33 | 34 | Insert the password of the second (index 1) user: 35 | 36 | ``` 37 | (assoc-in users [1 :password] "nhoJ") 38 | ;;=> [{:name "James", :age 26} 39 | ;; {:password "nhoJ", :name "John", :age 43}] 40 | ``` 41 | -------------------------------------------------------------------------------- /docfiles/cljs.core_assoc.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/assoc 3 | 4 | ===== Signature 5 | [coll k v] 6 | [coll k v & kvs] 7 | 8 | ===== Description 9 | 10 | assoc(iate) 11 | 12 | When applied to a map, returns a new map that contains the mapping of key(s) to 13 | val(s). 14 | 15 | Has no effect on the map type (hashed/sorted). 16 | 17 | When applied to a vector, returns a new vector that contains value `v` at index 18 | `k`. 19 | 20 | ===== Related 21 | cljs.core/assoc-in 22 | cljs.core/dissoc 23 | cljs.core/merge 24 | 25 | ===== Example#2fa7e0 26 | 27 | ``` 28 | (def my-map {:foo 1}) 29 | 30 | (assoc my-map :foo 2) 31 | ;;=> {:foo 2} 32 | 33 | (assoc my-map :bar 2) 34 | ;;=> {:foo 1 :bar 2} 35 | 36 | (assoc my-map :a 3 :b 4 :c 5 :d 6) 37 | ;;=> {:foo 1 :a 3 :b 4 :c 5 :d 6} 38 | 39 | ;; you must pass a value for every key 40 | (assoc my-map :foo) 41 | ;;=> WARNING: Wrong number of args (2) passed to cljs.core/assoc 42 | ``` 43 | 44 | ===== Example#c06eac 45 | 46 | ``` 47 | (def my-vec [1 2 3]) 48 | 49 | (assoc my-vec 0 "foo") 50 | ;;=> ["foo" 2 3] 51 | 52 | (assoc my-vec 3 "foo") 53 | ;;=> Error: Index 3 out of bounds [0,0] 54 | ``` 55 | -------------------------------------------------------------------------------- /docfiles/cljs.core_assocBANG.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/assoc! 3 | 4 | ===== Signature 5 | [tcoll key val] 6 | [tcoll key val & kvs] 7 | 8 | ===== Description 9 | 10 | assoc(iate) on transient collection 11 | 12 | When applied to a transient map, adds mapping of key(s) to val(s). 13 | 14 | When applied to a transient vector, sets the val at index. Note - index must 15 | be <= (count vector). 16 | 17 | Returns coll. 18 | 19 | ===== Related 20 | cljs.core/transient! 21 | cljs.core/persistent! 22 | 23 | ===== Example#7d1e6b 24 | 25 | ``` 26 | (def tcoll (transient! {})) 27 | (assoc! tcoll :a 1) 28 | (assoc! tcoll :b 2) 29 | 30 | tcoll 31 | ;;=> #<[object Object]> 32 | 33 | (:a tcoll) 34 | ;;=> 1 35 | 36 | (:b tcoll) 37 | ;;=> 2 38 | 39 | (def a (persistent! tcoll)) 40 | ;;=> {:a 1 :b 2} 41 | ``` 42 | 43 | -------------------------------------------------------------------------------- /docfiles/cljs.core_associativeQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/associative? 3 | 4 | ===== Signature 5 | [coll] 6 | 7 | ===== Description 8 | 9 | Returns true if `coll` implements the `IAssociative` protocol, false otherwise. 10 | 11 | Maps and vectors are associative. 12 | 13 | ===== Example#29a37f 14 | 15 | ``` 16 | (associative? [1 2 3]) 17 | ;;=> true 18 | 19 | (associative? {:a 1 :b 2}) 20 | ;;=> true 21 | 22 | (associative? #{1 2 3}) 23 | ;;=> false 24 | 25 | (associative? '(1 2 3)) 26 | ;;=> false 27 | ``` 28 | -------------------------------------------------------------------------------- /docfiles/cljs.core_atom.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/atom 3 | 4 | ===== Signature 5 | [x] 6 | [x opts] 7 | 8 | ===== Description 9 | 10 | Creates and returns an atom with an initial value of `x`. 11 | 12 | `opts` is an optional map with optional keys `:meta` and `:validator`. 13 | 14 | `:meta` should be a [metadata-map](http://clojure.org/metadata) for the atom. 15 | 16 | `:validator` should be a validator function for the atom. See `set-validator!` 17 | for more information. 18 | 19 | ===== Related 20 | cljs.core/atom 21 | cljs.core/swap! 22 | cljs.core/reset! 23 | cljs.core/set-validator! 24 | cljs.core/get-validator 25 | 26 | ===== Example#e6a38a 27 | 28 | ``` 29 | (def a (atom 1)) 30 | 31 | @a 32 | ;;=> 1 33 | 34 | (reset! a 2) 35 | @a 36 | ;;=> 2 37 | 38 | (swap! a inc) 39 | @a 40 | ;;=> 3 41 | ``` 42 | -------------------------------------------------------------------------------- /docfiles/cljs.core_binding.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/binding 3 | 4 | ===== Signature 5 | [bindings & body] 6 | 7 | ===== Description 8 | 9 | binding => var-symbol init-expr 10 | 11 | Creates new bindings for the (already-existing) vars, with the 12 | supplied initial values, executes the exprs in an implicit `do`, then 13 | re-establishes the bindings that existed before. 14 | 15 | The new bindings are made in parallel (unlike `let`); all init-exprs are 16 | evaluated before the vars are bound to their new values. 17 | 18 | ===== Related 19 | cljs.core/let 20 | 21 | ===== Example#7dd17f 22 | 23 | ``` 24 | (def ^:dynamic *foo* 1) 25 | 26 | (defn do-something [] 27 | (println *foo*)) 28 | 29 | (binding [*foo* 2] 30 | (do-something)) 31 | ;;=> prints 2 32 | 33 | *foo* 34 | ;;=> 1 35 | ``` 36 | -------------------------------------------------------------------------------- /docfiles/cljs.core_bit-and-not.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/bit-and-not 3 | 4 | ===== Signature 5 | [x y] 6 | [x y & more] 7 | 8 | ===== Description 9 | 10 | Bitwise "and" `x` with bitwise "not" `y`. Same as `x & ~y` in JavaScript. 11 | 12 | ===== Related 13 | cljs.core/bit-and 14 | cljs.core/bit-not 15 | 16 | ===== Example#16f35d 17 | 18 | Bits can be entered using radix notation: 19 | 20 | ``` 21 | (bit-and-not 2r1100 2r1010) 22 | ;;=> 4 23 | ;; 4 = 2r0100 24 | ``` 25 | 26 | Same numbers in decimal: 27 | 28 | ``` 29 | (bit-and-not 12 10) 30 | ;;=> 4 31 | ``` 32 | 33 | Same result using `bit-and` and `bit-not`: 34 | 35 | ``` 36 | (bit-and 12 (bit-not 10)) 37 | ;;=> 4 38 | ``` 39 | 40 | -------------------------------------------------------------------------------- /docfiles/cljs.core_bit-and.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/bit-and 3 | 4 | ===== Signature 5 | [x y] 6 | [x y & more] 7 | 8 | ===== Description 9 | 10 | Bitwise "and". Same as `x & y` in JavaScript. 11 | 12 | ===== Related 13 | cljs.core/bit-or 14 | 15 | ===== Example#3c0470 16 | 17 | Bits can be entered using radix notation: 18 | 19 | ``` 20 | (bit-and 2r1100 2r1010) 21 | ;;=> 8 22 | ;; 8 = 2r1000 23 | ``` 24 | 25 | Same numbers in decimal: 26 | 27 | ``` 28 | (bit-and 12 10) 29 | ;;=> 8 30 | ``` 31 | 32 | -------------------------------------------------------------------------------- /docfiles/cljs.core_bit-clear.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/bit-clear 3 | 4 | ===== Signature 5 | [x n] 6 | 7 | ===== Description 8 | 9 | Clear bit at index `n`. Same as `x & ~(1 << y)` in JavaScript. 10 | 11 | ===== Related 12 | cljs.core/bit-set 13 | 14 | ===== Example#0f6748 15 | 16 | Bits can be entered using radix notation: 17 | 18 | ``` 19 | (bit-clear 2r1111 2) 20 | ;;=> 11 21 | ;; 11 = 2r1011 22 | ``` 23 | 24 | Same numbers in decimal: 25 | 26 | ``` 27 | (bit-clear 15 2) 28 | ;;=> 11 29 | ``` 30 | -------------------------------------------------------------------------------- /docfiles/cljs.core_bit-flip.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/bit-flip 3 | 4 | ===== Signature 5 | [x n] 6 | 7 | ===== Description 8 | 9 | Flip bit at index `n` 10 | 11 | ===== Related 12 | -------------------------------------------------------------------------------- /docfiles/cljs.core_bit-not.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/bit-not 3 | 4 | ===== Signature 5 | [x] 6 | 7 | ===== Description 8 | 9 | Bitwise complement 10 | 11 | ===== Related 12 | -------------------------------------------------------------------------------- /docfiles/cljs.core_bit-or.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/bit-or 3 | 4 | ===== Signature 5 | [x y] 6 | 7 | ===== Description 8 | 9 | Bitwise or 10 | 11 | ===== Related 12 | cljs.core/bit-and 13 | cljs.core/bit-xor 14 | -------------------------------------------------------------------------------- /docfiles/cljs.core_bit-set.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/bit-set 3 | 4 | ===== Signature 5 | [x n] 6 | 7 | ===== Description 8 | 9 | Set bit at index `n` 10 | 11 | ===== Related 12 | cljs.core/bit-clear 13 | -------------------------------------------------------------------------------- /docfiles/cljs.core_bit-shift-left.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/bit-shift-left 3 | 4 | ===== Signature 5 | [x n] 6 | 7 | ===== Description 8 | 9 | Bitwise shift left 10 | 11 | ===== Related 12 | cljs.core/bit-shift-right 13 | -------------------------------------------------------------------------------- /docfiles/cljs.core_bit-shift-right.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/bit-shift-right 3 | 4 | ===== Signature 5 | [x n] 6 | 7 | ===== Description 8 | 9 | Bitwise shift right 10 | 11 | ===== Related 12 | cljs.core/bit-shift-left 13 | cljs.core/unsigned-bit-shift-right 14 | -------------------------------------------------------------------------------- /docfiles/cljs.core_bit-test.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/bit-test 3 | 4 | ===== Signature 5 | [x n] 6 | 7 | ===== Description 8 | 9 | Test bit at index `n` 10 | 11 | ===== Related 12 | -------------------------------------------------------------------------------- /docfiles/cljs.core_bit-xor.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/bit-xor 3 | 4 | ===== Signature 5 | [x y] 6 | 7 | ===== Description 8 | 9 | Bitwise exclusive or 10 | 11 | ===== Related 12 | cljs.core/bit-and 13 | cljs.core/bit-or 14 | -------------------------------------------------------------------------------- /docfiles/cljs.core_butlast.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/butlast 3 | 4 | ===== Signature 5 | [s] 6 | 7 | ===== Description 8 | 9 | Returns a sequence of all but the last item in `s`. 10 | 11 | `butlast` runs in linear time. 12 | 13 | ===== Related 14 | cljs.core/first 15 | cljs.core/rest 16 | cljs.core/last 17 | cljs.core/next 18 | cljs.core/drop-last 19 | cljs.core/take-last 20 | -------------------------------------------------------------------------------- /docfiles/cljs.core_case.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/case 3 | 4 | ===== Type 5 | macro 6 | 7 | ===== Signature 8 | [e & clauses] 9 | 10 | ===== Description 11 | 12 | Takes an expression and a set of clauses. Each clause can take the form of 13 | either: 14 | 15 | `test-constant result-expr` 16 | 17 | `(test-constant1 ... test-constantN) result-expr` 18 | 19 | The test-constants are not evaluated. They must be compile-time literals, and 20 | need not be quoted. If the expression is equal to a test-constant, the 21 | corresponding `result-expr` is returned. A single default expression can follow 22 | the clauses, and its value will be returned if no clause matches. If no default 23 | expression is provided and no clause matches, an Error is thrown. 24 | 25 | Unlike `cond` and `condp`, `case` does a constant-time dispatch, the clauses are 26 | not considered sequentially. All manner of constant expressions are acceptable 27 | in `case`, including numbers, strings, symbols, keywords, and ClojureScript 28 | composites thereof. Note that since lists are used to group multiple constants 29 | that map to the same expression, a vector can be used to match a list if needed. 30 | The test-constants need not be all of the same type. 31 | 32 | ===== Related 33 | cljs.core/cond 34 | cljs.core/condp 35 | -------------------------------------------------------------------------------- /docfiles/cljs.core_catch.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/catch 3 | 4 | ===== Type 5 | special form 6 | 7 | ===== Signature 8 | [exception-type name expr*] 9 | 10 | ===== Description 11 | 12 | `catch` should be used inside of a `try` expression. 13 | 14 | `exception-type` should be the type of exception thrown (usually `js/Error` or 15 | `js/Object`). When there is a match, the thrown exception will be bound to 16 | `name` inside of `expr*` and `expr*` will be evaluated and returned as the value 17 | of the `try` expression. 18 | 19 | ===== Related 20 | cljs.core/try 21 | cljs.core/finally 22 | cljs.core/throw 23 | -------------------------------------------------------------------------------- /docfiles/cljs.core_char.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/char 3 | 4 | ===== Signature 5 | [x] 6 | 7 | ===== Description 8 | 9 | Coerce to char 10 | 11 | ===== Related 12 | -------------------------------------------------------------------------------- /docfiles/cljs.core_clj-GTjs.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/clj->js 3 | 4 | ===== Signature 5 | [x] 6 | 7 | ===== Description 8 | 9 | Recursively transforms ClojureScript values to JavaScript. 10 | 11 | | ClojureScript | | JavaScript | | 12 | |---------------|--------|------------|---------| 13 | | Set | `#{}` | Array | `[]` | 14 | | Vector | `[]` | Array | `[]` | 15 | | List | `()` | Array | `[]` | 16 | | Keyword | `:foo` | String | `"foo"` | 17 | | Symbol | `bar` | String | `"bar"` | 18 | | Map | `{}` | Object | `{}` | 19 | 20 | ===== Related 21 | cljs.core/js->clj 22 | -------------------------------------------------------------------------------- /docfiles/cljs.core_collQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/coll? 3 | 4 | ===== Signature 5 | [x] 6 | 7 | ===== Description 8 | 9 | Returns true if `x` is a collection, false otherwise. 10 | 11 | Lists, maps, sets, and vectors are collections. 12 | 13 | ===== Related 14 | cljs.core/seq? 15 | cljs.core/list? 16 | cljs.core/sequential? 17 | -------------------------------------------------------------------------------- /docfiles/cljs.core_comp.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/comp 3 | 4 | ===== Signature 5 | [] 6 | [f] 7 | [f g] 8 | [f g h] 9 | [f1 f2 f3 & fs] 10 | 11 | ===== Description 12 | 13 | Takes a set of functions (`fn`s) and returns a function that is the composition 14 | of those functions. 15 | 16 | The returned function takes a variable number of arguments, applies the 17 | rightmost of `fn`s to the arguments, the next `fn` (right-to-left) to the 18 | result, etc. 19 | 20 | `((comp a b c) x y)` => `(a (b (c x y)))` 21 | 22 | ===== Related 23 | cljs.core/partial 24 | cljs.core/juxt 25 | 26 | ===== TODO 27 | 28 | this needs work -------------------------------------------------------------------------------- /docfiles/cljs.core_compare-and-setBANG.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/compare-and-set! 3 | 4 | ===== Signature 5 | [a oldval newval] 6 | 7 | ===== Description 8 | 9 | Atomically sets the value of atom `a` to `newval` if and only if the current 10 | value of the atom is identical to `oldval`. 11 | 12 | Returns true if set happened, false otherwise. 13 | 14 | ===== Related 15 | cljs.core/atom 16 | cljs.core/reset! 17 | cljs.core/swap! 18 | -------------------------------------------------------------------------------- /docfiles/cljs.core_compare.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/compare 3 | 4 | ===== Signature 5 | [x y] 6 | 7 | ===== Description 8 | 9 | Comparator. 10 | 11 | Returns a negative number, zero, or a positive number when `x` is logically 12 | "less than", "equal to", or "greater than" `y`. 13 | 14 | Uses `IComparable` if available and `google.array.defaultCompare` for objects of 15 | the same type. nil is treated as a special case and is always less than any 16 | other object. 17 | 18 | ===== Related 19 | cljs.core/sort-by 20 | cljs.core/sorted-set-by 21 | cljs.core/sorted-map-by 22 | -------------------------------------------------------------------------------- /docfiles/cljs.core_complement.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/complement 3 | 4 | ===== Signature 5 | [f] 6 | 7 | ===== Description 8 | 9 | Takes a function `f` and returns a function that takes the same arguments as 10 | `f`, has the same effects, if any, and returns the opposite truth value. 11 | 12 | ===== Related 13 | cljs.core/not 14 | -------------------------------------------------------------------------------- /docfiles/cljs.core_concat.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/concat 3 | 4 | ===== Signature 5 | [] 6 | [x] 7 | [x y] 8 | [x y & zs] 9 | 10 | ===== Description 11 | 12 | Returns a lazy sequence representing the concatenation of the elements in the 13 | supplied collections. 14 | 15 | ===== Related 16 | cljs.core/conj 17 | cljs.core/into 18 | -------------------------------------------------------------------------------- /docfiles/cljs.core_cond-GT.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/cond-> 3 | 4 | ===== Type 5 | macro 6 | 7 | ===== Signature 8 | [expr & clauses] 9 | 10 | ===== Description 11 | 12 | Takes an expression and a set of test/form pairs. Threads `expr` (via `->`) 13 | through each form for which the corresponding test expression is true. 14 | 15 | Note that, unlike `cond` branching, `cond->` threading does not short circuit 16 | after the first true test expression. 17 | 18 | ===== Related 19 | cljs.core/-> 20 | cljs.core/->> 21 | cljs.core/cond->> 22 | cljs.core/cond 23 | -------------------------------------------------------------------------------- /docfiles/cljs.core_cond-GTGT.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/cond->> 3 | 4 | ===== Type 5 | macro 6 | 7 | ===== Signature 8 | [expr & clauses] 9 | 10 | ===== Description 11 | 12 | Takes an expression and a set of test/form pairs. Threads `expr` (via `->>`) 13 | through each form for which the corresponding test expression is true. 14 | 15 | Note that, unlike `cond` branching, `cond->>` threading does not short circuit 16 | after the first true test expression. 17 | 18 | ===== Related 19 | cljs.core/-> 20 | cljs.core/->> 21 | cljs.core/cond-> 22 | cljs.core/cond 23 | -------------------------------------------------------------------------------- /docfiles/cljs.core_cond.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/cond 3 | 4 | ===== Type 5 | macro 6 | 7 | ===== Signature 8 | [& clauses] 9 | 10 | ===== Description 11 | 12 | `clauses` must be an even number of forms, ie: `(cond t1 e1, t2 e2, t3 e3)`. 13 | Each test `t` is evaluated one at a time. If a test returns logical true, `cond` 14 | evaluates and returns the corresponding expression `e` and does not evaluate any 15 | of the other tests or expressions. 16 | 17 | It is idiomatic to provide a default case as the last test pair using the 18 | keyword `:else` (a keyword always evaluates to logical true). 19 | 20 | `(cond)` returns nil. 21 | 22 | ===== Related 23 | cljs.core/condp 24 | cljs.core/case 25 | cljs.core/if 26 | -------------------------------------------------------------------------------- /docfiles/cljs.core_condp.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/condp 3 | 4 | ===== Type 5 | macro 6 | 7 | ===== Signature 8 | [pred expr & clauses] 9 | 10 | ===== Description 11 | 12 | Takes a binary predicate, an expression, and a set of clauses. There are two 13 | kinds of clauses: 14 | 15 | Binary clause: `test-expr` `result-expr` 16 | 17 | Ternary clause: `test-expr` `:>>` `result-fn`
18 | (Note: `:>>` is an ordinary keyword) 19 | 20 | For each clause, `(pred test-expr expr)` is evaluated. If it returns logical 21 | true, the clause is a match. 22 | 23 | If a binary clause matches, its `result-expr` is returned. 24 | 25 | If a ternary clause matches, its `result-fn` is called with the result of the 26 | predicate and returned by `condp`. `result-fn` should take one argument. 27 | 28 | A single default expression can follow the clauses, and its value will be 29 | returned if no clause matches. 30 | 31 | If no default expression is provided and no clause matches, an Error is thrown. 32 | 33 | ===== Related 34 | cljs.core/cond 35 | cljs.core/if 36 | -------------------------------------------------------------------------------- /docfiles/cljs.core_conj.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/conj 3 | 4 | ===== Signature 5 | [] 6 | [coll] 7 | [coll x] 8 | [coll x & xs] 9 | 10 | ===== Description 11 | 12 | conj(oin) 13 | 14 | Returns a new collection with the `x`s "added" to `coll`. 15 | 16 | `conj` adds items to the end of a vector, the beginning of a list, and into a 17 | set. 18 | 19 | `conj` works with maps by merging and also supports vector pairs with two 20 | elements. 21 | 22 | Multiple `x`s are added in order, as if called one at a time. 23 | 24 | `(conj nil item)` returns `(item)`. 25 | 26 | ===== Related 27 | cljs.core/cons 28 | cljs.core/into 29 | cljs.core/merge 30 | cljs.core/peek 31 | cljs.core/pop 32 | -------------------------------------------------------------------------------- /docfiles/cljs.core_cons.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/cons 3 | 4 | ===== Signature 5 | [x coll] 6 | 7 | ===== Description 8 | 9 | Returns a new sequence where `x` is the first element and `coll` is the rest. 10 | 11 | ===== Related 12 | cljs.core/conj 13 | -------------------------------------------------------------------------------- /docfiles/cljs.core_constantly.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/constantly 3 | 4 | ===== Signature 5 | [x] 6 | 7 | ===== Description 8 | Returns a function that takes any number of arguments and always returns `x`. 9 | 10 | ===== Related 11 | cljs.core/repeatedly 12 | -------------------------------------------------------------------------------- /docfiles/cljs.core_containsQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/contains? 3 | 4 | ===== Signature 5 | [coll k] 6 | 7 | ===== Description 8 | 9 | Returns true if `k` is present in `coll`, otherwise returns false. 10 | 11 | Note that for numerically indexed collections like vectors and arrays, this 12 | tests if the numeric key is within the range of indexes. 13 | 14 | `contains?` operates in constant or logarithmic time; it will not perform a 15 | linear search for a value. 16 | 17 | ===== Related 18 | cljs.core/some 19 | cljs.core/get 20 | clojure.string/includes? 21 | -------------------------------------------------------------------------------- /docfiles/cljs.core_count.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/count 3 | 4 | ===== Signature 5 | [x] 6 | 7 | ===== Description 8 | 9 | Returns the number of items in `x`. 10 | 11 | `count` works on arrays, lists, maps, sets, strings, and vectors. 12 | 13 | `(count nil)` returns 0. 14 | 15 | ===== Related 16 | -------------------------------------------------------------------------------- /docfiles/cljs.core_countedQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/counted? 3 | 4 | ===== Signature 5 | [x] 6 | 7 | ===== Description 8 | 9 | Returns true if `x` executes `count` in constant time, false otherwise. 10 | 11 | Lists, maps, sets, strings, and vectors can be counted in constant time. 12 | 13 | ===== Related 14 | -------------------------------------------------------------------------------- /docfiles/cljs.core_cycle.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/cycle 3 | 4 | ===== Signature 5 | [coll] 6 | 7 | ===== Description 8 | 9 | Returns an infinite lazy sequence of repetitions of the items in `coll`. 10 | 11 | ===== Related 12 | cljs.core/lazy-seq 13 | cljs.core/repeatedly 14 | -------------------------------------------------------------------------------- /docfiles/cljs.core_dec.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/dec 3 | 4 | ===== Signature 5 | [x] 6 | 7 | ===== Description 8 | 9 | Returns a number one less than `x`. 10 | 11 | ===== Related 12 | cljs.core/inc 13 | -------------------------------------------------------------------------------- /docfiles/cljs.core_declare.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/declare 3 | 4 | ===== Type 5 | macro 6 | 7 | ===== Signature 8 | [& names] 9 | 10 | ===== Description 11 | 12 | Uses `def` to establish symbols of `names` with no bindings. 13 | 14 | Useful for making forward declarations. 15 | 16 | ===== Related 17 | cljs.core/def 18 | -------------------------------------------------------------------------------- /docfiles/cljs.core_def.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/def 3 | 4 | ===== Type 5 | special form 6 | 7 | ===== Signature 8 | [symbol] 9 | [symbol init?] 10 | [symbol doc-string? init?] 11 | 12 | ===== Description 13 | 14 | Creates a global variable with the name of `symbol` and a namespace of the 15 | current namespace. 16 | 17 | If `init` is supplied, it is evaluated and the result is assigned to `symbol`, otherwise `symbol` is `nil`. 18 | 19 | `doc-string` is an optional documentation string. 20 | 21 | `def` is one of ClojureScript's [special forms](http://clojure.org/special_forms) 22 | and is used by many macros to define common elements (ie: `defn`, `defmacro`, 23 | etc). 24 | 25 | ===== Related 26 | cljs.core/defn 27 | cljs.core/fn 28 | cljs.core/defmacro 29 | cljs.core/defmulti 30 | 31 | ===== TODO 32 | 33 | Need to include something about metadata here? 34 | -------------------------------------------------------------------------------- /docfiles/cljs.core_defn-.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/defn- 3 | 4 | ===== Type 5 | macro 6 | 7 | ===== Signature 8 | [name & decls] 9 | 10 | ===== Description 11 | 12 | Same as `defn`, but adds `{:private true}` metadata to the definition. 13 | 14 | Note: `:private` metadata is not currently enforced by the ClojureScript 15 | compiler. 16 | 17 | ===== Related 18 | cljs.core/defn 19 | -------------------------------------------------------------------------------- /docfiles/cljs.core_defn.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/defn 3 | 4 | ===== Type 5 | macro 6 | 7 | ===== Signature 8 | [name doc-string? attr-map? [params*] prepost-map? body] 9 | [name doc-string? attr-map? ([params*] prepost-map? body) + attr-map?] 10 | 11 | ===== Description 12 | 13 | Defines a function. 14 | 15 | `doc-string?` is an optional documentation string. 16 | 17 | `attr-map?` is an optional map of [metadata](http://clojure.org/metadata) to 18 | attach to the global variable name. 19 | 20 | `prepost-map?` is an optional map with optional keys `:pre` and `:post` that 21 | contain collections of [pre or post conditions](http://blog.fogus.me/2009/12/21/clojures-pre-and-post/) 22 | for the function. 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 34 |
CodeExpands To
32 | (defn foo [a b c]
33 |   (\* a b c))
35 | (def foo
36 |   (fn [a b c]
37 |     (\* a b c)))
38 | 39 | ===== Related 40 | cljs.core/def 41 | cljs.core/defn- 42 | cljs.core/defmacro 43 | cljs.core/fn 44 | -------------------------------------------------------------------------------- /docfiles/cljs.core_deref.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/deref 3 | 4 | ===== Signature 5 | [x] 6 | 7 | ===== Description 8 | 9 | Returns the current value of atom `x`. 10 | 11 | The `@` reader macro is often used instead of `deref`. `@foo` is the same thing 12 | as `(deref foo)`. 13 | 14 | ===== Related 15 | cljs.core/atom 16 | -------------------------------------------------------------------------------- /docfiles/cljs.core_disj.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/disj 3 | 4 | ===== Signature 5 | [coll] 6 | [coll k] 7 | [coll k & ks] 8 | 9 | ===== Description 10 | 11 | disj(oin). Returns a new set of the same (hashed/sorted) type, that does not 12 | contain key(s). 13 | 14 | ===== Related 15 | cljs.core/dissoc 16 | cljs.core/disj! 17 | clojure.set/difference 18 | -------------------------------------------------------------------------------- /docfiles/cljs.core_dissoc.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/dissoc 3 | 4 | ===== Signature 5 | [coll] 6 | [coll k] 7 | [coll k & ks] 8 | 9 | ===== Description 10 | 11 | dissoc(iate) 12 | 13 | Returns a new map that does not contain a mapping for key(s). 14 | 15 | Has no effect on the map type (hashed/sorted). 16 | 17 | ===== Related 18 | cljs.core/assoc 19 | cljs.core/disj 20 | cljs.core/select-keys 21 | -------------------------------------------------------------------------------- /docfiles/cljs.core_distinct.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/distinct 3 | 4 | ===== Signature 5 | [coll] 6 | 7 | ===== Description 8 | 9 | Returns a lazy sequence of the elements of `coll` with duplicates removed. 10 | 11 | ===== Related 12 | cljs.core/distinct? 13 | -------------------------------------------------------------------------------- /docfiles/cljs.core_distinctQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/distinct? 3 | 4 | ===== Signature 5 | [x] 6 | [x y] 7 | [x y & more] 8 | 9 | ===== Description 10 | 11 | Returns true if no two of the arguments are `=` 12 | 13 | ===== Related 14 | cljs.core/distinct 15 | -------------------------------------------------------------------------------- /docfiles/cljs.core_doall.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/doall 3 | 4 | ===== Signature 5 | [coll] 6 | [n coll] 7 | 8 | ===== Description 9 | 10 | Forces evaluation of a lazy sequence. Often used to see the effects of a 11 | sequence produced via functions that have side effects. 12 | 13 | `doall` walks through the successive `next`s of the sequence, returning the head 14 | and causing the entire sequence to reside in memory at one time. 15 | 16 | ===== Related 17 | cljs.core/dorun 18 | cljs.core/doseq 19 | 20 | ===== TODO 21 | 22 | What does `n` do here? This description needs work and probably an example. 23 | -------------------------------------------------------------------------------- /docfiles/cljs.core_dorun.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/dorun 3 | 4 | ===== Signature 5 | [coll] 6 | [n coll] 7 | 8 | ===== Description 9 | 10 | Forces evaluation of a lazy sequence. Often used to see the effects of a 11 | sequence produced via functions that have side effects. 12 | 13 | `dorun` walks through the successive `next`s of the sequence and returns nil. 14 | 15 | ===== Related 16 | cljs.core/doall 17 | -------------------------------------------------------------------------------- /docfiles/cljs.core_doseq.cljsdoc: -------------------------------------------------------------------------------- 1 | TODO: this needs a better explanation and example 2 | 3 | ===== Name 4 | cljs.core/doseq 5 | 6 | ===== Type 7 | macro 8 | 9 | ===== Signature 10 | [seq-exprs & body] 11 | 12 | ===== Description 13 | 14 | Repeatedly executes `body` (presumably for side-effects) with bindings and 15 | filtering as provided by `for`. Does not retain the head of the sequence. 16 | 17 | Returns nil. 18 | 19 | ===== Related 20 | cljs.core/doall 21 | cljs.core/dorun 22 | cljs.core/for 23 | cljs.core/dotimes 24 | -------------------------------------------------------------------------------- /docfiles/cljs.core_dotimes.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/dotimes 3 | 4 | ===== Type 5 | macro 6 | 7 | ===== Signature 8 | [[name n] & body] 9 | 10 | ===== Description 11 | 12 | Repeatedly executes `body` (presumably for side-effects) with `name` bound to 13 | integers from `0` through `n-1`. 14 | 15 | ===== Related 16 | cljs.core/repeat 17 | cljs.core/for 18 | cljs.core/doseq 19 | -------------------------------------------------------------------------------- /docfiles/cljs.core_drop-last.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/drop-last 3 | 4 | ===== Signature 5 | [s] 6 | [n s] 7 | 8 | ===== Description 9 | 10 | Return a lazy sequence of all but the last `n` items in `s`. 11 | 12 | `n` defaults to 1. 13 | 14 | ===== Related 15 | cljs.core/drop 16 | cljs.core/drop-while 17 | -------------------------------------------------------------------------------- /docfiles/cljs.core_drop-while.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/drop-while 3 | 4 | ===== Signature 5 | [pred] 6 | [pred coll] 7 | 8 | ===== Description 9 | 10 | Returns a lazy sequence of the items in `coll` starting from the first item for 11 | which `(pred item)` returns logical false. 12 | 13 | Returns a stateful transducer when no collection is provided. 14 | 15 | ===== Related 16 | cljs.core/take-while 17 | cljs.core/split-with 18 | -------------------------------------------------------------------------------- /docfiles/cljs.core_drop.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/drop 3 | 4 | ===== Signature 5 | [n] 6 | [n coll] 7 | 8 | ===== Description 9 | 10 | Returns a lazy sequence of all but the first `n` items in `coll`. 11 | 12 | Returns a stateful transducer when no collection is provided. 13 | 14 | ===== Related 15 | cljs.core/take 16 | cljs.core/drop-last 17 | cljs.core/drop-while 18 | cljs.core/nthnext 19 | cljs.core/nthrest 20 | -------------------------------------------------------------------------------- /docfiles/cljs.core_empty.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/empty 3 | 4 | ===== Signature 5 | [coll] 6 | 7 | ===== Description 8 | 9 | Returns an empty collection of the same category as `coll`. 10 | 11 | Returns nil if `coll` is nil. 12 | 13 | ===== Related 14 | cljs.core/not-empty 15 | -------------------------------------------------------------------------------- /docfiles/cljs.core_emptyQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/empty? 3 | 4 | ===== Signature 5 | [coll] 6 | 7 | ===== Description 8 | 9 | Returns true if `coll` has no items - same as `(not (seq coll))`. 10 | 11 | Please use the idiom `(seq x)` rather than `(not (empty? x))`. 12 | 13 | ===== Related 14 | cljs.core/seq 15 | clojure.string/blank? 16 | -------------------------------------------------------------------------------- /docfiles/cljs.core_evenQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/even? 3 | 4 | ===== Signature 5 | [n] 6 | 7 | ===== Description 8 | 9 | Returns true if `n` is an even number. 10 | 11 | Throws an exception if `n` is not an integer. 12 | 13 | ===== Related 14 | cljs.core/odd? 15 | -------------------------------------------------------------------------------- /docfiles/cljs.core_every-pred.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/every-pred 3 | 4 | ===== Signature 5 | [p] 6 | [p1 p2] 7 | [p1 p2 p3] 8 | [p1 p2 p3 & ps] 9 | 10 | ===== Description 11 | 12 | Takes a set of predicate functions and returns a function `f` that returns true 13 | if all of its composing predicates return a logical true value against all of 14 | its arguments, else it returns false. 15 | 16 | Note that `f` is short-circuiting in that it will stop execution on the first 17 | argument that triggers a logical false result against the original predicates. 18 | 19 | ===== Related 20 | cljs.core/some-fn 21 | cljs.core/and 22 | -------------------------------------------------------------------------------- /docfiles/cljs.core_everyQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/every? 3 | 4 | ===== Signature 5 | [pred coll] 6 | 7 | ===== Description 8 | 9 | Returns true if `(pred x)` is logical true for every `x` in `coll`, else false. 10 | 11 | ===== Related 12 | cljs.core/some 13 | cljs.core/not-any? 14 | -------------------------------------------------------------------------------- /docfiles/cljs.core_falseQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/false? 3 | 4 | ===== Signature 5 | [x] 6 | 7 | ===== Description 8 | 9 | Returns true if `x` is the value false, false otherwise. 10 | 11 | ===== Related 12 | cljs.core/true? 13 | cljs.core/not 14 | -------------------------------------------------------------------------------- /docfiles/cljs.core_ffirst.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/ffirst 3 | 4 | ===== Signature 5 | [coll] 6 | 7 | ===== Description 8 | 9 | Same as `(first (first coll))`. 10 | 11 | ===== Related 12 | cljs.core/first 13 | cljs.core/fnext 14 | cljs.core/nfirst 15 | -------------------------------------------------------------------------------- /docfiles/cljs.core_filter.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/filter 3 | 4 | ===== Signature 5 | [pred] 6 | [pred coll] 7 | 8 | ===== Description 9 | 10 | Returns a lazy sequence of the items in coll for which `(pred item)` returns 11 | logical true. 12 | 13 | `pred` must be free of side-effects. 14 | 15 | Returns a transducer when no collection is provided. 16 | 17 | ===== Related 18 | cljs.core/remove 19 | cljs.core/keep 20 | -------------------------------------------------------------------------------- /docfiles/cljs.core_filterv.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/filterv 3 | 4 | ===== Signature 5 | [pred coll] 6 | 7 | ===== Description 8 | 9 | Returns a vector of the items in `coll` for which `(pred item)` returns true. 10 | 11 | `pred` must be free of side-effects. 12 | -------------------------------------------------------------------------------- /docfiles/cljs.core_finally.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/finally 3 | 4 | ===== Type 5 | special form 6 | 7 | ===== Signature 8 | [expr*] 9 | 10 | ===== Description 11 | 12 | `finally` should be the last form inside of a `try` expression. It is optional. 13 | 14 | `finally` clauses are always evaluated for their side effects whether there was 15 | an error or not, but they are never the return value of a `try` expression. 16 | 17 | ===== Related 18 | cljs.core/try 19 | cljs.core/catch 20 | cljs.core/throw 21 | -------------------------------------------------------------------------------- /docfiles/cljs.core_find.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/find 3 | 4 | ===== Signature 5 | [coll k] 6 | 7 | ===== Description 8 | 9 | Returns the map entry for key `k`, or nil if `k` is not found. 10 | 11 | ===== Related 12 | cljs.core/get 13 | cljs.core/get-in 14 | -------------------------------------------------------------------------------- /docfiles/cljs.core_first.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/first 3 | 4 | ===== Signature 5 | [coll] 6 | 7 | ===== Description 8 | 9 | Returns the first item in `coll` and calls `seq` on its argument. 10 | 11 | Returns nil when `coll` is nil. 12 | 13 | ===== Related 14 | cljs.core/rest 15 | cljs.core/next 16 | cljs.core/nth 17 | cljs.core/second 18 | cljs.core/take 19 | cljs.core/ffirst 20 | -------------------------------------------------------------------------------- /docfiles/cljs.core_flatten.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/flatten 3 | 4 | ===== Signature 5 | [x] 6 | 7 | ===== Description 8 | 9 | Takes any nested combination of sequential things (lists, vectors, etc.) and 10 | returns their contents as a single, flat sequence. 11 | 12 | `(flatten nil)` returns nil. 13 | 14 | ===== Related 15 | -------------------------------------------------------------------------------- /docfiles/cljs.core_fn.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/fn 3 | 4 | ===== Type 5 | special form 6 | 7 | ===== Signature 8 | [name? [params*] prepost-map? body] 9 | [name? ([params*] prepost-map? body)+] 10 | 11 | ===== Description 12 | 13 | Defines a function. 14 | 15 | `name?` is an optional name of the function to be used inside `body`. This is 16 | useful for recursive calls. Note that `name?` in `fn` is not the same as the 17 | `name` argument to `defn`, which defines a global symbol for the function. 18 | 19 | `params*` are the arguments to the function and a binding form for the symbols 20 | that the arguments will take inside the body of the function. Functions can have 21 | arity of 0-20 and there is no runtime enforcement of arity when calling a 22 | function (just like in JavaScript). 23 | 24 | `prepost-map?` is an optional map with optional keys `:pre` and `:post` that 25 | contain collections of [pre or post conditions](http://blog.fogus.me/2009/12/21/clojures-pre-and-post/) 26 | for the function. 27 | 28 | `body` is a series of expressions that execute when the function is called. The 29 | arguments to the function are mapped to symbols in `params*` and are available 30 | in `body`. The value of the last expression in `body` is the return value of 31 | calling the function. 32 | 33 | ===== Related 34 | cljs.core/defn 35 | cljs.core/defn- 36 | 37 | ===== TODO 38 | 39 | need to provide a link to some function definition examples; we probably need 40 | a whole page dedicated to fn expressions 41 | -------------------------------------------------------------------------------- /docfiles/cljs.core_fnQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/fn? 3 | 4 | ===== Signature 5 | [f] 6 | 7 | ===== Description 8 | 9 | Returns true if `f` is a function, false otherwise. 10 | 11 | ===== Related 12 | cljs.core/ifn? 13 | -------------------------------------------------------------------------------- /docfiles/cljs.core_fnext.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/fnext 3 | 4 | ===== Signature 5 | [coll] 6 | 7 | ===== Description 8 | 9 | Same as `(first (next coll))` 10 | 11 | ===== Related 12 | cljs.core/ffirst 13 | cljs.core/second 14 | -------------------------------------------------------------------------------- /docfiles/cljs.core_fnil.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/fnil 3 | 4 | ===== Signature 5 | [f x] 6 | [f x y] 7 | [f x y z] 8 | 9 | ===== Description 10 | 11 | Takes a function `f`, and returns a function that calls `f`, replacing a nil 12 | first argument to `f` with the supplied value `x`. Higher arity versions can 13 | replace arguments in the second and third positions (`y`, `z`). 14 | 15 | Note that the function `f` can take any number of arguments, not just the one(s) 16 | being nil-patched. 17 | 18 | ===== Related 19 | -------------------------------------------------------------------------------- /docfiles/cljs.core_for.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/for 3 | 4 | ===== Type 5 | macro 6 | 7 | ===== Signature 8 | [seq-exprs body-expr] 9 | 10 | ===== Description 11 | 12 | List comprehension. 13 | 14 | Takes a vector of one or more binding-form/collection-expr pairs, each followed 15 | by zero or more modifiers, and yields a lazy sequence of evaluations of expr. 16 | 17 | Collections are iterated in a nested fashion, rightmost fastest, and nested 18 | coll-exprs can refer to bindings created in prior binding-forms. Supported 19 | modifiers are: `:let [binding-form expr ...]`, `:while test`, `:when test`. 20 | 21 | ===== Related 22 | cljs.core/doseq 23 | cljs.core/doall 24 | cljs.core/recur 25 | 26 | ===== TODO 27 | 28 | This description is completely unreadable to someone new to the 29 | language and confusing even to someone with moderate experience (ie: me) 30 | 31 | Need to simplify and provide an inline example. 32 | -------------------------------------------------------------------------------- /docfiles/cljs.core_frequencies.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/frequencies 3 | 4 | ===== Signature 5 | [coll] 6 | 7 | ===== Description 8 | 9 | Returns a map from distinct items in `coll` to the number of times they appear. 10 | 11 | `(frequencies [:a :a :b])` => `{:a 2, :b 1}` 12 | 13 | ===== Related 14 | cljs.core/group-by 15 | cljs.core/distinct 16 | -------------------------------------------------------------------------------- /docfiles/cljs.core_get-in.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/get-in 3 | 4 | ===== Signature 5 | [m ks] 6 | [m ks not-found] 7 | 8 | ===== Description 9 | 10 | Returns the value in a nested associative structure, where `ks` is a sequence of 11 | keys. 12 | 13 | Returns nil if the key is not found, or `not-found` if supplied. 14 | 15 | ===== Related 16 | cljs.core/assoc-in 17 | cljs.core/update-in 18 | cljs.core/find 19 | cljs.core/get 20 | -------------------------------------------------------------------------------- /docfiles/cljs.core_get-validator.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/get-validator 3 | 4 | ===== Signature 5 | [a] 6 | 7 | ===== Description 8 | 9 | Returns the validator function for atom `a`. 10 | 11 | ===== Related 12 | cljs.core/atom 13 | cljs.core/set-validator! 14 | -------------------------------------------------------------------------------- /docfiles/cljs.core_get.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/get 3 | 4 | ===== Signature 5 | [o k] 6 | [o k not-found] 7 | 8 | ===== Description 9 | 10 | Returns the value mapped to key `k`. 11 | 12 | Returns `not-found` or nil if `k` is not present in `o`. 13 | 14 | ===== Related 15 | cljs.core/get-in 16 | -------------------------------------------------------------------------------- /docfiles/cljs.core_group-by.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/group-by 3 | 4 | ===== Signature 5 | [f coll] 6 | 7 | ===== Description 8 | 9 | Returns a map of the elements of `coll` keyed by the result of running `f` on 10 | each element. 11 | 12 | The value at each key will be a vector of the corresponding elements in the 13 | order they appeared in `coll`. 14 | 15 | ===== Related 16 | cljs.core/partition-by 17 | cljs.core/frequencies 18 | -------------------------------------------------------------------------------- /docfiles/cljs.core_hash-map.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/hash-map 3 | 4 | ===== Signature 5 | [& keyvals] 6 | 7 | ===== Description 8 | 9 | Returns a new hash map with supplied mappings. 10 | 11 | `keyvals` must be an even number of forms. 12 | 13 | ===== Related 14 | cljs.core/array-map 15 | cljs.core/sorted-map 16 | -------------------------------------------------------------------------------- /docfiles/cljs.core_hash-set.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/hash-set 3 | 4 | ===== Signature 5 | [] 6 | [& keys] 7 | 8 | ===== Description 9 | 10 | Returns a new hash set with supplied `keys`. 11 | 12 | Any equal keys are handled as if by repeated uses of `conj`. 13 | 14 | ===== Related 15 | cljs.core/set 16 | cljs.core/sorted-set 17 | -------------------------------------------------------------------------------- /docfiles/cljs.core_identicalQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/identical? 3 | 4 | ===== Signature 5 | [x y] 6 | 7 | ===== Return Type 8 | boolean 9 | 10 | ===== Description 11 | 12 | Returns true if `x` and `y` are the same object, false otherwise. 13 | 14 | ===== Related 15 | cljs.core/= 16 | cljs.core/== 17 | -------------------------------------------------------------------------------- /docfiles/cljs.core_identity.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/identity 3 | 4 | ===== Signature 5 | [x] 6 | 7 | ===== Description 8 | 9 | Returns its argument. 10 | 11 | ===== Related 12 | cljs.core/nil? 13 | -------------------------------------------------------------------------------- /docfiles/cljs.core_if-let.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/if-let 3 | 4 | ===== Type 5 | macro 6 | 7 | ===== Signature 8 | [[x test] then] 9 | [[x test] then else] 10 | 11 | ===== Description 12 | 13 | When `test` is logical true, evaluates `then` with the value of `test` bound to 14 | `x`. Otherwise, evaluates `else` with no bindings. 15 | 16 | `else` defaults to nil. 17 | 18 | ===== Related 19 | cljs.core/when-let 20 | cljs.core/if 21 | -------------------------------------------------------------------------------- /docfiles/cljs.core_if-not.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/if-not 3 | 4 | ===== Type 5 | macro 6 | 7 | ===== Signature 8 | [test then] 9 | [test then else] 10 | 11 | ===== Description 12 | 13 | If `test` is false or nil, evaluates and returns `then`. Otherwise, evaluates 14 | and returns `else`. `else` defaults to nil if not provided. 15 | 16 | ===== Related 17 | cljs.core/if 18 | cljs.core/when-not 19 | -------------------------------------------------------------------------------- /docfiles/cljs.core_if-some.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/if-some 3 | 4 | ===== Type 5 | macro 6 | 7 | ===== Signature 8 | [[x test] then] 9 | [[x test] then else] 10 | 11 | ===== Description 12 | 13 | If `test` is not nil, evaluates `then` with `x` bound to the value of `test`. If 14 | not, yields `else`. 15 | 16 | ===== Related 17 | cljs.core/when-some 18 | -------------------------------------------------------------------------------- /docfiles/cljs.core_if.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/if 3 | 4 | ===== Type 5 | special form 6 | 7 | ===== Signature 8 | [test then else?] 9 | 10 | ===== Description 11 | 12 | If `test` is not false or nil, `then` is evaluated and returned. Otherwise, 13 | `else?` is evaluated and returned. `else?` defaults to nil if not provided. 14 | 15 | `if` is one of ClojureScript's [special forms](http://clojure.org/special_forms) 16 | and is a fundamental building block of the language. All other conditionals in 17 | ClojureScript are based on `if`s notion of truthiness (ie: anything other than 18 | false or nil). 19 | 20 | ===== Related 21 | cljs.core/cond 22 | cljs.core/when 23 | cljs.core/if-let 24 | cljs.core/if-not 25 | -------------------------------------------------------------------------------- /docfiles/cljs.core_ifnQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/ifn? 3 | 4 | ===== Signature 5 | [f] 6 | 7 | ===== Description 8 | 9 | Returns true if `f` implements the `IFn` protocol, false otherwise. 10 | 11 | Functions, keywords, map, sets, and vectors can be called as functions. 12 | 13 | ===== Related 14 | cljs.core/fn? 15 | -------------------------------------------------------------------------------- /docfiles/cljs.core_inc.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/inc 3 | 4 | ===== Signature 5 | [x] 6 | 7 | ===== Description 8 | 9 | Returns a number one greater than `x`. 10 | 11 | ===== Related 12 | cljs.core/dec 13 | -------------------------------------------------------------------------------- /docfiles/cljs.core_instanceQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/instance? 3 | 4 | ===== Signature 5 | [t o] 6 | 7 | ===== Description 8 | 9 | Returns true if `o` is an instance of type `t`, false otherwise. 10 | 11 | ===== Related 12 | cljs.core/type 13 | -------------------------------------------------------------------------------- /docfiles/cljs.core_int.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/int 3 | 4 | ===== Signature 5 | [x] 6 | 7 | ===== Description 8 | 9 | Coerces `x` to an integer by stripping decimal places. 10 | 11 | ===== Related 12 | cljs.core/char 13 | cljs.core/integer? 14 | -------------------------------------------------------------------------------- /docfiles/cljs.core_integerQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/integer? 3 | 4 | ===== Signature 5 | [n] 6 | 7 | ===== Description 8 | 9 | Returns true if `n` is an integer, false otherwise. 10 | 11 | ===== Related 12 | cljs.core/int 13 | -------------------------------------------------------------------------------- /docfiles/cljs.core_interleave.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/interleave 3 | 4 | ===== Signature 5 | [c1 c2] 6 | [c1 c2 & colls] 7 | 8 | ===== Description 9 | 10 | Returns a lazy seq of the first item in each collection, then the second items, 11 | then the third, etc. 12 | 13 | ===== Related 14 | cljs.core/interpose 15 | cljs.core/zipmap 16 | -------------------------------------------------------------------------------- /docfiles/cljs.core_interpose.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/interpose 3 | 4 | ===== Signature 5 | [sep coll] 6 | 7 | ===== Description 8 | 9 | Returns a lazy seq of the elements of `coll` separated by `sep`. 10 | 11 | ===== Related 12 | cljs.core/interleave 13 | clojure.string/join 14 | -------------------------------------------------------------------------------- /docfiles/cljs.core_into-array.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/into-array 3 | 4 | ===== Signature 5 | [aseq] 6 | 7 | ===== Description 8 | 9 | Returns a new JavaScript array from the elements of `aseq`. 10 | 11 | ===== Related 12 | cljs.core/to-array 13 | cljs.core/make-array 14 | -------------------------------------------------------------------------------- /docfiles/cljs.core_into.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/into 3 | 4 | ===== Signature 5 | [to from] 6 | [to xform from] 7 | 8 | ===== Description 9 | 10 | Returns a new collection consisting of `to` with all of the items of `from` 11 | "added" using `conj`. 12 | 13 | A transducer may be supplied as `xform`. 14 | 15 | ===== Related 16 | cljs.core/conj 17 | -------------------------------------------------------------------------------- /docfiles/cljs.core_iterate.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/iterate 3 | 4 | ===== Signature 5 | [f x] 6 | 7 | ===== Description 8 | 9 | Returns a lazy sequence of `x`, `(f x)`, `(f (f x))` etc. 10 | 11 | `f` must be free of side-effects. 12 | 13 | ===== Related 14 | cljs.core/cycle 15 | cljs.core/repeatedly 16 | cljs.core/repeat 17 | -------------------------------------------------------------------------------- /docfiles/cljs.core_js-GTclj.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/js->clj 3 | 4 | ===== Signature 5 | [x] 6 | [x & opts] 7 | 8 | ===== Description 9 | 10 | Recursively transforms JavaScript arrays into ClojureScript vectors, and 11 | JavaScript objects into ClojureScript maps. 12 | 13 | Pass options `:keywordize-keys true` to recursively convert object property 14 | names from strings to keywords. 15 | 16 | `(js->clj js-data :keywordize-keys true)` 17 | 18 | Note that `js->clj` is not optimized for speed and the [transit.cljs] library is 19 | recommended when parsing large amounts of JSON data. 20 | 21 | [transit.cljs]:http://swannodette.github.io/2014/07/26/transit-clojurescript 22 | 23 | ===== Related 24 | cljs.core/clj->js 25 | -------------------------------------------------------------------------------- /docfiles/cljs.core_js-delete.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/js-delete 3 | 4 | ===== Signature 5 | [obj key] 6 | 7 | ===== Description 8 | 9 | Deletes property `key` in JavaScript object `obj`. 10 | 11 | Uses the JavaScript `delete` operator. 12 | 13 | ===== Related 14 | cljs.core/dissoc 15 | -------------------------------------------------------------------------------- /docfiles/cljs.core_js-obj.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/js-obj 3 | 4 | ===== Signature 5 | [& keyvals] 6 | 7 | ===== Description 8 | 9 | Returns a new JavaScript object using the supplied mappings. 10 | 11 | `keyvals` must be an even number of forms. 12 | 13 | ===== Related 14 | cljs.core/array 15 | -------------------------------------------------------------------------------- /docfiles/cljs.core_juxt.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/juxt 3 | 4 | ===== Signature 5 | [f] 6 | [f g] 7 | [f g h] 8 | [f g h & fs] 9 | 10 | ===== Description 11 | 12 | Takes a set of functions and returns a function that is the juxtaposition of 13 | those functions. 14 | 15 | The returned function takes a variable number of arguments, and returns a vector 16 | containing the result of applying each function to the arguments (left-to- 17 | right). 18 | 19 | `((juxt a b c) x)` => `[(a x) (b x) (c x)]` 20 | 21 | ===== Related 22 | cljs.core/partial 23 | cljs.core/comp 24 | -------------------------------------------------------------------------------- /docfiles/cljs.core_keep-indexed.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/keep-indexed 3 | 4 | ===== Signature 5 | [f] 6 | [f coll] 7 | 8 | ===== Description 9 | 10 | Returns a lazy sequence of the non-nil results of `(f index item)`. Note, this 11 | means false return values will be included. 12 | 13 | `f` must be free of side-effects. 14 | 15 | Returns a stateful transducer when no collection is provided. 16 | 17 | ===== Related 18 | cljs.core/map-indexed 19 | cljs.core/keep 20 | -------------------------------------------------------------------------------- /docfiles/cljs.core_keep.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/keep 3 | 4 | ===== Signature 5 | [f] 6 | [f coll] 7 | 8 | ===== Description 9 | 10 | Returns a lazy sequence of the non-nil results of `(f item)`. Note, this means 11 | false return values will be included. 12 | 13 | `f` must be free of side-effects. 14 | 15 | Returns a transducer when no collection is provided. 16 | 17 | ===== Related 18 | cljs.core/keep-indexed 19 | cljs.core/map 20 | cljs.core/filter 21 | -------------------------------------------------------------------------------- /docfiles/cljs.core_key.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/key 3 | 4 | ===== Signature 5 | [map-entry] 6 | 7 | ===== Description 8 | 9 | Returns the key of the map entry. 10 | 11 | ===== Related 12 | cljs.core/keys 13 | -------------------------------------------------------------------------------- /docfiles/cljs.core_keys.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/keys 3 | 4 | ===== Signature 5 | [hash-map] 6 | 7 | ===== Description 8 | 9 | Returns a sequence of the keys in `hash-map`. 10 | 11 | ===== Related 12 | cljs.core/vals 13 | -------------------------------------------------------------------------------- /docfiles/cljs.core_last.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/last 3 | 4 | ===== Signature 5 | [coll] 6 | 7 | ===== Description 8 | 9 | Returns the last item in `coll` in linear time. 10 | 11 | `peek` is much faster than `last` for a vector. 12 | 13 | ===== Related 14 | cljs.core/first 15 | cljs.core/next 16 | cljs.core/rest 17 | cljs.core/butlast 18 | cljs.core/take-last 19 | -------------------------------------------------------------------------------- /docfiles/cljs.core_lazy-cat.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/lazy-cat 3 | 4 | ===== Type 5 | macro 6 | 7 | ===== Signature 8 | [& colls] 9 | 10 | ===== Description 11 | 12 | Expands to code which yields a lazy sequence of the concatenation of the 13 | supplied collections. Each collections expression is not evaluated until it is 14 | needed. 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
CodeExpands To
(lazy-cat x y z) 24 |
25 | (concat (lazy-seq x)
26 |         (lazy-seq y)
27 |         (lazy-seq z))
28 | 29 | ===== Related 30 | cljs.core/lazy-seq 31 | cljs.core/concat 32 | -------------------------------------------------------------------------------- /docfiles/cljs.core_lazy-seq.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/lazy-seq 3 | 4 | ===== Signature 5 | [& body] 6 | 7 | ===== Description 8 | 9 | Returns a new lazy sequence. 10 | 11 | ===== Related 12 | cljs.core/lazy-cat 13 | cljs.core/realized? 14 | cljs.core/doall 15 | cljs.core/iterate 16 | -------------------------------------------------------------------------------- /docfiles/cljs.core_let.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/let 3 | 4 | ===== Type 5 | special form 6 | 7 | ===== Signature 8 | [bindings & body] 9 | 10 | ===== Description 11 | 12 | Binds expressions to symbols and makes those symbols available only within 13 | `body`. 14 | 15 | `bindings` should be a vector with an even number of forms, ie: `[a1 b1, a2 b2, 16 | a3 b3]`. The first item in a pair (the `a`s) should be a symbol that is assigned 17 | the evaluation of the second item (the `b`s). These symbols (the `a`s) are then 18 | available within `body` (and not outside of `body`). 19 | 20 | Another way to think about this is that the binding symbols in `let` are like 21 | local `def`s that are only available within `let`'s scope. 22 | 23 | In addition to direct symbol binding, `let` supports a destructuring syntax to 24 | "break apart" collections into multiple symbols. This destructuring syntax is 25 | like it's own [mini-language] and allows for succinct code. 26 | 27 | `let` is one of ClojureScript's [special forms] and is a fundamental building 28 | block of the language. Many macros rely on `let`s binding syntax and scope 29 | rules. 30 | 31 | [mini-language]:http://blog.jayfields.com/2010/07/clojure-destructuring.html 32 | [special forms]:http://clojure.org/special_forms 33 | 34 | ===== Related 35 | cljs.core/letfn 36 | cljs.core/if-let 37 | -------------------------------------------------------------------------------- /docfiles/cljs.core_letfn.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/letfn 3 | 4 | ===== Type 5 | special form 6 | 7 | ===== Signature 8 | [fnspecs & body] 9 | 10 | ===== Description 11 | 12 | Takes a vector of function definitions `fnspecs` and binds the functions to 13 | their names. All of the names are available in all of the definitions of the 14 | functions as well as `body`. 15 | 16 | `fnspecs` must be a vector with an even number of forms. See `let`. 17 | 18 | `letfn` is one of ClojureScript's [special forms]. 19 | 20 | [special forms]:http://clojure.org/special_forms 21 | 22 | ===== Related 23 | cljs.core/let 24 | -------------------------------------------------------------------------------- /docfiles/cljs.core_list.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/list 3 | 4 | ===== Signature 5 | [& items] 6 | 7 | ===== Description 8 | 9 | Creates a new list containing `items`. 10 | 11 | ===== Related 12 | cljs.core/vector 13 | cljs.core/list? 14 | -------------------------------------------------------------------------------- /docfiles/cljs.core_listQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/list? 3 | 4 | ===== Signature 5 | [x] 6 | 7 | ===== Description 8 | 9 | Returns true if `x` is a list, false otherwise. 10 | 11 | ===== Related 12 | cljs.core/seq? 13 | cljs.core/sequential? 14 | cljs.core/coll? 15 | -------------------------------------------------------------------------------- /docfiles/cljs.core_listSTAR.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/list* 3 | 4 | ===== Signature 5 | [args] 6 | [a args] 7 | [a b args] 8 | [a b c args] 9 | [a b c d & more] 10 | 11 | ===== Description 12 | 13 | Creates a new list containing the items prepended to the rest, the last of which 14 | will be treated as a sequence. 15 | 16 | ===== Related 17 | cljs.core/list 18 | -------------------------------------------------------------------------------- /docfiles/cljs.core_make-array.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/make-array 3 | 4 | ===== Signature 5 | [size] 6 | 7 | ===== Description 8 | 9 | Creates an empty JavaScript array of size `size`. 10 | 11 | ===== Related 12 | cljs.core/aclone 13 | cljs.core/array 14 | -------------------------------------------------------------------------------- /docfiles/cljs.core_map-indexed.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/map-indexed 3 | 4 | ===== Signature 5 | [f coll] 6 | 7 | ===== Description 8 | 9 | Returns a lazy sequence consisting of the result of applying `f` to 0 and the 10 | first item of `coll`, followed by applying `f` to 1 and the second item in 11 | `coll`, etc, until `coll` is exhausted. 12 | 13 | Function `f` should accept 2 arguments, index and item. 14 | 15 | ===== Related 16 | cljs.core/map 17 | cljs.core/keep-indexed 18 | -------------------------------------------------------------------------------- /docfiles/cljs.core_map.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/map 3 | 4 | ===== Signature 5 | [f] 6 | [f coll] 7 | [f c1 c2] 8 | [f c1 c2 c3] 9 | [f c1 c2 c3 & colls] 10 | 11 | ===== Description 12 | 13 | Returns a lazy sequence of applying function `f` to every element of `coll`. 14 | 15 | When more than one collection is provided, returns a lazy sequence consisting of 16 | the result of applying `f` to the set of first items of each `c`, followed by 17 | applying `f` to the set of second items in each `c`, until any one of the `c`s 18 | is exhausted. Any remaining items in other `c`s are ignored. Function `f` should 19 | accept number-of-`c`s arguments. 20 | 21 | Returns a transducer when no collection is provided. 22 | 23 | ===== Related 24 | cljs.core/map-indexed 25 | cljs.core/pmap 26 | cljs.core/amap 27 | cljs.core/mapcat 28 | cljs.core/keep 29 | cljs.core/juxt 30 | -------------------------------------------------------------------------------- /docfiles/cljs.core_mapQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/map? 3 | 4 | ===== Signature 5 | [x] 6 | 7 | ===== Description 8 | 9 | Returns true if `x` is a map, false otherwise. 10 | 11 | ===== Related 12 | cljs.core/hash-map 13 | cljs.core/sorted-map 14 | -------------------------------------------------------------------------------- /docfiles/cljs.core_mapcat.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/mapcat 3 | 4 | ===== Signature 5 | [f] 6 | [f & colls] 7 | 8 | ===== Description 9 | 10 | Returns the result of applying `concat` to the result of applying `map` to `f` 11 | and `colls`. 12 | 13 | Function `f` should return a collection. 14 | 15 | Returns a transducer when no collections are provided. 16 | 17 | ===== Related 18 | cljs.core/map 19 | cljs.core/concat 20 | -------------------------------------------------------------------------------- /docfiles/cljs.core_mapv.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/mapv 3 | 4 | ===== Signature 5 | [f coll] 6 | [f c1 c2] 7 | [f c1 c2 c3] 8 | [f c1 c2 c3 & colls] 9 | 10 | ===== Description 11 | 12 | Returns a vector consisting of the result of applying `f` to the set of first 13 | items of each coll, followed by applying `f` to the set of second items in each 14 | coll, until any one of the colls is exhausted. Any remaining items in other 15 | colls are ignored. 16 | 17 | Function `f` should accept number-of-colls arguments. 18 | 19 | ===== Related 20 | cljs.core/map 21 | -------------------------------------------------------------------------------- /docfiles/cljs.core_max-key.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/max-key 3 | 4 | ===== Signature 5 | [k x] 6 | [k x y] 7 | [k x y & more] 8 | 9 | ===== Description 10 | 11 | Returns the `x` for which `(k x)` is greatest. 12 | 13 | `(k x)` should return a number. 14 | 15 | ===== Related 16 | cljs.core/max 17 | cljs.core/min-key 18 | -------------------------------------------------------------------------------- /docfiles/cljs.core_max.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/max 3 | 4 | ===== Signature 5 | [x] 6 | [x y] 7 | [x y & more] 8 | 9 | ===== Description 10 | 11 | Returns the greatest number argument. 12 | 13 | ===== Related 14 | cljs.core/min 15 | cljs.core/max-key 16 | -------------------------------------------------------------------------------- /docfiles/cljs.core_memoize.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/memoize 3 | 4 | ===== Signature 5 | [f] 6 | 7 | ===== Description 8 | 9 | Returns a memoized version of a referentially transparent function. 10 | 11 | A memoized version of a function keeps a cache of the mappings from arguments to 12 | results in memory. When calls with the same arguments are repeated often, a 13 | memoized function has higher performance at the expense of higher memory usage. 14 | 15 | ===== Related 16 | -------------------------------------------------------------------------------- /docfiles/cljs.core_merge-with.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/merge-with 3 | 4 | ===== Signature 5 | [f & maps] 6 | 7 | ===== Description 8 | 9 | Returns a map that consists of the rest of the maps `conj`-ed onto the first. 10 | 11 | If a key occurs in more than one map, the mapping(s) from the latter (left-to- 12 | right) will be combined with the mapping in the result by calling `(f val-in- 13 | result val-in-latter)`. 14 | 15 | ===== Related 16 | cljs.core/merge 17 | -------------------------------------------------------------------------------- /docfiles/cljs.core_merge.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/merge 3 | 4 | ===== Signature 5 | [& maps] 6 | 7 | ===== Description 8 | 9 | Returns a map that consists of the rest of the maps `conj`-ed onto the first. 10 | 11 | If a key occurs in more than one map, the mapping from the rightmost map will 12 | "win". 13 | 14 | ===== Related 15 | cljs.core/merge-with 16 | cljs.core/hash-map 17 | -------------------------------------------------------------------------------- /docfiles/cljs.core_min-key.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/min-key 3 | 4 | ===== Signature 5 | [k x] 6 | [k x y] 7 | [k x y & more] 8 | 9 | ===== Description 10 | 11 | Returns the `x` for which `(k x)` is least. 12 | 13 | `(k x)` should return a number. 14 | 15 | ===== Related 16 | cljs.core/min 17 | cljs.core/max-key 18 | -------------------------------------------------------------------------------- /docfiles/cljs.core_min.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/min 3 | 4 | ===== Signature 5 | [x] 6 | [x y] 7 | [x y & more] 8 | 9 | ===== Description 10 | 11 | Returns the least number argument. 12 | 13 | ===== Related 14 | cljs.core/max 15 | cljs.core/min-key 16 | -------------------------------------------------------------------------------- /docfiles/cljs.core_mod.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/mod 3 | 4 | ===== Signature 5 | [n d] 6 | 7 | ===== Description 8 | 9 | Returns the modulus of dividing numerator `n` by denominator `d`. 10 | 11 | Returns `NaN` when `d` is 0 (divide by 0 error). 12 | 13 | Truncates toward negative infinity. 14 | 15 | ===== Related 16 | cljs.core/rem 17 | -------------------------------------------------------------------------------- /docfiles/cljs.core_name.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/name 3 | 4 | ===== Signature 5 | [x] 6 | 7 | ===== Description 8 | 9 | Returns a string value of a keyword, string, or symbol. 10 | 11 | `(name :foo)` => `"foo"` 12 | 13 | `(name "foo")` => `"foo"` 14 | 15 | `(name 'foo)` => `"foo"` 16 | 17 | ===== Related 18 | -------------------------------------------------------------------------------- /docfiles/cljs.core_negQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/neg? 3 | 4 | ===== Signature 5 | [n] 6 | 7 | ===== Description 8 | 9 | Returns true if `n` is less than 0, false otherwise. 10 | 11 | ===== Related 12 | cljs.core/pos? 13 | cljs.core/zero? 14 | -------------------------------------------------------------------------------- /docfiles/cljs.core_next.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/next 3 | 4 | ===== Signature 5 | [coll] 6 | 7 | ===== Description 8 | 9 | Returns a sequence of the items after the first and calls `seq` on its argument. 10 | 11 | Returns nil if `coll` is empty. 12 | 13 | ===== Related 14 | cljs.core/rest 15 | cljs.core/first 16 | cljs.core/fnext 17 | -------------------------------------------------------------------------------- /docfiles/cljs.core_nfirst.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/nfirst 3 | 4 | ===== Signature 5 | [coll] 6 | 7 | ===== Description 8 | 9 | Same as `(next (first coll))`. 10 | 11 | ===== Related 12 | cljs.core/next 13 | -------------------------------------------------------------------------------- /docfiles/cljs.core_nilQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/nil? 3 | 4 | ===== Signature 5 | [x] 6 | 7 | ===== Description 8 | 9 | Returns true if `x` is nil, false otherwise. 10 | 11 | ===== Related 12 | cljs.core/true? 13 | cljs.core/false? 14 | cljs.core/identity 15 | -------------------------------------------------------------------------------- /docfiles/cljs.core_nnext.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/nnext 3 | 4 | ===== Signature 5 | [coll] 6 | 7 | ===== Description 8 | 9 | Same as `(next (next coll))`. 10 | 11 | ===== Related 12 | cljs.core/next 13 | -------------------------------------------------------------------------------- /docfiles/cljs.core_not-anyQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/not-any? 3 | 4 | ===== Signature 5 | [pred coll] 6 | 7 | ===== Description 8 | 9 | Returns false if `(pred x)` is logical true for any `x` in `coll`, else true. 10 | 11 | ===== Related 12 | cljs.core/every? 13 | cljs.core/some 14 | -------------------------------------------------------------------------------- /docfiles/cljs.core_not-empty.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/not-empty 3 | 4 | ===== Signature 5 | [coll] 6 | 7 | ===== Description 8 | 9 | Returns nil if `coll` is empty, else returns `coll`. 10 | 11 | ===== Related 12 | cljs.core/empty 13 | -------------------------------------------------------------------------------- /docfiles/cljs.core_not-everyQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/not-every? 3 | 4 | ===== Signature 5 | [pred coll] 6 | 7 | ===== Description 8 | 9 | Returns false if `(pred x)` is logical true for every `x` in `coll`, else true. 10 | 11 | ===== Related 12 | cljs.core/every? 13 | cljs.core/not-any? 14 | cljs.core/some 15 | -------------------------------------------------------------------------------- /docfiles/cljs.core_not.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/not 3 | 4 | ===== Signature 5 | [x] 6 | 7 | ===== Return Type 8 | boolean 9 | 10 | ===== Description 11 | 12 | Returns true if `x` is logical false, false otherwise. 13 | 14 | ===== Related 15 | cljs.core/complement 16 | cljs.core/false? 17 | -------------------------------------------------------------------------------- /docfiles/cljs.core_not=.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/not= 3 | 4 | ===== Signature 5 | [x] 6 | [x y] 7 | [x y & more] 8 | 9 | ===== Description 10 | 11 | Returns the opposite of `=`. 12 | 13 | Same as `(not (= x y))` 14 | 15 | ===== Related 16 | cljs.core/= 17 | cljs.core/not 18 | -------------------------------------------------------------------------------- /docfiles/cljs.core_notEQ.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/not= 3 | 4 | ===== Signature 5 | [x] 6 | [x y] 7 | [x y & more] 8 | 9 | ===== Description 10 | 11 | Returns the opposite of `=`. 12 | 13 | Same as `(not (= x y))` 14 | 15 | ===== Related 16 | cljs.core/= 17 | cljs.core/not 18 | -------------------------------------------------------------------------------- /docfiles/cljs.core_ns.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/ns 3 | 4 | ===== Type 5 | special form 6 | 7 | ===== Signature 8 | [name & references] 9 | 10 | ===== Description 11 | 12 | Sets the namespace of the file. 13 | 14 | `ns` must be the first form in a `.cljs` file and there can only be one `ns` 15 | declaration per file. Namespaces must match the file name of their respective 16 | `.cljs` files, with the exception that dashes in namespaces become underscores 17 | in filenames. Thus, `(ns foo.bar-biz.baz)` should be the first form in file 18 | `foo/bar_biz/baz.cljs`. 19 | 20 | `references` can be zero or more forms used to import other namespaces, symbols, 21 | and libraries into the current namespace. 22 | 23 | ===== Related 24 | 25 | ===== TODO 26 | we need to write a comprehensive namespace tutorial and link to it here 27 | -------------------------------------------------------------------------------- /docfiles/cljs.core_nth.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/nth 3 | 4 | ===== Signature 5 | [coll n] 6 | [coll n not-found] 7 | 8 | ===== Description 9 | 10 | Returns the value at index `n` or `not-found` if the index is out of bounds. 11 | 12 | `nth` will throw an exception if `n` is out of bounds and `not-found` is not 13 | supplied. 14 | 15 | `nth` works for Strings, Arrays, Regex Matchers, Lists, and Sequences. For 16 | Sequences, `nth` takes O(n) time. 17 | 18 | ===== Related 19 | cljs.core/first 20 | cljs.core/second 21 | cljs.core/nthnext 22 | cljs.core/get 23 | -------------------------------------------------------------------------------- /docfiles/cljs.core_nthnext.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/nthnext 3 | 4 | ===== Signature 5 | [coll n] 6 | 7 | ===== Description 8 | 9 | Returns the `n`th `next` of `coll`. 10 | 11 | Returns `(seq coll)` when `n` is 0. 12 | 13 | ===== Related 14 | cljs.core/nth 15 | cljs.core/drop 16 | cljs.core/nthrest 17 | -------------------------------------------------------------------------------- /docfiles/cljs.core_nthrest.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/nthrest 3 | 4 | ===== Signature 5 | [coll n] 6 | 7 | ===== Description 8 | 9 | Returns the `nth` rest of `coll`. 10 | 11 | Returns `coll` when `n` is 0. 12 | 13 | ===== Related 14 | cljs.core/drop 15 | cljs.core/nthnext 16 | cljs.core/nth 17 | -------------------------------------------------------------------------------- /docfiles/cljs.core_numberQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/number? 3 | 4 | ===== Signature 5 | [n] 6 | 7 | ===== Description 8 | 9 | Returns true if `n` is a number, false otherwise. 10 | 11 | ===== Related 12 | cljs.core/integer? 13 | -------------------------------------------------------------------------------- /docfiles/cljs.core_objectQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/object? 3 | 4 | ===== Signature 5 | [x] 6 | 7 | ===== Description 8 | 9 | Returns true if `x` is a JavaScript object, false otherwise. 10 | 11 | ===== Related 12 | cljs.core/array? 13 | -------------------------------------------------------------------------------- /docfiles/cljs.core_oddQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/odd? 3 | 4 | ===== Signature 5 | [n] 6 | 7 | ===== Description 8 | 9 | Returns true if `n` is an odd number. 10 | 11 | Throws an exception if `n` is not an integer. 12 | 13 | ===== Related 14 | cljs.core/even? 15 | -------------------------------------------------------------------------------- /docfiles/cljs.core_or.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/or 3 | 4 | ===== Type 5 | macro 6 | 7 | ===== Signature 8 | [] 9 | [x] 10 | [x & next] 11 | 12 | ===== Description 13 | 14 | Evaluates arguments one at a time from left to right. If an argument returns 15 | logical true, `or` returns that value and doesn't evaluate any of the other 16 | arguments, otherwise it returns the value of the last argument. 17 | 18 | `(or)` returns nil. 19 | 20 | ===== Related 21 | cljs.core/and 22 | cljs.core/if 23 | 24 | ===== Example#d50433 25 | 26 | ``` 27 | (or) 28 | ;;=> nil 29 | 30 | (or false) 31 | ;;=> false 32 | 33 | (or true) 34 | ;;=> true 35 | 36 | (or true true) 37 | ;;=> true 38 | 39 | (or true false) 40 | ;;=> true 41 | 42 | (or false false) 43 | ;;=> false 44 | ``` 45 | 46 | ===== Example#62f291 47 | 48 | `nil` and `false` are the only falsy values and everything else is truthy: 49 | 50 | ``` 51 | (or "foo" "bar") 52 | ;;=> "bar" 53 | 54 | (or "foo" nil) 55 | ;;=> "foo" 56 | 57 | (or "foo" false) 58 | ;;=> "foo" 59 | 60 | (or nil "foo") 61 | ;;=> "foo" 62 | 63 | (or false "foo") 64 | ;;=> "foo" 65 | ``` 66 | -------------------------------------------------------------------------------- /docfiles/cljs.core_partial.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/partial 3 | 4 | ===== Signature 5 | [f] 6 | [f arg1] 7 | [f arg1 arg2] 8 | [f arg1 arg2 arg3] 9 | [f arg1 arg2 arg3 & more] 10 | 11 | ===== Description 12 | 13 | Takes a function `f` and fewer than the normal arguments to `f`. Returns a 14 | function that takes a variable number of additional arguments. When called, the 15 | returned function calls `f` with the original arguments plus the additional 16 | arguments. 17 | 18 | `((partial f a b) c d)` => `(f a b c d)` 19 | 20 | ===== Related 21 | cljs.core/comp 22 | cljs.core/juxt 23 | -------------------------------------------------------------------------------- /docfiles/cljs.core_partition-all.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/partition-all 3 | 4 | ===== Signature 5 | [n] 6 | [n coll] 7 | [n step coll] 8 | 9 | ===== Description 10 | 11 | Returns a lazy sequence of lists like `partition`, but may include partitions 12 | with fewer than `n` items at the end. 13 | 14 | Returns a stateful transducer when no collection is provided. 15 | 16 | ===== Related 17 | cljs.core/partition 18 | cljs.core/partition-by 19 | -------------------------------------------------------------------------------- /docfiles/cljs.core_partition-by.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/partition-by 3 | 4 | ===== Signature 5 | [f] 6 | [f coll] 7 | 8 | ===== Description 9 | 10 | Applies `f` to each value in `coll`, splitting it each time `f` returns a new 11 | value. Returns a lazy sequence of partitions. 12 | 13 | Returns a stateful transducer when no collection is provided. 14 | 15 | ===== Related 16 | cljs.core/partition 17 | cljs.core/partition-all 18 | cljs.core/group-by 19 | -------------------------------------------------------------------------------- /docfiles/cljs.core_partition.cljsdoc: -------------------------------------------------------------------------------- 1 | TODO: this really needs an example 2 | 3 | ===== Name 4 | cljs.core/partition 5 | 6 | ===== Signature 7 | [n coll] 8 | [n step coll] 9 | [n step pad coll] 10 | 11 | ===== Description 12 | 13 | Returns a lazy sequence of lists of `n` items each, at offsets `step` apart. 14 | 15 | If `step` is not supplied, defaults to `n`, i.e. the partitions do not overlap. 16 | 17 | If a `pad` collection is supplied, its elements will be used as necessary to 18 | complete the last partition up to `n` items. 19 | 20 | Returns a partition with less than `n` items if there are not enough padding 21 | elements. 22 | 23 | ===== Related 24 | cljs.core/partition-all 25 | cljs.core/split-at 26 | cljs.core/partition-by 27 | -------------------------------------------------------------------------------- /docfiles/cljs.core_peek.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/peek 3 | 4 | ===== Signature 5 | [coll] 6 | 7 | ===== Description 8 | 9 | Returns the first element of a list; same as `first`. 10 | 11 | Returns the last element of a vector, and much more efficient than using `last`. 12 | 13 | Returns nil if `coll` is empty. 14 | 15 | ===== Related 16 | cljs.core/first 17 | cljs.core/pop 18 | cljs.core/conj 19 | -------------------------------------------------------------------------------- /docfiles/cljs.core_pop.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/pop 3 | 4 | ===== Signature 5 | [coll] 6 | 7 | ===== Description 8 | 9 | For a list, returns a new list without the first item. 10 | 11 | For a vector, returns a new vector without the last item. 12 | 13 | ===== Related 14 | cljs.core/peek 15 | cljs.core/rest 16 | cljs.core/conj 17 | -------------------------------------------------------------------------------- /docfiles/cljs.core_posQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/pos? 3 | 4 | ===== Signature 5 | [n] 6 | 7 | ===== Description 8 | 9 | Returns true if `n` is greater than 0, false otherwise. 10 | 11 | ===== Related 12 | cljs.core/neg? 13 | cljs.core/zero? 14 | -------------------------------------------------------------------------------- /docfiles/cljs.core_prim-seq.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/prim-seq 3 | 4 | ===== Signature 5 | [array] 6 | [array i] 7 | 8 | ===== Description 9 | 10 | Creates a `seq` from a JavaScript array or array-like object. 11 | 12 | ===== Related 13 | cljs.core/array-seq 14 | -------------------------------------------------------------------------------- /docfiles/cljs.core_quot.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/quot 3 | 4 | ===== Signature 5 | [n d] 6 | 7 | ===== Description 8 | 9 | Returns the quotient of dividing numerator `n` by denominator `d`. 10 | 11 | Returns `NaN` when `d` is 0 (divide by 0 error). 12 | 13 | ===== Related 14 | cljs.core/rem 15 | cljs.core/mod 16 | -------------------------------------------------------------------------------- /docfiles/cljs.core_rand-int.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/rand-int 3 | 4 | ===== Signature 5 | [n] 6 | 7 | ===== Description 8 | 9 | Returns a random integer between 0 inclusive and `n` exclusive. 10 | 11 | ===== Related 12 | cljs.core/rand 13 | -------------------------------------------------------------------------------- /docfiles/cljs.core_rand-nth.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/rand-nth 3 | 4 | ===== Signature 5 | [coll] 6 | 7 | ===== Description 8 | 9 | Returns a random element from a sequential collection `coll`. 10 | 11 | Has the same performance characteristics as `nth`. 12 | 13 | ===== Related 14 | cljs.core/rand 15 | -------------------------------------------------------------------------------- /docfiles/cljs.core_rand.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/rand 3 | 4 | ===== Signature 5 | [] 6 | [n] 7 | 8 | ===== Description 9 | 10 | Returns a random floating point number between 0 inclusive and `n` exclusive. 11 | 12 | `n` defaults to 1. 13 | 14 | ===== Related 15 | cljs.core/rand-int 16 | cljs.core/rand-nth 17 | -------------------------------------------------------------------------------- /docfiles/cljs.core_range.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/range 3 | 4 | ===== Signature 5 | [] 6 | [end] 7 | [start end] 8 | [start end step] 9 | 10 | ===== Description 11 | 12 | Returns a lazy sequence of nums from `start` (inclusive) to `end` (exclusive), 13 | by `step`, where `start` defaults to 0, `step` to 1, and `end` to infinity. 14 | 15 | ===== Related 16 | cljs.core/repeat 17 | -------------------------------------------------------------------------------- /docfiles/cljs.core_re-find.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/re-find 3 | 4 | ===== Signature 5 | [re s] 6 | 7 | ===== Description 8 | 9 | Returns the first regex match, if any, of `s` to `re`, using `re.exec(s)`. 10 | 11 | Returns a vector, containing first the matching substring, then any capturing 12 | groups if the regular expression contains capturing groups. 13 | 14 | ===== Related 15 | -------------------------------------------------------------------------------- /docfiles/cljs.core_re-matches.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/re-matches 3 | 4 | ===== Signature 5 | [re s] 6 | 7 | ===== Description 8 | 9 | Returns the result of `(re-find re s)` if `re` fully matches `s`. 10 | 11 | ===== Related 12 | -------------------------------------------------------------------------------- /docfiles/cljs.core_re-pattern.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/re-pattern 3 | 4 | ===== Signature 5 | [s] 6 | 7 | ===== Description 8 | 9 | Returns an instance of RegExp which has compiled the provided string. 10 | 11 | ===== Related 12 | -------------------------------------------------------------------------------- /docfiles/cljs.core_re-seq.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/re-seq 3 | 4 | ===== Signature 5 | [re s] 6 | 7 | ===== Description 8 | 9 | Returns a lazy sequence of successive matches of regex `re` in string `s`. 10 | 11 | ===== Related 12 | cljs.core/re-find 13 | cljs.core/re-groups 14 | cljs.core/re-pattern 15 | cljs.core/re-matcher 16 | cljs.core/re-matches 17 | cljs.core/subs 18 | clojure.string/split 19 | -------------------------------------------------------------------------------- /docfiles/cljs.core_realizedQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/realized? 3 | 4 | ===== Signature 5 | [x] 6 | 7 | ===== Description 8 | 9 | Returns true if a value has been produced for a lazy sequence. 10 | 11 | ===== Related 12 | cljs.core/lazy-seq 13 | -------------------------------------------------------------------------------- /docfiles/cljs.core_reduce-kv.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/reduce-kv 3 | 4 | ===== Signature 5 | [f init coll] 6 | 7 | ===== Description 8 | 9 | Reduces an associative collection. 10 | 11 | `f` should be a function of 3 arguments. Returns the result of applying `f` to 12 | `init`, the first key and the first value in `coll`, then applying `f` to that 13 | result and the 2nd key and value, etc. 14 | 15 | If `coll` contains no entries, returns `init` and `f` is not called. 16 | 17 | Note that `reduce-kv` is supported on vectors, where the keys will be the 18 | ordinals. 19 | 20 | ===== Related 21 | cljs.core/reduce 22 | -------------------------------------------------------------------------------- /docfiles/cljs.core_reduce.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/reduce 3 | 4 | ===== Signature 5 | [f coll] 6 | [f val coll] 7 | 8 | ===== Description 9 | 10 | `f` should be a function of 2 arguments. If `val` is not supplied, returns the 11 | result of applying `f` to the first 2 items in `coll`, then applying `f` to that 12 | result and the 3rd item, etc. 13 | 14 | If `coll` contains no items, `f` must accept no arguments as well, and `reduce` 15 | returns the result of calling `f` with no arguments. 16 | 17 | If `coll` has only 1 item, it is returned and `f` is not called. 18 | 19 | If `val` is supplied, returns the result of applying `f` to `val` and the first 20 | item in `coll`, then applying `f` to that result and the 2nd item, etc. 21 | 22 | If `coll` contains no items, returns `val` and `f` is not called. 23 | 24 | ===== Related 25 | cljs.core/reductions 26 | cljs.core/apply 27 | cljs.core/frequencies 28 | -------------------------------------------------------------------------------- /docfiles/cljs.core_reductions.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/reductions 3 | 4 | ===== Signature 5 | [f coll] 6 | [f init coll] 7 | 8 | ===== Description 9 | 10 | Returns a lazy sequence of the intermediate values of the reduction (as per 11 | `reduce`) of `coll` by `f`, starting with `init`. 12 | 13 | ===== Related 14 | cljs.core/reduce 15 | -------------------------------------------------------------------------------- /docfiles/cljs.core_rem.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/rem 3 | 4 | ===== Signature 5 | [n d] 6 | 7 | ===== Description 8 | 9 | Returns the remainder of dividing numerator `n` by denominator `d`. 10 | 11 | Returns `NaN` when `d` is 0 (divide by 0 error). 12 | 13 | ===== Related 14 | cljs.core/quot 15 | cljs.core/mod 16 | -------------------------------------------------------------------------------- /docfiles/cljs.core_remove-watch.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/remove-watch 3 | 4 | ===== Signature 5 | [a key] 6 | 7 | ===== Description 8 | 9 | Removes a watch function identified by `key` from atom `a`. The function must 10 | have originally been set by `add-watch`. 11 | 12 | ===== Related 13 | cljs.core/add-watch 14 | 15 | ===== Example#70044a 16 | 17 | ``` 18 | (def a (atom {})) 19 | 20 | (add-watch a :logger 21 | (fn [_key _atom old-state new-state] 22 | (println "old:" old-state) 23 | (println "new:" new-state))) 24 | 25 | (swap! a assoc :foo "bar") 26 | ;;=> will print the following: 27 | ;; old: {} 28 | ;; new: {:foo "bar"} 29 | 30 | (remove-watch a :logger) 31 | 32 | (swap! a assoc :foo 3) 33 | ;;=> nothing will be printed... 34 | ``` 35 | -------------------------------------------------------------------------------- /docfiles/cljs.core_remove.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/remove 3 | 4 | ===== Signature 5 | [pred] 6 | [pred coll] 7 | 8 | ===== Description 9 | 10 | Returns a lazy sequence of the items in `coll` for which `(pred item)` returns 11 | false. 12 | 13 | `pred` must be free of side-effects. 14 | 15 | Returns a transducer when no collection is provided. 16 | 17 | ===== Related 18 | cljs.core/filter 19 | -------------------------------------------------------------------------------- /docfiles/cljs.core_repeat.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/repeat 3 | 4 | ===== Signature 5 | [x] 6 | [n x] 7 | 8 | ===== Description 9 | 10 | Returns a lazy sequence of `x`s. 11 | 12 | The length of the sequence is infinite, or `n` if provided. 13 | 14 | ===== Related 15 | cljs.core/repeatedly 16 | cljs.core/cycle 17 | cljs.core/constantly 18 | cljs.core/dotimes 19 | -------------------------------------------------------------------------------- /docfiles/cljs.core_repeatedly.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/repeatedly 3 | 4 | ===== Signature 5 | [f] 6 | [n f] 7 | 8 | ===== Description 9 | 10 | Takes a function `f` of no args, presumably with side effects, and returns an 11 | infinite (or length `n` if supplied) lazy sequence of calls to it. 12 | 13 | ===== Related 14 | cljs.core/repeat 15 | cljs.core/iterate 16 | cljs.core/lazy-seq 17 | cljs.core/dotimes 18 | cljs.core/constantly 19 | -------------------------------------------------------------------------------- /docfiles/cljs.core_replace.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/replace 3 | 4 | ===== Signature 5 | [smap] 6 | [smap coll] 7 | 8 | ===== Description 9 | 10 | Given a map of replacement pairs `smap` and a vector/collection `coll`, returns 11 | a vector/seq with any elements `=` to a key in `smap` replaced with the 12 | corresponding val in `smap`. 13 | 14 | Returns a transducer when `coll` is not provided. 15 | 16 | ===== Related 17 | cljs.core/map 18 | clojure.walk/prewalk-replace 19 | clojure.walk/postwalk-replace 20 | -------------------------------------------------------------------------------- /docfiles/cljs.core_resetBANG.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/reset! 3 | 4 | ===== Signature 5 | [a new-value] 6 | 7 | ===== Description 8 | 9 | Sets the value of atom `a` to `new-value` without regard for the current value. 10 | 11 | Returns `new-value`. 12 | 13 | ===== Related 14 | cljs.core/swap! 15 | cljs.core/compare-and-set! 16 | cljs.core/atom 17 | -------------------------------------------------------------------------------- /docfiles/cljs.core_rest.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/rest 3 | 4 | ===== Signature 5 | [coll] 6 | 7 | ===== Description 8 | 9 | Returns a possibly empty sequence of the items after the first item. 10 | 11 | Calls `seq` on its argument. 12 | 13 | ===== Related 14 | cljs.core/next 15 | cljs.core/first 16 | cljs.core/drop 17 | cljs.core/pop 18 | -------------------------------------------------------------------------------- /docfiles/cljs.core_reverse.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/reverse 3 | 4 | ===== Signature 5 | [coll] 6 | 7 | ===== Description 8 | 9 | Returns a sequence of the items in `coll` in reverse order. Not lazy. 10 | 11 | ===== Related 12 | cljs.core/rseq 13 | -------------------------------------------------------------------------------- /docfiles/cljs.core_reversibleQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/reversible? 3 | 4 | ===== Signature 5 | [coll] 6 | 7 | ===== Description 8 | 9 | Returns true if `coll` implements the `IReversible` protocol, false otherwise. 10 | 11 | Vectors, sorted maps, and sorted sets implement `IReversible`. 12 | 13 | ===== Related 14 | -------------------------------------------------------------------------------- /docfiles/cljs.core_rseq.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/rseq 3 | 4 | ===== Signature 5 | [coll] 6 | 7 | ===== Description 8 | 9 | Returns a sequence of the items in `coll` in reverse order in constant time. 10 | 11 | Returns nil if `coll` is empty. 12 | 13 | `coll` must be a vector or a sorted-map. 14 | 15 | ===== Related 16 | cljs.core/reverse 17 | -------------------------------------------------------------------------------- /docfiles/cljs.core_rsubseq.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/rsubseq 3 | 4 | ===== Signature 5 | [sc test key] 6 | [sc start-test start-key end-test end-key] 7 | 8 | ===== Description 9 | 10 | `sc` must be a sorted collection. 11 | 12 | `test`, `start-test`, `end-test` must be `<`, `<=`, `>` or `>=`. 13 | 14 | Returns a reverse sequence of those entries with keys `ek` for which 15 | `(test (.. sc comparator (compare ek key)) 0)` is true. 16 | 17 | ===== Related 18 | cljs.core/subseq 19 | -------------------------------------------------------------------------------- /docfiles/cljs.core_second.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/second 3 | 4 | ===== Signature 5 | [coll] 6 | 7 | ===== Description 8 | 9 | Returns the second item in `coll`. 10 | 11 | Same as `(first (next coll))` 12 | 13 | ===== Related 14 | cljs.core/first 15 | cljs.core/nth 16 | cljs.core/fnext 17 | cljs.core/next 18 | -------------------------------------------------------------------------------- /docfiles/cljs.core_select-keys.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/select-keys 3 | 4 | ===== Signature 5 | [map keys] 6 | 7 | ===== Description 8 | 9 | Returns a map containing only those entries in `map` whose key is in `keys`. 10 | 11 | ===== Related 12 | -------------------------------------------------------------------------------- /docfiles/cljs.core_seq.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/seq 3 | 4 | ===== Signature 5 | [coll] 6 | 7 | ===== Description 8 | 9 | Returns a sequence on the collection. If the collection is empty, returns nil. 10 | 11 | `(seq nil)` returns nil. 12 | 13 | `seq` also works on strings. 14 | 15 | ===== Related 16 | cljs.core/seq? 17 | cljs.core/empty? 18 | cljs.core/iterator-seq 19 | -------------------------------------------------------------------------------- /docfiles/cljs.core_seqQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/seq? 3 | 4 | ===== Signature 5 | [x] 6 | 7 | ===== Description 8 | 9 | Returns true if `x` is a sequence, false otherwise. 10 | 11 | All collections can be converted into a sequence using `seq`. 12 | 13 | ===== Related 14 | cljs.core/seq 15 | cljs.core/sequential? 16 | cljs.core/vector? 17 | cljs.core/coll? 18 | cljs.core/list? 19 | cljs.core/map? 20 | cljs.core/set? 21 | -------------------------------------------------------------------------------- /docfiles/cljs.core_sequentialQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/sequential? 3 | 4 | ===== Signature 5 | [coll] 6 | 7 | ===== Description 8 | 9 | Returns true if `coll` implements the `ISequential` protocol, false otherwise. 10 | 11 | Lists and vectors are sequential. 12 | 13 | ===== Related 14 | cljs.core/seq? 15 | cljs.core/coll? 16 | -------------------------------------------------------------------------------- /docfiles/cljs.core_set-validatorBANG.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/set-validator! 3 | 4 | ===== Signature 5 | [a fn] 6 | 7 | ===== Description 8 | 9 | Sets a validator function for atom `a`. 10 | 11 | `fn` must be nil or a side-effect-free function of one argument, which will be 12 | passed the intended new state on any state change. `fn` should return false or 13 | throw an Error if the new state is unacceptable. 14 | 15 | If the current value of `a` is unacceptable to `fn` when `set-validator!` is 16 | called, an Error will be thrown and the validator will not be set. 17 | 18 | `(set-validator! my-atom nil)` will remove the validator from `my-atom`. 19 | 20 | ===== Related 21 | cljs.core/atom 22 | cljs.core/get-validator 23 | -------------------------------------------------------------------------------- /docfiles/cljs.core_set.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/set 3 | 4 | ===== Signature 5 | [coll] 6 | 7 | ===== Description 8 | 9 | Returns a set of the distinct elements of `coll`. 10 | 11 | ===== Related 12 | cljs.core/hash-set 13 | cljs.core/sorted-set 14 | cljs.core/conj 15 | cljs.core/disj 16 | cljs.core/distinct 17 | clojure.set/join 18 | clojure.set/select 19 | clojure.set/difference 20 | clojure.set/intersection 21 | clojure.set/union 22 | clojure.set/index 23 | clojure.set/project 24 | clojure.set/rename 25 | clojure.set/rename-keys 26 | clojure.set/map-invert 27 | -------------------------------------------------------------------------------- /docfiles/cljs.core_setBANG.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/set! 3 | 4 | ===== Signature 5 | [js-var val] 6 | 7 | ===== Description 8 | 9 | Sets `js-var` to `val` using the JavaScript `=` operator. 10 | 11 | ===== Related 12 | cljs.core/aset 13 | cljs.core/reset! 14 | -------------------------------------------------------------------------------- /docfiles/cljs.core_setQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/set? 3 | 4 | ===== Signature 5 | [x] 6 | 7 | ===== Description 8 | 9 | Returns true if `x` is a set, false otherwise. 10 | 11 | ===== Related 12 | cljs.core/set 13 | -------------------------------------------------------------------------------- /docfiles/cljs.core_shuffle.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/shuffle 3 | 4 | ===== Signature 5 | [coll] 6 | 7 | ===== Description 8 | 9 | Returns a random permutation of `coll`. 10 | 11 | ===== Related 12 | -------------------------------------------------------------------------------- /docfiles/cljs.core_some-GT.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/some-> 3 | 4 | ===== Type 5 | macro 6 | 7 | ===== Signature 8 | [expr & forms] 9 | 10 | ===== Description 11 | 12 | When `expr` is not nil, threads it into the first form (via `->`), and when that 13 | result is not nil, through the next, etc. 14 | 15 | ===== Related 16 | cljs.core/-> 17 | cljs.core/->> 18 | cljs.core/some->> 19 | cljs.core/some 20 | -------------------------------------------------------------------------------- /docfiles/cljs.core_some-GTGT.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/some->> 3 | 4 | ===== Type 5 | macro 6 | 7 | ===== Signature 8 | [expr & forms] 9 | 10 | ===== Description 11 | 12 | When `expr` is not nil, threads it into the first form (via `->>`), and when 13 | that result is not nil, through the next, etc. 14 | 15 | ===== Related 16 | cljs.core/-> 17 | cljs.core/->> 18 | cljs.core/some-> 19 | cljs.core/some 20 | -------------------------------------------------------------------------------- /docfiles/cljs.core_some-fn.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/some-fn 3 | 4 | ===== Signature 5 | [p] 6 | [p1 p2] 7 | [p1 p2 p3] 8 | [p1 p2 p3 & ps] 9 | 10 | ===== Description 11 | 12 | Takes a set of predicate functions and returns a function `f` that returns the 13 | first logical true value returned by one of its composing predicates against any 14 | of its arguments, else it returns logical false. 15 | 16 | Note that `f` is short-circuiting in that it will stop execution on the first 17 | argument that triggers a logical true result against the original predicates. 18 | 19 | ===== Related 20 | cljs.core/every-pred 21 | cljs.core/some 22 | cljs.core/or 23 | -------------------------------------------------------------------------------- /docfiles/cljs.core_some.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/some 3 | 4 | ===== Signature 5 | [pred coll] 6 | 7 | ===== Description 8 | 9 | Returns the first logical true value of `(pred x)` for any `x` in `coll`, else 10 | nil. 11 | 12 | A common idiom is to use a set as pred, for example this will return `:fred` if 13 | `:fred` is in the sequence, otherwise nil: `(some #{:fred} coll)` 14 | 15 | ===== Related 16 | cljs.core/every? 17 | cljs.core/not-any? 18 | cljs.core/keep 19 | cljs.core/keep-indexed 20 | cljs.core/some-fn 21 | -------------------------------------------------------------------------------- /docfiles/cljs.core_someQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/some? 3 | 4 | ===== Signature 5 | [x] 6 | 7 | ===== Description 8 | 9 | Returns true if `x` is not nil, false otherwise. 10 | 11 | ===== Related 12 | cljs.core/true? 13 | cljs.core/nil? 14 | -------------------------------------------------------------------------------- /docfiles/cljs.core_sort-by.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/sort-by 3 | 4 | ===== Signature 5 | [keyfn coll] 6 | [keyfn comp coll] 7 | 8 | ===== Description 9 | 10 | Returns a sorted sequence of the items in `coll`, where the sort order is 11 | determined by comparing `(keyfn item)`. 12 | 13 | `comp` can be boolean-valued comparison function, or a -/0/+ valued comparator. 14 | 15 | `comp` defaults to `compare`. 16 | 17 | ===== Related 18 | cljs.core/sort 19 | cljs.core/compare 20 | -------------------------------------------------------------------------------- /docfiles/cljs.core_sort.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/sort 3 | 4 | ===== Signature 5 | [coll] 6 | [comp coll] 7 | 8 | ===== Description 9 | 10 | Returns a sorted sequence of the items in `coll`. 11 | 12 | `comp` can be a boolean-valued comparison funcion, or a -/0/+ valued comparator. 13 | 14 | `comp` defaults to `compare`. 15 | 16 | ===== Related 17 | cljs.core/sort-by 18 | -------------------------------------------------------------------------------- /docfiles/cljs.core_sorted-map-by.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/sorted-map-by 3 | 4 | ===== Signature 5 | [comparator & keyvals] 6 | 7 | ===== Description 8 | 9 | Returns a new sorted map with supplied mappings, using the supplied comparator 10 | function. 11 | 12 | `keyvals` must be an even number of forms. 13 | 14 | ===== Related 15 | cljs.core/sorted-map 16 | cljs.core/subseq 17 | cljs.core/rsubseq 18 | cljs.core/sorted-set-by 19 | -------------------------------------------------------------------------------- /docfiles/cljs.core_sorted-map.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/sorted-map 3 | 4 | ===== Signature 5 | [& keyvals] 6 | 7 | ===== Description 8 | 9 | Returns a new sorted map with supplied mappings. 10 | 11 | `keyvals` must be an even number of forms. 12 | 13 | ===== Related 14 | cljs.core/sorted-map-by 15 | cljs.core/subseq 16 | cljs.core/rsubseq 17 | cljs.core/sorted-set 18 | cljs.core/array-map 19 | cljs.core/hash-map 20 | -------------------------------------------------------------------------------- /docfiles/cljs.core_sorted-set-by.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/sorted-set-by 3 | 4 | ===== Signature 5 | [comparator & keys] 6 | 7 | ===== Description 8 | 9 | Returns a new sorted set with supplied `keys`, using the supplied `comparator`. 10 | 11 | ===== Related 12 | cljs.core/sorted-set 13 | cljs.core/sorted-map-by 14 | cljs.core/compare 15 | -------------------------------------------------------------------------------- /docfiles/cljs.core_sorted-set.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/sorted-set 3 | 4 | ===== Signature 5 | [& keys] 6 | 7 | ===== Description 8 | 9 | Returns a new sorted set with supplied `keys`. 10 | 11 | ===== Related 12 | cljs.core/sorted-set-by 13 | cljs.core/subseq 14 | cljs.core/rsubseq 15 | cljs.core/sorted-map 16 | -------------------------------------------------------------------------------- /docfiles/cljs.core_sortedQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/sorted? 3 | 4 | ===== Signature 5 | [coll] 6 | 7 | ===== Description 8 | 9 | Returns true if `coll` implements the `ISorted` protocol, false otherwise. 10 | 11 | Sorted maps and sorted sets implement `ISorted`. 12 | 13 | ===== Related 14 | cljs.core/sorted-map 15 | cljs.core/sorted-set 16 | -------------------------------------------------------------------------------- /docfiles/cljs.core_split-at.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/split-at 3 | 4 | ===== Signature 5 | [n coll] 6 | 7 | ===== Description 8 | 9 | Returns a vector of `[(take n coll) (drop n coll)]`. 10 | 11 | ===== Related 12 | cljs.core/split-with 13 | clojure.string/split 14 | -------------------------------------------------------------------------------- /docfiles/cljs.core_split-with.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/split-with 3 | 4 | ===== Signature 5 | [pred coll] 6 | 7 | ===== Description 8 | 9 | Returns a vector of `[(take-while pred coll) (drop-while pred coll)]` 10 | 11 | ===== Related 12 | cljs.core/split-at 13 | clojure.string/split 14 | cljs.core/take-while 15 | cljs.core/drop-while 16 | -------------------------------------------------------------------------------- /docfiles/cljs.core_str.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/str 3 | 4 | ===== Signature 5 | [] 6 | [x] 7 | [x & ys] 8 | 9 | ===== Description 10 | 11 | `(str)` and `(str nil)` return the empty string. 12 | 13 | `(str x)` returns `x.toString()`. 14 | 15 | With more than one argument, returns the concatenation of the `str` values of 16 | the arguments. 17 | 18 | ===== Related 19 | -------------------------------------------------------------------------------- /docfiles/cljs.core_stringQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/string? 3 | 4 | ===== Signature 5 | [x] 6 | 7 | ===== Description 8 | 9 | Returns true if `x` is a string, false otherwise. 10 | 11 | ===== Related 12 | -------------------------------------------------------------------------------- /docfiles/cljs.core_subs.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/subs 3 | 4 | ===== Signature 5 | [s start] 6 | [s start end] 7 | 8 | ===== Description 9 | 10 | Returns the substring of `s` beginning at `start` inclusive, and ending at `end` 11 | exclusive. 12 | 13 | `end` defaults to the length of the string. 14 | 15 | ===== Related 16 | 17 | -------------------------------------------------------------------------------- /docfiles/cljs.core_subseq.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/subseq 3 | 4 | ===== Signature 5 | [sc test key] 6 | [sc start-test start-key end-test end-key] 7 | 8 | ===== Description 9 | 10 | `sc` must be a sorted collection. 11 | 12 | `test`, `start-test`, `end-test` must be `<`, `<=`, `>` or `>=`. 13 | 14 | Returns a sequence of those entries with keys `ek` for which 15 | `(test (.. sc comparator (compare ek key)) 0)` is true. 16 | 17 | ===== Related 18 | cljs.core/rsubseq 19 | cljs.core/sorted-map 20 | cljs.core/sorted-set 21 | cljs.core/sorted-map-by 22 | cljs.core/sorted-set-by 23 | -------------------------------------------------------------------------------- /docfiles/cljs.core_subvec.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/subvec 3 | 4 | ===== Signature 5 | [v start] 6 | [v start end] 7 | 8 | ===== Description 9 | 10 | Returns a persistent vector of the items in `v` from `start` inclusive to `end` 11 | exclusive. 12 | 13 | If `end` is not supplied, defaults to `(count v)`. 14 | 15 | This operation is O(1) and very fast, as the resulting vector shares structure 16 | with the original and no trimming is done. 17 | 18 | ===== Related 19 | cljs.core/vector 20 | cljs.core/vector? 21 | -------------------------------------------------------------------------------- /docfiles/cljs.core_swapBANG.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/swap! 3 | 4 | ===== Signature 5 | [a f] 6 | [a f x] 7 | [a f x y] 8 | [a f x y & more] 9 | 10 | ===== Description 11 | 12 | Atomically swaps the value of atom to be: `(apply f current-value-of-atom 13 | args)` 14 | 15 | Note that `f` may be called multiple times, and thus should be free of side 16 | effects. 17 | 18 | Returns the value that was swapped in. 19 | 20 | ===== Related 21 | cljs.core/atom 22 | cljs.core/reset! 23 | -------------------------------------------------------------------------------- /docfiles/cljs.core_take-last.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/take-last 3 | 4 | ===== Signature 5 | [n coll] 6 | 7 | ===== Description 8 | 9 | Returns a sequence of the last `n` items in `coll`. 10 | 11 | Depending on the type of collection, `take-last` may be no faster than linear 12 | time. For vectors, please use `subvec`. 13 | 14 | ===== Related 15 | cljs.core/last 16 | cljs.core/butlast 17 | cljs.core/drop-last 18 | 19 | ===== TODO 20 | 21 | Would be nice to list the O(n) time for all the collection types here instead of 22 | just saying "it depends". 23 | -------------------------------------------------------------------------------- /docfiles/cljs.core_take-nth.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/take-nth 3 | 4 | ===== Signature 5 | [n] 6 | [n coll] 7 | 8 | ===== Description 9 | 10 | Returns a lazy seq of every `n`th item in `coll`. 11 | 12 | Returns a stateful transducer when no collection is provided. 13 | 14 | ===== Related 15 | -------------------------------------------------------------------------------- /docfiles/cljs.core_take-while.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/take-while 3 | 4 | ===== Signature 5 | [pred] 6 | [pred coll] 7 | 8 | ===== Description 9 | 10 | Returns a lazy sequence of successive items from `coll` while `(pred item)` 11 | returns true. `pred` must be free of side-effects. 12 | 13 | Returns a transducer when no collection is provided. 14 | 15 | ===== Related 16 | cljs.core/drop-while 17 | cljs.core/split-with 18 | -------------------------------------------------------------------------------- /docfiles/cljs.core_take.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/take 3 | 4 | ===== Signature 5 | [n] 6 | [n coll] 7 | 8 | ===== Description 9 | 10 | Returns a lazy sequence of the first `n` items in `coll`. Returns all the items 11 | if there are fewer than `n`. 12 | 13 | Returns a stateful transducer when no collection is provided. 14 | 15 | ===== Related 16 | cljs.core/drop 17 | cljs.core/take-while 18 | cljs.core/take-last 19 | cljs.core/take-nth 20 | -------------------------------------------------------------------------------- /docfiles/cljs.core_throw.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/throw 3 | 4 | ===== Type 5 | special form 6 | 7 | ===== Signature 8 | [expr] 9 | 10 | ===== Description 11 | 12 | `expr` is evaluated and thrown, hopefully to be caught by a `try` expression. 13 | 14 | `(throw (js/Error. "Oops!"))` 15 | 16 | ===== Related 17 | cljs.core/try 18 | cljs.core/catch 19 | cljs.core/finally 20 | -------------------------------------------------------------------------------- /docfiles/cljs.core_to-array-2d.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/to-array-2d 3 | 4 | ===== Signature 5 | [coll] 6 | 7 | ===== Description 8 | 9 | Returns a (potentially-ragged) 2-dimensional JavaScript array containing the 10 | contents of `coll`. 11 | 12 | ===== Related 13 | cljs.core/to-array 14 | 15 | ===== TODO 16 | 17 | This needs an example. 18 | -------------------------------------------------------------------------------- /docfiles/cljs.core_tree-seq.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/tree-seq 3 | 4 | ===== Signature 5 | [branch? children root] 6 | 7 | ===== Description 8 | 9 | Returns a lazy sequence of the nodes in a tree, via a depth-first walk. 10 | 11 | `branch?` must be a function of one argument that returns true if passed a node 12 | that can have children (but may not). 13 | 14 | `children` must be a function of one argument that returns a sequence of the 15 | children. `children` will only be called on nodes for which `branch?` returns 16 | true. 17 | 18 | `root` is the root node of the tree. 19 | 20 | ===== Related 21 | -------------------------------------------------------------------------------- /docfiles/cljs.core_trueQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/true? 3 | 4 | ===== Signature 5 | [x] 6 | 7 | ===== Description 8 | 9 | Returns true if `x` is the value true, false otherwise. 10 | 11 | ===== Related 12 | cljs.core/false? 13 | -------------------------------------------------------------------------------- /docfiles/cljs.core_try.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/try 3 | 4 | ===== Type 5 | special form 6 | 7 | ===== Signature 8 | [expr* catch-clause* finally-clause?] 9 | 10 | ===== Description 11 | 12 | The expressions (`expr*`) are evaluated and, if no exceptions occur, the value 13 | of the last is returned. 14 | 15 | If an exception occurs and catch clauses (`catch-clause*`) are provided, each is 16 | examined in turn and the first for which the thrown exception is an instance of 17 | the named class is considered a matching catch clause. If there is a matching 18 | catch clause, its expressions are evaluated in a context in which name is bound 19 | to the thrown exception, and the value of the last is the return value of the 20 | function. 21 | 22 | If there is no matching catch clause, the exception propagates out of the 23 | function. Before returning, normally or abnormally, any `finally-clause?` 24 | expressions will be evaluated for their side effects. 25 | 26 | `try` is one of ClojureScript's [special forms](http://clojure.org/special_forms). 27 | 28 | ===== Related 29 | cljs.core/catch 30 | cljs.core/finally 31 | cljs.core/throw 32 | -------------------------------------------------------------------------------- /docfiles/cljs.core_unsigned-bit-shift-right.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/unsigned-bit-shift-right 3 | 4 | ===== Signature 5 | [x n] 6 | 7 | ===== Description 8 | 9 | Bitwise shift right with zero fill 10 | 11 | ===== Related 12 | cljs.core/bit-shift-right 13 | -------------------------------------------------------------------------------- /docfiles/cljs.core_update-in.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/update-in 3 | 4 | ===== Signature 5 | [m [k & ks] f] 6 | [m [k & ks] f a] 7 | [m [k & ks] f a b] 8 | [m [k & ks] f a b c] 9 | [m [k & ks] f a b c & args] 10 | 11 | ===== Description 12 | 13 | "Updates" a value in a nested associative structure, where `ks` is a sequence of 14 | keys and `f` is a function that will take the old value and any supplied 15 | arguments and return the new value. Returns a new nested structure. 16 | 17 | If any levels do not exist, hash-maps will be created. 18 | 19 | ===== Related 20 | cljs.core/assoc-in 21 | cljs.core/get-in 22 | -------------------------------------------------------------------------------- /docfiles/cljs.core_val.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/val 3 | 4 | ===== Signature 5 | [map-entry] 6 | 7 | ===== Description 8 | 9 | Returns the value in the map entry. 10 | 11 | ===== Related 12 | cljs.core/vals 13 | -------------------------------------------------------------------------------- /docfiles/cljs.core_vals.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/vals 3 | 4 | ===== Signature 5 | [hash-map] 6 | 7 | ===== Description 8 | 9 | Returns a sequence of the values in `hash-map`. 10 | 11 | ===== Related 12 | cljs.core/keys 13 | -------------------------------------------------------------------------------- /docfiles/cljs.core_vec.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/vec 3 | 4 | ===== Signature 5 | [coll] 6 | 7 | ===== Description 8 | 9 | Creates a new vector containing the contents of `coll` 10 | 11 | ===== Related 12 | cljs.core/vector 13 | cljs.core/vector? 14 | cljs.core/vector-of 15 | -------------------------------------------------------------------------------- /docfiles/cljs.core_vector.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/vector 3 | 4 | ===== Signature 5 | [& args] 6 | 7 | ===== Description 8 | 9 | Creates a new vector containing `args`. 10 | 11 | ===== Related 12 | cljs.core/vec 13 | cljs.core/vector? 14 | cljs.core/vector-of 15 | cljs.core/pop 16 | cljs.core/into 17 | -------------------------------------------------------------------------------- /docfiles/cljs.core_vectorQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/vector? 3 | 4 | ===== Signature 5 | [x] 6 | 7 | ===== Description 8 | 9 | Returns true if `x` is a vector, false otherwise. 10 | 11 | ===== Related 12 | cljs.core/vector 13 | cljs.core/vec 14 | -------------------------------------------------------------------------------- /docfiles/cljs.core_when-first.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/when-first 3 | 4 | ===== Type 5 | macro 6 | 7 | ===== Signature 8 | [bindings & body] 9 | 10 | ===== Description 11 | 12 | With `bindings` as `x`, `xs`, roughly the same as `(when (seq xs) (let [x (first 13 | xs)] body))` but `xs` is evaluated only once. 14 | 15 | ===== Related 16 | 17 | ===== TODO 18 | 19 | This needs better explanation + examples. 20 | -------------------------------------------------------------------------------- /docfiles/cljs.core_when-let.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/when-let 3 | 4 | ===== Type 5 | macro 6 | 7 | ===== Signature 8 | [[x test] & body] 9 | 10 | ===== Description 11 | 12 | When `test` is logical true, evaluates `body` with the value of `test` bound to 13 | `x`. 14 | 15 | ===== Related 16 | cljs.core/if-let 17 | cljs.core/when 18 | cljs.core/when-not 19 | cljs.core/if 20 | cljs.core/when-first 21 | -------------------------------------------------------------------------------- /docfiles/cljs.core_when-not.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/when-not 3 | 4 | ===== Type 5 | macro 6 | 7 | ===== Signature 8 | [test & body] 9 | 10 | ===== Description 11 | 12 | Evaluates `test`. If logical false, evaluates `body` in an implicit `do`. 13 | 14 | ===== Related 15 | cljs.core/when 16 | cljs.core/when-let 17 | cljs.core/if 18 | -------------------------------------------------------------------------------- /docfiles/cljs.core_when-some.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/when-some 3 | 4 | ===== Type 5 | macro 6 | 7 | ===== Signature 8 | [[x test] & body] 9 | 10 | ===== Description 11 | 12 | When `test` is not nil, evaluates `body` with `x` bound to the value of `test`. 13 | 14 | ===== Related 15 | cljs.core/if-some 16 | -------------------------------------------------------------------------------- /docfiles/cljs.core_when.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/when 3 | 4 | ===== Type 5 | macro 6 | 7 | ===== Signature 8 | [test & body] 9 | 10 | ===== Description 11 | 12 | Evaluates `test`. If logical true, evaluates `body` in an implicit `do`. 13 | 14 | `when` is often used instead of `if` for conditions that do not have an "else". 15 | 16 | ===== Related 17 | cljs.core/when-not 18 | cljs.core/when-let 19 | cljs.core/if 20 | -------------------------------------------------------------------------------- /docfiles/cljs.core_while.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/while 3 | 4 | ===== Type 5 | macro 6 | 7 | ===== Signature 8 | [test & body] 9 | 10 | ===== Description 11 | 12 | Repeatedly executes `body` while `test` expression is true. Presumes some 13 | side-effect will cause `test` to become false or nil. 14 | 15 | Returns nil. 16 | 17 | ===== Related 18 | cljs.core/loop 19 | -------------------------------------------------------------------------------- /docfiles/cljs.core_zeroQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/zero? 3 | 4 | ===== Signature 5 | [n] 6 | 7 | ===== Description 8 | 9 | Returns true if `n` is 0, false otherwise. 10 | 11 | ===== Related 12 | cljs.core/pos? 13 | cljs.core/neg? 14 | -------------------------------------------------------------------------------- /docfiles/cljs.core_zipmap.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | cljs.core/zipmap 3 | 4 | ===== Signature 5 | [keys vals] 6 | 7 | ===== Description 8 | 9 | Returns a map with `keys` mapped to corresponding `vals`. 10 | 11 |
user=> (zipmap [:a :b :c :d] [1 2 3 4])
12 | {:a 1, :b 2, :c 3, :d 4}
13 | 14 | ===== Related 15 | cljs.core/interleave 16 | -------------------------------------------------------------------------------- /docfiles/clojure.set_difference.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | clojure.set/difference 3 | 4 | ===== Signature 5 | [s1] 6 | [s1 s2] 7 | [s1 s2 & sets] 8 | 9 | ===== Description 10 | 11 | Return a set that is the first set without elements of the remaining sets. 12 | 13 | ===== Related 14 | clojure.set/union 15 | clojure.set/intersection 16 | clojure.set/superset? 17 | clojure.set/project 18 | -------------------------------------------------------------------------------- /docfiles/clojure.set_intersection.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | clojure.set/intersection 3 | 4 | ===== Signature 5 | [s1] 6 | [s1 s2] 7 | [s1 s2 & sets] 8 | 9 | ===== Description 10 | 11 | Return a set that is the intersection of the input sets. 12 | 13 | ===== Related 14 | clojure.set/union 15 | clojure.set/difference 16 | clojure.set/superset? 17 | clojure.set/project 18 | -------------------------------------------------------------------------------- /docfiles/clojure.set_select.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | clojure.set/select 3 | 4 | ===== Signature 5 | [pred xset] 6 | 7 | ===== Description 8 | 9 | Returns a set of the elements for which `pred` is true. 10 | 11 | ===== Related 12 | cljs.core/filter 13 | -------------------------------------------------------------------------------- /docfiles/clojure.set_subsetQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | clojure.set/subset? 3 | 4 | ===== Signature 5 | [a b] 6 | 7 | ===== Description 8 | 9 | Returns true if `a` is a subset of `b`, false otherwise. 10 | 11 | In other words, returns true if all the elements of `a` can be found in `b`. 12 | 13 | ===== Related 14 | cljs.core/set 15 | cljs.core/set? 16 | clojure.set/superset? 17 | -------------------------------------------------------------------------------- /docfiles/clojure.set_supersetQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | clojure.set/superset? 3 | 4 | ===== Signature 5 | [a b] 6 | 7 | ===== Description 8 | 9 | Returns true if `a` is a superset of `b`, false otherwise. 10 | 11 | In other words, returns true if `a` contains all the elements of `b`. 12 | 13 | ===== Related 14 | cljs.core/set 15 | cljs.core/set? 16 | clojure.set/subset? 17 | -------------------------------------------------------------------------------- /docfiles/clojure.set_union.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | clojure.set/union 3 | 4 | ===== Signature 5 | [] 6 | [s1] 7 | [s1 s2] 8 | [s1 s2 & sets] 9 | 10 | ===== Description 11 | 12 | Return a set that is the union of the input sets. 13 | 14 | ===== Related 15 | clojure.set/intersection 16 | clojure.set/difference 17 | clojure.set/superset? 18 | -------------------------------------------------------------------------------- /docfiles/clojure.string_blankQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | clojure.string/blank? 3 | 4 | ===== Signature 5 | [s] 6 | 7 | ===== Description 8 | 9 | True if `s` is nil, empty, or contains only whitespace. 10 | 11 | ===== Related 12 | cljs.core/empty? 13 | -------------------------------------------------------------------------------- /docfiles/clojure.string_capitalize.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | clojure.string/capitalize 3 | 4 | ===== Signature 5 | [s] 6 | 7 | ===== Description 8 | 9 | Converts first character of the string to upper-case, all other characters to 10 | lower-case. 11 | 12 | ===== Related 13 | -------------------------------------------------------------------------------- /docfiles/clojure.string_ends-withQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | clojure.string/ends-with? 3 | 4 | ===== Signature 5 | [s substr] 6 | 7 | ===== Description 8 | 9 | True if `s` ends with `substr`. 10 | 11 | ===== Related 12 | clojure.string/starts-with? 13 | clojure.string/includes? 14 | -------------------------------------------------------------------------------- /docfiles/clojure.string_escape.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | clojure.string/escape 3 | 4 | ===== Signature 5 | [s cmap] 6 | 7 | ===== Description 8 | 9 | Return a new string, using `cmap` to escape each character `ch` from `s` as follows: 10 | 11 | If `(cmap ch)` is nil, append ch to the new string. 12 | 13 | If `(cmap ch)` is non-nil, append `(str (cmap ch))` instead. 14 | 15 | ===== Related 16 | -------------------------------------------------------------------------------- /docfiles/clojure.string_includesQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | clojure.string/includes? 3 | 4 | ===== Signature 5 | [s substr] 6 | 7 | ===== Description 8 | 9 | True if `s` includes `substr`. 10 | 11 | ===== Related 12 | cljs.core/re-find 13 | cljs.core/contains? 14 | clojure.string/starts-with? 15 | clojure.string/ends-with? 16 | -------------------------------------------------------------------------------- /docfiles/clojure.string_join.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | clojure.string/join 3 | 4 | ===== Signature 5 | [coll] 6 | [separator coll] 7 | 8 | ===== Description 9 | 10 | Returns a string of all elements in `coll`, as returned by `(seq coll)`, 11 | separated by an optional separator. 12 | 13 | ===== Related 14 | -------------------------------------------------------------------------------- /docfiles/clojure.string_lower-case.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | clojure.string/lower-case 3 | 4 | ===== Signature 5 | [s] 6 | 7 | ===== Description 8 | 9 | Converts string to all lower-case. 10 | 11 | ===== Related 12 | -------------------------------------------------------------------------------- /docfiles/clojure.string_replace-first.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | clojure.string/replace-first 3 | 4 | ===== Signature 5 | [s match replacement] 6 | 7 | ===== Description 8 | 9 | Replaces the first instance of `match` with `replacement` in `s`. 10 | 11 | The options for match / replacement are: 12 | 13 | | match | replacement | 14 | |--------|-------------| 15 | | string | string | 16 | | regex | string | 17 | | regex | function | 18 | 19 | ===== Related 20 | 21 | -------------------------------------------------------------------------------- /docfiles/clojure.string_replace.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | clojure.string/replace 3 | 4 | ===== Signature 5 | [s match replacement] 6 | 7 | ===== Description 8 | 9 | Replaces all instance of `match` with `replacement` in `s`. 10 | 11 | The options for match / replacement are: 12 | 13 | | match | replacement | 14 | |--------|-------------| 15 | | string | string | 16 | | regex | string | 17 | | regex | function | 18 | 19 | ===== Related 20 | cljs.core/subs 21 | clojure.string/split 22 | clojure.string/replace-first 23 | -------------------------------------------------------------------------------- /docfiles/clojure.string_reverse.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | clojure.string/reverse 3 | 4 | ===== Signature 5 | [s] 6 | 7 | ===== Description 8 | 9 | Returns `s` with its characters reversed. 10 | 11 | ===== Related 12 | -------------------------------------------------------------------------------- /docfiles/clojure.string_split-lines.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | clojure.string/split-lines 3 | 4 | ===== Signature 5 | [s] 6 | 7 | ===== Description 8 | 9 | Splits `s` on `\n` or `\r\n`. 10 | 11 | ===== Related 12 | clojure.string/split 13 | -------------------------------------------------------------------------------- /docfiles/clojure.string_split.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | clojure.string/split 3 | 4 | ===== Signature 5 | [s re] 6 | [s re limit] 7 | 8 | ===== Description 9 | 10 | Splits string on a regular expression. Optional argument limit is the maximum 11 | number of splits. Not lazy. Returns vector of the splits. 12 | 13 | ===== Related 14 | cljs.core/subs 15 | clojure.string/replace 16 | clojure.string/split-lines 17 | -------------------------------------------------------------------------------- /docfiles/clojure.string_starts-withQMARK.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | clojure.string/starts-with? 3 | 4 | ===== Signature 5 | [s substr] 6 | 7 | ===== Description 8 | 9 | True if `s` starts with `substr`. 10 | 11 | ===== Related 12 | clojure.string/ends-with? 13 | clojure.string/includes? 14 | -------------------------------------------------------------------------------- /docfiles/clojure.string_trim-newline.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | clojure.string/trim-newline 3 | 4 | ===== Signature 5 | [s] 6 | 7 | ===== Description 8 | 9 | Removes all trailing newline `\n` or return `\r` characters from string. 10 | 11 | Similar to Perl's chomp. 12 | 13 | ===== Related 14 | -------------------------------------------------------------------------------- /docfiles/clojure.string_trim.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | clojure.string/trim 3 | 4 | ===== Signature 5 | [s] 6 | 7 | ===== Description 8 | 9 | Removes whitespace from both ends of string. 10 | 11 | ===== Related 12 | -------------------------------------------------------------------------------- /docfiles/clojure.string_triml.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | clojure.string/triml 3 | 4 | ===== Signature 5 | [s] 6 | 7 | ===== Description 8 | 9 | Removes whitespace from the left side of string. 10 | 11 | ===== Related 12 | -------------------------------------------------------------------------------- /docfiles/clojure.string_trimr.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | clojure.string/trimr 3 | 4 | ===== Signature 5 | [s] 6 | 7 | ===== Description 8 | 9 | Removes whitespace from the right side of string. 10 | 11 | ===== Related 12 | -------------------------------------------------------------------------------- /docfiles/clojure.string_upper-case.cljsdoc: -------------------------------------------------------------------------------- 1 | ===== Name 2 | clojure.string/upper-case 3 | 4 | ===== Signature 5 | [s] 6 | 7 | ===== Description 8 | 9 | Converts string to all upper-case. 10 | 11 | ===== Related 12 | -------------------------------------------------------------------------------- /less/000-main.less: -------------------------------------------------------------------------------- 1 | @import "001-normalize-3.0.3.less"; 2 | @import "010-cheatsheet.less"; 3 | -------------------------------------------------------------------------------- /less/001-normalize-3.0.3.less: -------------------------------------------------------------------------------- 1 | // normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css 2 | 3 | /** 4 | * 1. Set default font family to sans-serif. 5 | * 2. Prevent iOS and IE text size adjust after device orientation change, 6 | * without disabling user zoom. 7 | */ 8 | 9 | html { 10 | font-family: sans-serif; /* 1 */ 11 | -ms-text-size-adjust: 100%; /* 2 */ 12 | -webkit-text-size-adjust: 100%; /* 2 */ 13 | } 14 | 15 | /** 16 | * Remove default margin. 17 | */ 18 | 19 | body { 20 | margin: 0; 21 | } 22 | 23 | /* HTML5 display definitions 24 | ========================================================================== */ 25 | 26 | /** 27 | * Correct `block` display not defined for any HTML5 element in IE 8/9. 28 | * Correct `block` display not defined for `details` or `summary` in IE 10/11 29 | * and Firefox. 30 | * Correct `block` display not defined for `main` in IE 11. 31 | */ 32 | 33 | article, 34 | aside, 35 | details, 36 | figcaption, 37 | figure, 38 | footer, 39 | header, 40 | hgroup, 41 | main, 42 | menu, 43 | nav, 44 | section, 45 | summary { 46 | display: block; 47 | } 48 | 49 | /** 50 | * 1. Correct `inline-block` display not defined in IE 8/9. 51 | * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. 52 | */ 53 | 54 | audio, 55 | canvas, 56 | progress, 57 | video { 58 | display: inline-block; /* 1 */ 59 | vertical-align: baseline; /* 2 */ 60 | } 61 | 62 | /** 63 | * Prevent modern browsers from displaying `audio` without controls. 64 | * Remove excess height in iOS 5 devices. 65 | */ 66 | 67 | audio:not([controls]) { 68 | display: none; 69 | height: 0; 70 | } 71 | 72 | /** 73 | * Address `[hidden]` styling not present in IE 8/9/10. 74 | * Hide the `template` element in IE 8/9/10/11, Safari, and Firefox < 22. 75 | */ 76 | 77 | [hidden], 78 | template { 79 | display: none; 80 | } 81 | 82 | /* Links 83 | ========================================================================== */ 84 | 85 | /** 86 | * Remove the gray background color from active links in IE 10. 87 | */ 88 | 89 | a { 90 | background-color: transparent; 91 | } 92 | 93 | /** 94 | * Improve readability of focused elements when they are also in an 95 | * active/hover state. 96 | */ 97 | 98 | a:active, 99 | a:hover { 100 | outline: 0; 101 | } 102 | 103 | /* Text-level semantics 104 | ========================================================================== */ 105 | 106 | /** 107 | * Address styling not present in IE 8/9/10/11, Safari, and Chrome. 108 | */ 109 | 110 | abbr[title] { 111 | border-bottom: 1px dotted; 112 | } 113 | 114 | /** 115 | * Address style set to `bolder` in Firefox 4+, Safari, and Chrome. 116 | */ 117 | 118 | b, 119 | strong { 120 | font-weight: bold; 121 | } 122 | 123 | /** 124 | * Address styling not present in Safari and Chrome. 125 | */ 126 | 127 | dfn { 128 | font-style: italic; 129 | } 130 | 131 | /** 132 | * Address variable `h1` font-size and margin within `section` and `article` 133 | * contexts in Firefox 4+, Safari, and Chrome. 134 | */ 135 | 136 | h1 { 137 | font-size: 2em; 138 | margin: 0.67em 0; 139 | } 140 | 141 | /** 142 | * Address styling not present in IE 8/9. 143 | */ 144 | 145 | mark { 146 | background: #ff0; 147 | color: #000; 148 | } 149 | 150 | /** 151 | * Address inconsistent and variable font size in all browsers. 152 | */ 153 | 154 | small { 155 | font-size: 80%; 156 | } 157 | 158 | /** 159 | * Prevent `sub` and `sup` affecting `line-height` in all browsers. 160 | */ 161 | 162 | sub, 163 | sup { 164 | font-size: 75%; 165 | line-height: 0; 166 | position: relative; 167 | vertical-align: baseline; 168 | } 169 | 170 | sup { 171 | top: -0.5em; 172 | } 173 | 174 | sub { 175 | bottom: -0.25em; 176 | } 177 | 178 | /* Embedded content 179 | ========================================================================== */ 180 | 181 | /** 182 | * Remove border when inside `a` element in IE 8/9/10. 183 | */ 184 | 185 | img { 186 | border: 0; 187 | } 188 | 189 | /** 190 | * Correct overflow not hidden in IE 9/10/11. 191 | */ 192 | 193 | svg:not(:root) { 194 | overflow: hidden; 195 | } 196 | 197 | /* Grouping content 198 | ========================================================================== */ 199 | 200 | /** 201 | * Address margin not present in IE 8/9 and Safari. 202 | */ 203 | 204 | figure { 205 | margin: 1em 40px; 206 | } 207 | 208 | /** 209 | * Address differences between Firefox and other browsers. 210 | */ 211 | 212 | hr { 213 | box-sizing: content-box; 214 | height: 0; 215 | } 216 | 217 | /** 218 | * Contain overflow in all browsers. 219 | */ 220 | 221 | pre { 222 | overflow: auto; 223 | } 224 | 225 | /** 226 | * Address odd `em`-unit font size rendering in all browsers. 227 | */ 228 | 229 | code, 230 | kbd, 231 | pre, 232 | samp { 233 | font-family: monospace, monospace; 234 | font-size: 1em; 235 | } 236 | 237 | /* Forms 238 | ========================================================================== */ 239 | 240 | /** 241 | * Known limitation: by default, Chrome and Safari on OS X allow very limited 242 | * styling of `select`, unless a `border` property is set. 243 | */ 244 | 245 | /** 246 | * 1. Correct color not being inherited. 247 | * Known issue: affects color of disabled elements. 248 | * 2. Correct font properties not being inherited. 249 | * 3. Address margins set differently in Firefox 4+, Safari, and Chrome. 250 | */ 251 | 252 | button, 253 | input, 254 | optgroup, 255 | select, 256 | textarea { 257 | color: inherit; /* 1 */ 258 | font: inherit; /* 2 */ 259 | margin: 0; /* 3 */ 260 | } 261 | 262 | /** 263 | * Address `overflow` set to `hidden` in IE 8/9/10/11. 264 | */ 265 | 266 | button { 267 | overflow: visible; 268 | } 269 | 270 | /** 271 | * Address inconsistent `text-transform` inheritance for `button` and `select`. 272 | * All other form control elements do not inherit `text-transform` values. 273 | * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. 274 | * Correct `select` style inheritance in Firefox. 275 | */ 276 | 277 | button, 278 | select { 279 | text-transform: none; 280 | } 281 | 282 | /** 283 | * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` 284 | * and `video` controls. 285 | * 2. Correct inability to style clickable `input` types in iOS. 286 | * 3. Improve usability and consistency of cursor style between image-type 287 | * `input` and others. 288 | */ 289 | 290 | button, 291 | html input[type="button"], /* 1 */ 292 | input[type="reset"], 293 | input[type="submit"] { 294 | -webkit-appearance: button; /* 2 */ 295 | cursor: pointer; /* 3 */ 296 | } 297 | 298 | /** 299 | * Re-set default cursor for disabled elements. 300 | */ 301 | 302 | button[disabled], 303 | html input[disabled] { 304 | cursor: default; 305 | } 306 | 307 | /** 308 | * Remove inner padding and border in Firefox 4+. 309 | */ 310 | 311 | button::-moz-focus-inner, 312 | input::-moz-focus-inner { 313 | border: 0; 314 | padding: 0; 315 | } 316 | 317 | /** 318 | * Address Firefox 4+ setting `line-height` on `input` using `!important` in 319 | * the UA stylesheet. 320 | */ 321 | 322 | input { 323 | line-height: normal; 324 | } 325 | 326 | /** 327 | * It's recommended that you don't attempt to style these elements. 328 | * Firefox's implementation doesn't respect box-sizing, padding, or width. 329 | * 330 | * 1. Address box sizing set to `content-box` in IE 8/9/10. 331 | * 2. Remove excess padding in IE 8/9/10. 332 | */ 333 | 334 | input[type="checkbox"], 335 | input[type="radio"] { 336 | box-sizing: border-box; /* 1 */ 337 | padding: 0; /* 2 */ 338 | } 339 | 340 | /** 341 | * Fix the cursor style for Chrome's increment/decrement buttons. For certain 342 | * `font-size` values of the `input`, it causes the cursor style of the 343 | * decrement button to change from `default` to `text`. 344 | */ 345 | 346 | input[type="number"]::-webkit-inner-spin-button, 347 | input[type="number"]::-webkit-outer-spin-button { 348 | height: auto; 349 | } 350 | 351 | /** 352 | * 1. Address `appearance` set to `searchfield` in Safari and Chrome. 353 | * 2. Address `box-sizing` set to `border-box` in Safari and Chrome. 354 | */ 355 | 356 | input[type="search"] { 357 | -webkit-appearance: textfield; /* 1 */ 358 | box-sizing: content-box; /* 2 */ 359 | } 360 | 361 | /** 362 | * Remove inner padding and search cancel button in Safari and Chrome on OS X. 363 | * Safari (but not Chrome) clips the cancel button when the search input has 364 | * padding (and `textfield` appearance). 365 | */ 366 | 367 | input[type="search"]::-webkit-search-cancel-button, 368 | input[type="search"]::-webkit-search-decoration { 369 | -webkit-appearance: none; 370 | } 371 | 372 | /** 373 | * Define consistent border, margin, and padding. 374 | */ 375 | 376 | fieldset { 377 | border: 1px solid #c0c0c0; 378 | margin: 0 2px; 379 | padding: 0.35em 0.625em 0.75em; 380 | } 381 | 382 | /** 383 | * 1. Correct `color` not being inherited in IE 8/9/10/11. 384 | * 2. Remove padding so people aren't caught out if they zero out fieldsets. 385 | */ 386 | 387 | legend { 388 | border: 0; /* 1 */ 389 | padding: 0; /* 2 */ 390 | } 391 | 392 | /** 393 | * Remove default vertical scrollbar in IE 8/9/10/11. 394 | */ 395 | 396 | textarea { 397 | overflow: auto; 398 | } 399 | 400 | /** 401 | * Don't inherit the `font-weight` (applied by a rule above). 402 | * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. 403 | */ 404 | 405 | optgroup { 406 | font-weight: bold; 407 | } 408 | 409 | /* Tables 410 | ========================================================================== */ 411 | 412 | /** 413 | * Remove most spacing between table cells. 414 | */ 415 | 416 | table { 417 | border-collapse: collapse; 418 | border-spacing: 0; 419 | } 420 | 421 | td, 422 | th { 423 | padding: 0; 424 | } 425 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Chris Oakman (https://chrisoakman.com)", 3 | "name": "cljs-cheatsheet", 4 | "description": "a ClojureScript Cheatsheet", 5 | "homepage": "https://github.com/oakmac/cljs-cheatsheet", 6 | "license": "MIT", 7 | "repository": { 8 | "type": "git", 9 | "url": "https://github.com/oakmac/cljs-cheatsheet.git" 10 | }, 11 | "scripts": { 12 | "build-release": "lein cljsbuild once server && node app.js && grunt docs && grunt less && lein cljsbuild once cheatsheet-prod && snowflake-css prune && grunt build" 13 | }, 14 | "devDependencies": { 15 | "express": "4.16.2", 16 | "grunt-contrib-clean": "1.1.0", 17 | "grunt-contrib-copy": "1.0.0", 18 | "grunt-contrib-less": "1.4.1", 19 | "grunt-contrib-watch": "1.0.0", 20 | "grunt": "1.0.1", 21 | "kidif": "1.1.0", 22 | "marked": "0.3.18", 23 | "md5": "2.2.1", 24 | "shelljs": "0.8.5", 25 | "snowflake-css": "0.1.0" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /project.clj: -------------------------------------------------------------------------------- 1 | (defproject cljs-cheatsheet "0.1.0" 2 | 3 | :description "A ClojureScript Cheatsheet" 4 | :url "https://github.com/oakmac/cljs-cheatsheet" 5 | 6 | :license {:name "MIT License" 7 | :url "https://github.com/oakmac/cljs-cheatsheet/blob/master/LICENSE.md" 8 | :distribution :repo} 9 | 10 | :dependencies 11 | [[org.clojure/clojure "1.11.1"] 12 | [org.clojure/clojurescript "1.11.60"] 13 | [binaryage/oops "0.7.2"] 14 | [cljsjs/jquery "2.1.4-0"] 15 | [com.cognitect/transit-cljs "0.8.280"] 16 | [macchiato/hiccups "0.4.1"]] 17 | 18 | :plugins [[lein-cljsbuild "1.1.8"]] 19 | 20 | :source-paths ["src"] 21 | 22 | :clean-targets ["app.js" 23 | "public/js/cheatsheet.js" 24 | "public/js/cheatsheet.min.js" 25 | "target"] 26 | 27 | :cljsbuild 28 | {:builds 29 | [{:id "cheatsheet-dev" 30 | :source-paths ["cljs-client" "cljs-shared"] 31 | :compiler {:checked-arrays :warn 32 | :output-to "public/js/cheatsheet.js" 33 | :optimizations :whitespace}} 34 | 35 | 36 | {:id "cheatsheet-prod" 37 | :source-paths ["cljs-client" "cljs-shared"] 38 | :compiler {:checked-arrays :warn 39 | :output-to "public/js/cheatsheet.min.js" 40 | :optimizations :advanced 41 | :pretty-print false}} 42 | 43 | {:id "server" 44 | :source-paths ["cljs-server" "cljs-shared"] 45 | :compiler {:output-to "app.js" 46 | :optimizations :simple 47 | :target :nodejs}}]}) 48 | -------------------------------------------------------------------------------- /public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oakmac/cljs-cheatsheet/6f6ad189baf8f47c07e11c56d5cae079a6cd3db2/public/apple-touch-icon.png -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oakmac/cljs-cheatsheet/6f6ad189baf8f47c07e11c56d5cae079a6cd3db2/public/favicon.ico -------------------------------------------------------------------------------- /public/fonts/DroidSansMono.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oakmac/cljs-cheatsheet/6f6ad189baf8f47c07e11c56d5cae079a6cd3db2/public/fonts/DroidSansMono.eot -------------------------------------------------------------------------------- /public/fonts/DroidSansMono.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oakmac/cljs-cheatsheet/6f6ad189baf8f47c07e11c56d5cae079a6cd3db2/public/fonts/DroidSansMono.woff -------------------------------------------------------------------------------- /public/fonts/OpenSans-Italic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oakmac/cljs-cheatsheet/6f6ad189baf8f47c07e11c56d5cae079a6cd3db2/public/fonts/OpenSans-Italic.eot -------------------------------------------------------------------------------- /public/fonts/OpenSans-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oakmac/cljs-cheatsheet/6f6ad189baf8f47c07e11c56d5cae079a6cd3db2/public/fonts/OpenSans-Italic.woff -------------------------------------------------------------------------------- /public/fonts/OpenSans-Light.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oakmac/cljs-cheatsheet/6f6ad189baf8f47c07e11c56d5cae079a6cd3db2/public/fonts/OpenSans-Light.eot -------------------------------------------------------------------------------- /public/fonts/OpenSans-Light.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oakmac/cljs-cheatsheet/6f6ad189baf8f47c07e11c56d5cae079a6cd3db2/public/fonts/OpenSans-Light.woff -------------------------------------------------------------------------------- /public/fonts/OpenSans-Semibold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oakmac/cljs-cheatsheet/6f6ad189baf8f47c07e11c56d5cae079a6cd3db2/public/fonts/OpenSans-Semibold.eot -------------------------------------------------------------------------------- /public/fonts/OpenSans-Semibold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oakmac/cljs-cheatsheet/6f6ad189baf8f47c07e11c56d5cae079a6cd3db2/public/fonts/OpenSans-Semibold.woff -------------------------------------------------------------------------------- /public/fonts/OpenSans-SemiboldItalic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oakmac/cljs-cheatsheet/6f6ad189baf8f47c07e11c56d5cae079a6cd3db2/public/fonts/OpenSans-SemiboldItalic.eot -------------------------------------------------------------------------------- /public/fonts/OpenSans-SemiboldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oakmac/cljs-cheatsheet/6f6ad189baf8f47c07e11c56d5cae079a6cd3db2/public/fonts/OpenSans-SemiboldItalic.woff -------------------------------------------------------------------------------- /public/fonts/OpenSans.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oakmac/cljs-cheatsheet/6f6ad189baf8f47c07e11c56d5cae079a6cd3db2/public/fonts/OpenSans.eot -------------------------------------------------------------------------------- /public/fonts/OpenSans.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oakmac/cljs-cheatsheet/6f6ad189baf8f47c07e11c56d5cae079a6cd3db2/public/fonts/OpenSans.woff -------------------------------------------------------------------------------- /public/fonts/OpenSansLight-Italic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oakmac/cljs-cheatsheet/6f6ad189baf8f47c07e11c56d5cae079a6cd3db2/public/fonts/OpenSansLight-Italic.eot -------------------------------------------------------------------------------- /public/fonts/OpenSansLight-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oakmac/cljs-cheatsheet/6f6ad189baf8f47c07e11c56d5cae079a6cd3db2/public/fonts/OpenSansLight-Italic.woff -------------------------------------------------------------------------------- /public/img/cljs-ring.svg: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 14 | 15 | 18 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /public/img/info-circle.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /server.js: -------------------------------------------------------------------------------- 1 | // This file exists for developer convenience to host a web server out of the 2 | // public/ folder. 3 | // 4 | // Pass a port argument to this script to host on a port of your choice. 5 | // ie: node server.js 9224 6 | // 7 | // append the ?_slow=true query parameter to files to simulate slow loading times 8 | // ie: http://127.0.0.1:8888/api/data.json?_slow=true 9 | 10 | var express = require('express'), 11 | app = express(); 12 | 13 | const defaultPort = 8888; 14 | const port = process.argv[2] ? parseInt(process.argv[2], 10) : defaultPort; 15 | 16 | app.use(slowItDown); 17 | app.use(express.static('public')); 18 | app.listen(port); 19 | 20 | console.log('HTTP server running on port ' + port); 21 | 22 | //------------------------------------------------------------------------------------- 23 | // Functions 24 | //------------------------------------------------------------------------------------- 25 | 26 | function randomInt(min, max) { 27 | return Math.floor(Math.random() * (max - min + 1)) + min; 28 | } 29 | 30 | function slowItDown(req, res, nextFn) { 31 | if (req.query && req.query['_slow']) { 32 | setTimeout(nextFn, randomInt(400, 1000)); 33 | } 34 | else { 35 | nextFn(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /snowflake-css.json: -------------------------------------------------------------------------------- 1 | { 2 | "inputCSSFile": "public/css/main.min.css", 3 | "outputCSSFile": "public/css/main.min.css", 4 | "templateFiles": ["public/**/*.js", "public/**/*.json", "public/**/*.html"] 5 | } 6 | --------------------------------------------------------------------------------