clojuredocs-export.json 1.9 MB

1
  1. {"created-at":1760631833291,"description":"ClojureDocs Data Export","vars":[{"ns":"clojure.core","name":"def","type":"var","see-alsos":[{"created-at":1289040035000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"defn","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b15"},{"created-at":1289040039000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"fn","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b16"},{"created-at":1289040051000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"defmacro","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b17"},{"created-at":1289040055000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"defmulti","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b18"}],"examples":[{"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (def my-val 5)\n#'user/my-val\n\nuser=\u003E my-val\n5","created-at":1289040027000,"updated-at":1411962925119,"_id":"542692cfc026201cdc326e95"},{"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (def my-function (fn [x] (* x x x)))\n#'user/my-function\nuser=\u003E (my-function 4)\n64","created-at":1289040110000,"updated-at":1289040110000,"_id":"542692cfc026201cdc326e96"},{"author":{"login":"puredanger","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/89c8afd032c7b3473f67c9b00d3acd5a?r=PG&default=identicon"},"editors":[{"login":"puredanger","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/89c8afd032c7b3473f67c9b00d3acd5a?r=PG&default=identicon"},{"login":"pjlegato","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4ce55cfd8b3ae2f63f5ecbc8fc1c05d4?r=PG&default=identicon"},{"login":"pjlegato","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4ce55cfd8b3ae2f63f5ecbc8fc1c05d4?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; This is an example of setting a docstring during a def.\n;; (Note that the clojure.repl namespace which contains the\n;; doc function is not loaded by default in Emacs' SLIME mode.)\n\nuser\u003E (def ted-nugent \"The nuge rocks\" 123)\n#'user/ted-nugent\nuser\u003E (doc ted-nugent)\n-------------------------\nuser/ted-nugent\n The nuge rocks\nuser\u003E ted-nugent\n123\n","created-at":1300830366000,"updated-at":1411962895678,"_id":"542692cfc026201cdc326e97"},{"author":{"login":"jamesqiu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bc1268deaa7f2e78fe2b5ea76e6481d8?r=PG&default=identicon"},"editors":[{"login":"jamesqiu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bc1268deaa7f2e78fe2b5ea76e6481d8?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; give function another name\nuser=\u003E (def sys-map map)\n\n;; give macro another name\nuser=\u003E (def #^{:macro true} sys-loop #'loop)","created-at":1313515810000,"updated-at":1411962917894,"_id":"542692cfc026201cdc326e9b"}],"notes":null,"arglists":[],"doc":"Creates and interns or locates a global var with the name of symbol and a\nnamespace of the value of the current namespace (*ns*). See\nhttp://clojure.org/special_forms for more information.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/def"},{"ns":"clojure.core","name":"if","type":"var","see-alsos":[{"created-at":1302510837000,"author":{"login":"Havvy","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e799a79441c7543be48562403411cd13?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"cond","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e12"},{"created-at":1311797747000,"author":{"login":"OnesimusUnbound","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fa4c391db0d2d1744cc2cd0d787dd3d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"when","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e13"},{"created-at":1334293230000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"if-let","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e14"},{"created-at":1340541172000,"author":{"login":"jhulten","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b15299ac3f0bf5347d14a1232338b1cd?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"if-not","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e15"}],"examples":[{"author":{"login":"Victor","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bc41ebab54cc0e0fbe99d753876d45ce?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"(defn is-small? [number]\n (if (\u003C number 100) \"yes\" \"no\"))\n\nuser=\u003E (is-small? 50)\n\"yes\"\n\nuser=\u003E (is-small? 500)\n\"no\"","created-at":1288222254000,"updated-at":1288871229000,"_id":"542692cfc026201cdc326e9d"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":";; Be aware that the only two values considered \"logical false\" in Clojure\n;; are nil and false, where Clojure's \"false\" is the Java value Boolean/FALSE\n;; under the hood. Everything else is \"logical true\". Particularly surprising\n;; may be that the Java Object with class Boolean and value (Boolean. false) is\n;; considered logical true.\n\n;; This notion of logical true and logical false holds for at least the following\n;; conditional statements in Clojure: if, cond, when, if-let, when-let.\n;; It also applies to functions like filter, remove, and others that use\n;; these conditional statements in their implementation.\n\n;; nil and false are logical false\nuser=\u003E (if nil \"logical true\" \"logical false\")\n\"logical false\"\nuser=\u003E (if false \"logical true\" \"logical false\")\n\"logical false\"\n;; Boolean/FALSE is how Clojure's \"false\" is represented internally.\nuser=\u003E (if Boolean/FALSE \"logical true\" \"logical false\")\n\"logical false\"\n\n;; Everything else that is the value of the condition, including numbers,\n;; characters, strings, vectors, maps, _and_ a freshly constructed Boolean class\n;; object (Boolean. false), is logical true.\n\nuser=\u003E (if 1 \"logical true\" \"logical false\")\n\"logical true\"\n;; A vector containing nil is not the same as nil.\nuser=\u003E (if [nil] \"logical true\" \"logical false\")\n\"logical true\"\nuser=\u003E (if (first [nil]) \"logical true\" \"logical false\")\n\"logical false\"\n\n;; Bad idea even in Java. See below for more details.\nuser=\u003E (if (Boolean. false) \"logical true\" \"logical false\")\n\"logical true\"\n\n;; Java documentation itself warns:\n;; Note: It is rarely appropriate to use this constructor. Unless a new instance\n;; is required, the static factory valueOf(boolean) is generally a better choice.\n;; It is likely to yield significantly better space and time performance.\n\n;; (boolean x) converts a value to a primitive boolean. It converts nil, false,\n;; and (Boolean. false) to primitive false.\nuser=\u003E (if (boolean (Boolean. false)) \"logical true\" \"logical false\")\n\"logical false\"\n\n;; (Boolean/valueOf \u003Cval\u003E) is similar:\nuser=\u003E (if (Boolean/valueOf (Boolean. false)) \"logical true\" \"logical false\")\n\"logical false\"\n","created-at":1334293223000,"updated-at":1334380702000,"_id":"542692d6c026201cdc3270cc"}],"notes":null,"arglists":[],"doc":"Evaluates test.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/if"},{"ns":"clojure.core","name":"do","type":"var","see-alsos":null,"examples":[{"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; do is used to evaluate multiple expressions in order, usually for the\n;; purpose of evaluating exprs that have side-effects (such as printing\n;; or I/O). do returns the value of its last expression.\n;;\n;; do w/o args returns nil.\n\n=\u003E (do\n (println \"LOG: Computing...\")\n (+ 1 1))\nLOG: Computing...\n2\n\n=\u003E (do)\nnil\n","created-at":1287999552000,"updated-at":1287999682000,"_id":"542692cfc026201cdc326e9f"}],"notes":null,"arglists":[],"doc":"Evaluates the expressions in order and returns the value of the last. If no\nexpressions are supplied, returns nil. See http://clojure.org/special_forms\nfor more information.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/do"},{"ns":"clojure.core","name":"quote","type":"var","see-alsos":null,"examples":[{"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"editors":[{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"}],"body":";; ' is the shortcut for quote\nuser\u003E (= 'a (quote a))\ntrue\n\n;; quoting keeps something from being evaluated\nuser\u003E (quote (println \"foo\"))\n(println \"foo\")\n\n=\u003E *clojure-version*\n{:major 1, :minor 5, :incremental 0, :qualifier \"RC17\"}\n=\u003E (quote)\nnil\n=\u003E (quote 1)\n1\n=\u003E (quote 1 2 3 4 5)\n1\n=\u003E quote\nCompilerException java.lang.RuntimeException: Unable to resolve symbol: quote in this context, compiling:(NO_SOURCE_PATH:1:42)\n","created-at":1293674217000,"updated-at":1362014872000,"_id":"542692d0c026201cdc326ea2"}],"notes":[{"updated-at":1289668928000,"body":"Quote gives you the unevaluated form. That is:\r\n\r\n\u003Cpre\u003Euser=> '(foo bar baz)\u003C/pre\u003E\r\n\r\nWill not attempt to evaluate foo as a function but rather just return the data structure as is (with the three symbols unevaluated).\u003C/pre\u003E\u003C/pre\u003E","created-at":1289662273000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fa3"},{"updated-at":1371659988000,"body":"I found this blog post interesting: http://blog.8thlight.com/colin-jones/2012/05/22/quoting-without-confusion.html\r\n\r\nCheers","created-at":1371659988000,"author":{"login":"santeron","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/27a696b2606968635d5f4a5c6e2c7871?r=PG&default=identicon"},"_id":"542692edf6e94c6970522006"}],"arglists":[],"doc":"Yields the unevaluated form. See http://clojure.org/special_forms for more\ninformation.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/quote"},{"ns":"clojure.core","name":"var","type":"var","see-alsos":[{"created-at":1289212861000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"meta","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c12"},{"created-at":1289212876000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"symbol","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c13"},{"created-at":1289212908000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"symbol?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c14"},{"created-at":1289212912000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"var?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c15"},{"created-at":1349393081000,"author":{"login":"eric","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2b0c9ae6f1da9716451e7c86bc87230b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"binding","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c17"},{"created-at":1349393092000,"author":{"login":"eric","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2b0c9ae6f1da9716451e7c86bc87230b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"with-redefs","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c18"},{"created-at":1349393097000,"author":{"login":"eric","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2b0c9ae6f1da9716451e7c86bc87230b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"with-redefs-fn","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c19"},{"created-at":1349393197000,"author":{"login":"eric","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2b0c9ae6f1da9716451e7c86bc87230b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"set!","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c1a"},{"created-at":1362015211000,"author":{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"var-set","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c1b"},{"created-at":1362015214000,"author":{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"var-get","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c1c"},{"created-at":1362015219000,"author":{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"with-local-vars","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c1d"}],"examples":[{"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"editors":[],"body":";;getting meta-data for a defined symbol (as opposed to what it's pointing to.\n\nuser=\u003E meta\n#\u003Ccore$meta clojure.core$meta@2e257f1b\u003E\n\nuser=\u003E (var meta)\n#'clojure.core/meta\n\nuser=\u003E (meta (var meta))\n{:ns #\u003CNamespace clojure.core\u003E, :name meta, :file \"clojure/core.clj\", :line 178, :arglists ([obj]), :doc \"Returns the metadata of obj, returns nil if there is no metadata.\", :added \"1.0\"}\n","created-at":1289212848000,"updated-at":1289212848000,"_id":"542692d0c026201cdc326ea5"},{"author":{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},"editors":[{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"}],"body":"=\u003E *clojure-version*\n{:major 1, :minor 5, :incremental 0, :qualifier \"RC17\"}\n=\u003E var\n;CompilerException java.lang.RuntimeException: Unable to resolve symbol: var in this context, compiling:(NO_SOURCE_PATH:1:42) \n=\u003E (var)\n;CompilerException java.lang.NullPointerException, compiling:(NO_SOURCE_PATH:1:1) \n=\u003E (var 1)\n;CompilerException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.Symbol, compiling:(NO_SOURCE_PATH:1:1) \n=\u003E (var defn)\n#'clojure.core/defn\n=\u003E (var defn 1 2 3 4)\n#'clojure.core/defn\n","created-at":1362014971000,"updated-at":1362015006000,"_id":"542692d6c026201cdc3270d0"}],"notes":null,"arglists":[],"doc":"The symbol must resolve to a var, and the Var object itself (not its value)\nis returned. The reader macro #'x expands to (var x). See\nhttp://clojure.org/special_forms for more information.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/var"},{"ns":"clojure.core","name":"recur","type":"var","see-alsos":[{"created-at":1289618026000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"loop","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e3a"},{"created-at":1289618032000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"trampoline","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e3b"}],"examples":[{"author":{"login":"ique","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a06d0fc5d5b9a1d254e566c1d0e449a8?r=PG&default=identicon"},"editors":[{"login":"john.r.woodward","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/22b6fbc4a386291e45b1cb4449377086?r=PG&default=identicon"}],"body":"(def factorial\n (fn [n]\n (loop [cnt n acc 1]\n (if (zero? cnt)\n acc\n (recur (dec cnt) (* acc cnt))\n; in loop cnt will take the value (dec cnt)\n; and acc will take the value (* acc cnt)\n))))","created-at":1290256018000,"updated-at":1342658090000,"_id":"542692d0c026201cdc326ea6"},{"author":{"login":"ique","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a06d0fc5d5b9a1d254e566c1d0e449a8?r=PG&default=identicon"},"editors":[],"body":"; A loop that sums the numbers 10 + 9 + 8 + ...\n\n; Set initial values count (cnt) from 10 and down\n(loop [sum 0 cnt 10]\n ; If count reaches 0 then exit the loop and return sum\n (if (= cnt 0)\n sum\n ; Otherwise add count to sum, decrease count and \n ; use recur to feed the new values back into the loop\n (recur (+ cnt sum) (dec cnt))))","created-at":1290256169000,"updated-at":1290256169000,"_id":"542692d0c026201cdc326ea8"},{"author":{"login":"john.r.woodward","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/22b6fbc4a386291e45b1cb4449377086?r=PG&default=identicon"},"editors":[],"body":"(loop [i 0] \n (when (\u003C i 5) \n (println i) \n (recur (inc i)); loop i will take this value\n))","created-at":1342658004000,"updated-at":1342658004000,"_id":"542692d6c026201cdc3270d2"},{"author":{"login":"azkesz","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/467196a4f2498080c9740a81fcbde855?r=PG&default=identicon"},"editors":[{"login":"azkesz","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/467196a4f2498080c9740a81fcbde855?r=PG&default=identicon"}],"body":"(defn compute-across [func elements value]\n (if (empty? elements)\n value\n (recur func (rest elements) (func value (first elements)))))\n\n(defn total-of [numbers]\n (compute-across + numbers 0))\n\n(defn larger-of [x y]\n (if (\u003E x y) x y))\n\n(defn greatest-of [numbers]\n (compute-across larger-of numbers (first numbers)))","created-at":1345941881000,"updated-at":1345942092000,"_id":"542692d6c026201cdc3270d3"}],"notes":null,"arglists":[],"doc":"Evaluates the exprs in order, then, in parallel, rebinds the bindings of\nthe recursion point to the values of the exprs. See\nhttp://clojure.org/special_forms for more information.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/recur"},{"ns":"clojure.core","name":"throw","type":"var","see-alsos":[{"created-at":1341631202000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"try","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f2e"},{"created-at":1341631204000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"catch","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f2f"},{"created-at":1341631207000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"finally","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f30"}],"examples":[{"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"editors":[],"body":"=\u003E (throw (Exception. \"my exception message\"))\njava.lang.Exception: my exception message (NO_SOURCE_FILE:0)\n","created-at":1288000015000,"updated-at":1288000015000,"_id":"542692d0c026201cdc326ea9"}],"notes":null,"arglists":[],"doc":"The expr is evaluated and thrown, therefore it should yield an instance of\nsome derivee of Throwable. Please see http://clojure.org/special_forms#throw","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/throw"},{"ns":"clojure.core","name":"try","type":"var","see-alsos":[{"created-at":1287995793000,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.core","name":"catch","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f49"},{"created-at":1341631154000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"finally","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f4a"},{"created-at":1341631196000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"throw","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f4b"}],"examples":[{"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"editors":[],"body":"=\u003E (try\n (/ 1 0)\n (catch Exception e (str \"caught exception: \" (.getMessage e))))\n\n\"caught exception: Divide by zero\"","created-at":1287995834000,"updated-at":1287995834000,"_id":"542692d0c026201cdc326eaa"},{"author":{"login":"acagle","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7df8ebcd99fdbdd4a2f7682513897692?r=PG&default=identicon"},"editors":[],"body":";; for Clojurescript use js/Object as type\n(try\n (/ 1 0)\n (catch js/Object e\n (.log js/console e)))","created-at":1344400343000,"updated-at":1344400343000,"_id":"542692d6c026201cdc3270d5"}],"notes":null,"arglists":[],"doc":"The exprs are evaluated and, if no exceptions occur, the value of the last\nis returned. If an exception occurs and catch clauses are provided, each is\nexamined in turn and the first for which the thrown exception is an instance\nof the named class is considered a matching catch clause. If there is a\nmatching catch clause, its exprs are evaluated in a context in which name is\nbound to the thrown exception, and the value of the last is the return value\nof the function. If there is no matching catch clause, the exception\npropagates out of the function. Before returning, normally or abnormally,\nany finally exprs will be evaluated for their side effects. See\nhttp://clojure.org/special_forms for more information.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/try"},{"ns":"clojure.core","name":"catch","type":"var","see-alsos":[{"created-at":1287995785000,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.core","name":"try","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ad9"},{"created-at":1288000232000,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.core","name":"finally","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ada"}],"examples":[{"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"editors":[],"body":"=\u003E (try\n (/ 1 0)\n (catch Exception e (str \"caught exception: \" (.getMessage e))))\n\n\"caught exception: Divide by zero\"","created-at":1287995772000,"updated-at":1287995772000,"_id":"542692d0c026201cdc326eae"}],"notes":null,"arglists":[],"doc":"The exprs are evaluated and, if no exceptions occur, the value of the last\nis returned. If an exception occurs and catch clauses are provided, each is\nexamined in turn and the first for which the thrown exception is an instance\nof the named class is considered a matching catch clause. If there is a\nmatching catch clause, its exprs are evaluated in a context in which name is\nbound to the thrown exception, and the value of the last is the return value\nof the function. If there is no matching catch clause, the exception\npropagates out of the function. Before returning, normally or abnormally,\nany finally exprs will be evaluated for their side effects. See\nhttp://clojure.org/special_forms for more information.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/catch"},{"ns":"clojure.core","name":"finally","type":"var","see-alsos":[{"created-at":1288000213000,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.core","name":"try","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e23"},{"created-at":1288000217000,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.core","name":"catch","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e24"}],"examples":[{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[{"login":"philos99","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1de5617efb013ca7c9cf8e5646818ffa?r=PG&default=identicon"}],"body":"(try\n (/ 1 0)\n (catch ArithmeticException e (str \"caught exception: \" (.getMessage e)))\n (finally (prn \"final exception.\")))\n\"final exception.\"\n\"caught exception: Divide by zero\"","created-at":1288260604000,"updated-at":1317221828000,"_id":"542692d0c026201cdc326eaf"}],"notes":null,"arglists":[],"doc":"The exprs are evaluated and, if no exceptions occur, the value of the last\nis returned. If an exception occurs and catch clauses are provided, each is\nexamined in turn and the first for which the thrown exception is an instance\nof the named class is considered a matching catch clause. If there is a\nmatching catch clause, its exprs are evaluated in a context in which name is\nbound to the thrown exception, and the value of the last is the return value\nof the function. If there is no matching catch clause, the exception\npropagates out of the function. Before returning, normally or abnormally,\nany finally exprs will be evaluated for their side effects. See\nhttp://clojure.org/special_forms for more information.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/finally"},{"ns":"clojure.core","name":".","type":"var","see-alsos":null,"examples":null,"notes":null,"arglists":[],"doc":"The '.' special form is the basis for access to Java. It can be considered\na member-access operator, and/or read as 'in the scope of'. See\nhttp://clojure.org/special_forms for more information.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/_."},{"ns":"clojure.core","name":"set!","type":"var","see-alsos":[{"created-at":1361164008000,"author":{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"reset!","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dc5"},{"created-at":1361164022000,"author":{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"binding","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dc6"},{"created-at":1361164032000,"author":{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"alter-var-root","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dc7"}],"examples":[{"author":{"login":"ninjudd","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7ced25585a7556e9b9b975c1f9e136e3?r=PG&default=identicon"},"editors":[],"body":"(set! var-symbol expr)","created-at":1307137727000,"updated-at":1307137727000,"_id":"542692d0c026201cdc326ead"},{"author":{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},"editors":[],"body":"(set! *warn-on-reflection* true)","created-at":1361163932000,"updated-at":1361163932000,"_id":"542692d6c026201cdc3270d6"}],"notes":[{"updated-at":1298369674000,"body":"As of Clojure 1.2, the basic info for set! has moved to http://clojure.org/vars.","created-at":1298369674000,"author":{"login":"gregg-williams","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/58610a64fc8638eec8d2239d80d4046f?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fb3"}],"arglists":[],"doc":"Assignment special form. When the first operand is a field member access\nform, the assignment is to the corresponding field. If it is an instance\nfield, the instance expr will be evaluated, then the expr. In all cases\nthe value of expr is returned. Note - you cannot assign to function params\nor local bindings. Only Java fields, Vars, Refs and Agents are mutable in\nClojure. See http://clojure.org/special_forms for more information.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/set!"},{"ns":"clojure.core","name":"monitor-enter","type":"var","see-alsos":null,"examples":null,"notes":null,"arglists":[],"doc":"A synchronization primitive that should be avoided in user code. Use the\nlocking macro. See http://clojure.org/special_forms for more information.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/monitor-enter"},{"ns":"clojure.core","name":"monitor-exit","type":"var","see-alsos":null,"examples":null,"notes":null,"arglists":[],"doc":"A synchronization primitive that should be avoided in user code. Use the\nlocking macro. See http://clojure.org/special_forms for more information.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/monitor-exit"},{"ns":"clojure.core","name":"new","type":"var","see-alsos":[{"created-at":1352083329000,"author":{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":".","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bf1"}],"examples":[{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[],"body":";; Create a Java ArrayList using the 0 argument constructor\nuser=\u003E (def a (new java.util.ArrayList))\n#'user/a\nuser=\u003E (.add a \"aaa\")\ntrue\nuser=\u003E (.add a \"bbb\")\ntrue\nuser=\u003E a\n#\u003CArrayList [aaa, bbb]\u003E\n","created-at":1313491605000,"updated-at":1313491605000,"_id":"542692d0c026201cdc326eab"},{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[],"body":";; Create another ArrayList and add integers using the doto macro\nuser=\u003E (def ai (doto (new java.util.ArrayList) (.add 1) (.add 2) (.add 0)))\n#'user/ai\nuser=\u003E ai\n#\u003CArrayList [1, 2, 0]\u003E","created-at":1313491629000,"updated-at":1313491629000,"_id":"542692d0c026201cdc326eac"}],"notes":null,"arglists":[],"doc":"Instantiate a class. See http://clojure.org/java_interop#new for\nmore information.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/new"},{"ns":"clojure.core","name":"primitives-classnames","file":"clojure/core_print.clj","type":"var","column":1,"see-alsos":null,"line":372,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core/primitives-classnames"},{"added":"1.0","ns":"clojure.core","name":"+'","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":974,"examples":null,"notes":null,"arglists":["","x","x y","x y & more"],"doc":"Returns the sum of nums. (+') returns 0. Supports arbitrary precision.\n See also: +","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/+'"},{"added":"1.0","ns":"clojure.core","name":"decimal?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":3624,"examples":[{"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (decimal? 1)\nfalse\n\nuser=\u003E (decimal? 1.0)\nfalse\n\nuser=\u003E (decimal? 1M)\ntrue\n\nuser=\u003E (decimal? 99999999999999999999999999999999999)\nfalse\n\nuser=\u003E (decimal? 1.0M)\ntrue","created-at":1286508904000,"updated-at":1286508904000,"_id":"542692cbc026201cdc326bd0"}],"notes":null,"arglists":["n"],"doc":"Returns true if n is a BigDecimal","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/decimal_q"},{"added":"1.2","ns":"clojure.core","name":"restart-agent","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1326769275000,"author":{"login":"Mark","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4d7c9ac1dd03a71c7d6b548e80c9d4f9?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"agent-error","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b32"},{"created-at":1326769279000,"author":{"login":"Mark","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4d7c9ac1dd03a71c7d6b548e80c9d4f9?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"agent","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b33"}],"line":2194,"examples":null,"notes":null,"arglists":["a new-state & options"],"doc":"When an agent is failed, changes the agent state to new-state and\n then un-fails the agent so that sends are allowed again. If\n a :clear-actions true option is given, any actions queued on the\n agent that were being held while it was failed will be discarded,\n otherwise those held actions will proceed. The new-state must pass\n the validator if any, or restart will throw an exception and the\n agent will remain failed with its old state and error. Watchers, if\n any, will NOT be notified of the new state. Throws an exception if\n the agent is not failed.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/restart-agent"},{"added":"1.0","ns":"clojure.core","name":"sort-by","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1302917800000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"sort","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ca1"},{"created-at":1361334368000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"compare","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ca2"}],"line":3127,"examples":[{"author":{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (sort-by count [\"aaa\" \"bb\" \"c\"])\n(\"c\" \"bb\" \"aaa\")\n\nuser=\u003E (sort-by first [[1 2] [2 2] [2 3]]) \n([1 2] [2 2] [2 3])\n\n\u003Cpre\u003Euser=\u003E (sort-by first \u003E [[1 2] [2 2] [2 3]]) \n([2 2] [2 3] [1 2])","created-at":1281552743000,"updated-at":1332949739000,"_id":"542692cbc026201cdc326c28"},{"author":{"login":"kotarak","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5db30f607f0b5fa70d690311aa3bfd3b?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (sort-by :rank [{:rank 2} {:rank 3} {:rank 1}])\n({:rank 1} {:rank 2} {:rank 3})","created-at":1281554134000,"updated-at":1332949762000,"_id":"542692cbc026201cdc326c2a"},{"author":{"login":"shuaybi","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d1906fc5df2c8ce5b2d58cc6ea855aab?r=PG&default=identicon"},"editors":[{"login":"shuaybi","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d1906fc5df2c8ce5b2d58cc6ea855aab?r=PG&default=identicon"},{"login":"ordnungswidrig","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/47018db2b156f6c7f606950e19cf6134?r=PG&default=identicon"}],"body":"(def x [{:foo 2 :bar 11}\n {:bar 99 :foo 1}\n {:bar 55 :foo 2}\n {:foo 1 :bar 77}])\n\n;sort by :foo, and where :foo is equal, sort by :bar?\n(sort-by (juxt :foo :bar) x)\n;=\u003E({:foo 1, :bar 77} {:bar 99, :foo 1} {:foo 2, :bar 11} {:bar 55, :foo 2})","created-at":1305342274000,"updated-at":1342498171000,"_id":"542692cbc026201cdc326c2c"},{"author":{"login":"jamesqiu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bc1268deaa7f2e78fe2b5ea76e6481d8?r=PG&default=identicon"},"editors":[],"body":"(def x [{:foo 2 :bar 11}\n {:bar 99 :foo 1}\n {:bar 55 :foo 2}\n {:foo 1 :bar 77}])\n; sort-by given key order (:bar)\n(def order [55 77 99 11])\n(sort-by \n #((into {} (map-indexed (fn [i e] [e i]) order)) (:bar %)) \n x)\n;=\u003E ({:bar 55, :foo 2} {:foo 1, :bar 77} {:bar 99, :foo 1} {:foo 2, :bar 11})","created-at":1313489274000,"updated-at":1313489274000,"_id":"542692cbc026201cdc326c2f"},{"author":{"login":"Yogthos","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a2640fb40f901598b3789ac2f5c5b701?r=PG&default=identicon"},"editors":[{"login":"Yogthos","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a2640fb40f901598b3789ac2f5c5b701?r=PG&default=identicon"}],"body":";sort entries in a map by value\nuser=\u003E (sort-by val \u003E {:foo 7, :bar 3, :baz 5})\n([:foo 7] [:baz 5] [:bar 3])","created-at":1327752237000,"updated-at":1327752286000,"_id":"542692d5c026201cdc327090"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":";; Warning: You can sort a Java array and get back a sorted immutable Clojure\n;; data structure, but it will also change the input Java array, by sorting it.\n;; Copy the array before sorting if you want to avoid this.\n\nuser=\u003E (def x (to-array [32 -5 4 11]))\n#'user/x\n\nuser=\u003E (seq x)\n(32 -5 4 11)\n\nuser=\u003E (def y (sort-by - x))\n#'user/y\n\n;; Return sorted sequence\nuser=\u003E y\n(32 11 4 -5)\n\n;; but also modifies x, because it used the array to do the sorting.\nuser=\u003E (seq x)\n(32 11 4 -5)\n\n;; One way to avoid this is copying the array before sorting:\nuser=\u003E (def y (sort-by - (aclone x)))\n#'user/y","created-at":1331771914000,"updated-at":1332833698000,"_id":"542692d5c026201cdc327092"}],"notes":null,"arglists":["keyfn coll","keyfn comp coll"],"doc":"Returns a sorted sequence of the items in coll, where the sort\n order is determined by comparing (keyfn item). If no comparator is\n supplied, uses compare. comparator must implement\n java.util.Comparator. Guaranteed to be stable: equal elements will\n not be reordered. If coll is a Java array, it will be modified. To\n avoid this, sort a copy of the array.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/sort-by"},{"added":"1.0","ns":"clojure.core","name":"macroexpand","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1284957731000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"macroexpand-1","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d2e"},{"created-at":1304099187000,"author":{"login":"pauldoo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5cb916d3c8abc9f45a093209e72489fb?r=PG&default=identicon"},"to-var":{"ns":"clojure.walk","name":"macroexpand-all","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d2f"}],"line":4052,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[],"body":";; It is useful to combine macroexpand with pprint as the\n;; default output can be hard to read.\nuser=\u003E (clojure.pprint/pprint (macroexpand '(time (print \"timing\"))))\n(let*\n [start__3917__auto__\n (. java.lang.System (clojure.core/nanoTime))\n ret__3918__auto__\n (print \"timing\")]\n (clojure.core/prn\n (clojure.core/str\n \"Elapsed time: \"\n (clojure.core//\n (clojure.core/double\n (clojure.core/-\n (. java.lang.System (clojure.core/nanoTime))\n start__3917__auto__))\n 1000000.0)\n \" msecs\"))\n ret__3918__auto__)\n\n;; Even after pretty printing you may benefit from some\n;; manual cleanup.\n\n;; Also worth noting that most of the time macroexpand-1 is\n;; a better alternative to avoid over expanding down too \n;; many levels.","created-at":1286272649000,"updated-at":1286272649000,"_id":"542692ccc026201cdc326c5e"},{"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (macroexpand '(-\u003E c (+ 3) (* 2))) \n(* (clojure.core/-\u003E c (+ 3)) 2)\n","created-at":1339248908000,"updated-at":1339248908000,"_id":"542692d4c026201cdc326ff9"}],"notes":null,"arglists":["form"],"doc":"Repeatedly calls macroexpand-1 on form until it no longer\n represents a macro form, then returns it. Note neither\n macroexpand-1 nor macroexpand expand macros in subforms.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/macroexpand"},{"added":"1.0","ns":"clojure.core","name":"ensure","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1299215930000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"commute","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bfa"},{"created-at":1299215941000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ref-set","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bfb"},{"created-at":1364879934000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ref","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bfc"},{"created-at":1371688442000,"author":{"login":"juan.facorro","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d6f59d93cc17c698f16e550034a2d1ad?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"alter","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bfd"}],"line":2505,"examples":null,"notes":[{"updated-at":1299280980000,"body":"This is for preventing [write skew](http://clojure.higher-order.net/?p=50), which Clojure's concurrency model is susceptible to. If you have a transaction where several refs' values must remain in some consistent relationship to each other, but you are only writing to some of them, you should use ensure on the other refs to prevent other transactions from writing to them in the meantime.","created-at":1299215917000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fb6"}],"arglists":["ref"],"doc":"Must be called in a transaction. Protects the ref from modification\n by other transactions. Returns the in-transaction-value of\n ref. Allows for more concurrency than (ref-set ref @ref)","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/ensure"},{"ns":"clojure.core","name":"chunk-first","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":703,"examples":null,"notes":null,"tag":"clojure.lang.IChunk","arglists":["s"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core/chunk-first"},{"added":"1.7","ns":"clojure.core","name":"eduction","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":7886,"examples":null,"notes":null,"arglists":["xform* coll"],"doc":"Returns a reducible/iterable application of the transducers\n to the items in coll. Transducers are applied in order as if\n combined with comp. Note that these applications will be\n performed every time reduce/iterator is called.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/eduction"},{"added":"1.0","ns":"clojure.core","name":"tree-seq","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":4984,"examples":[{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"algal","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4b71cdf53bc76edd1a2ab66c446954b5?r=PG&default=identicon"},{"login":"algal","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4b71cdf53bc76edd1a2ab66c446954b5?r=PG&default=identicon"}],"body":";; Each node is a number or a seq, \n;; so branch?==seq? and children==identity\n;; \n;; .\n;; / \\\n;; . .\n;; /|\\ |\n;; 1 2 . 4\n;; | \n;; 3\n;;\n\nuser=\u003E (tree-seq seq? identity '((1 2 (3)) (4)))\n\n(((1 2 (3)) (4)) (1 2 (3)) 1 2 (3) 3 (4) 4)\n","created-at":1280776531000,"updated-at":1321840885000,"_id":"542692ccc026201cdc326c82"},{"author":{"login":"patazj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d790f5851d80da498e475ece4487e92?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (tree-seq map? #(interleave (keys %) (vals %)) {:a 1 :b {:c 3 :d 4 :e {:f 6 :g 7}}})\n\n({:a 1, :b {:c 3, :d 4, :e {:f 6, :g 7}}} :a 1 :b {:c 3, :d 4, :e {:f 6, :g 7}} :c 3 :d 4 :e {:f 6, :g 7} :f 6 :g 7)","created-at":1321413864000,"updated-at":1321413864000,"_id":"542692d5c026201cdc3270aa"},{"author":{"login":"algal","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4b71cdf53bc76edd1a2ab66c446954b5?r=PG&default=identicon"},"editors":[],"body":";; Each node is a (node-root child1 child2 ...),\n;; so branch?==next and children==rest\n;;\n;; A\n;; / \\\n;; B C\n;; / \\ |\n;; D E F\n;;\nuser=\u003E (map first (tree-seq next rest '(:A (:B (:D) (:E)) (:C (:F)))))\n\n(:A :B :D :E :C :F)","created-at":1321841153000,"updated-at":1321841153000,"_id":"542692d5c026201cdc3270ab"},{"author":{"login":"gregginca","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bad5f5cb177b0968d4288596691ec3cd?r=PG&default=identicon"},"editors":[],"body":";; FYI, previous example doesn't always work:\n;;\nuser\u003E (map first (tree-seq next rest '((1 2 (3)) (4))))\n((1 2 (3)) 4)\n","created-at":1334020823000,"updated-at":1334020823000,"_id":"542692d5c026201cdc3270ac"},{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (tree-seq seq? seq [[1 2 [3]] [4]])\n([[1 2 [3]] [4]])\n\nuser=\u003E (tree-seq vector? seq [[1 2 [3]] [4]])\n([[1 2 [3]] [4]] [1 2 [3]] 1 2 [3] 3 [4] 4)\n\nuser=\u003E (tree-seq seq? seq '((1 2 (3)) (4)))\n(((1 2 (3)) (4)) (1 2 (3)) 1 2 (3) 3 (4) 4)\n","created-at":1335429840000,"updated-at":1335429840000,"_id":"542692d5c026201cdc3270ad"}],"notes":null,"arglists":["branch? children root"],"doc":"Returns a lazy sequence of the nodes in a tree, via a depth-first walk.\n branch? must be a fn of one arg that returns true if passed a node\n that can have children (but may not). children must be a fn of one\n arg that returns a sequence of the children. Will only be called on\n nodes for which branch? returns true. Root is the root node of the\n tree.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/tree-seq"},{"added":"1.0","ns":"clojure.core","name":"unchecked-remainder-int","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":1254,"examples":null,"notes":null,"arglists":["x y"],"doc":"Returns the remainder of division of x by y, both int.\n Note - uses a primitive operator subject to truncation.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/unchecked-remainder-int"},{"added":"1.0","ns":"clojure.core","name":"seq","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1323104884000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"seq?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f01"},{"created-at":1350272113000,"author":{"login":"dansalmo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e33ee460f5f61bc5ba9b598934766215?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"empty?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f02"},{"created-at":1398980077000,"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"iterator-seq","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f03"}],"line":128,"examples":[{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (seq '())\nnil\n\nuser=\u003E (seq '(1))\n(1)\n\nuser=\u003E (seq \"\")\nnil\n\nuser=\u003E (seq \"abc\")\n(\\a \\b \\c)\n","created-at":1280777400000,"updated-at":1285495523000,"_id":"542692cac026201cdc326b53"},{"author":{"login":"dansalmo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e33ee460f5f61bc5ba9b598934766215?r=PG&default=identicon"},"editors":[{"login":"dansalmo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e33ee460f5f61bc5ba9b598934766215?r=PG&default=identicon"}],"body":";(seq x) is the recommended idiom for testing if a collection is not empty\nuser=\u003E (every? seq [\"1\" [1] '(1) {:1 1} #{1}])\ntrue","created-at":1350272074000,"updated-at":1350272084000,"_id":"542692d5c026201cdc327079"},{"author":{"login":"rafmagana","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/40bd727b22d74930f292b63d45a71b07?r=PG&default=identicon"},"editors":[],"body":"; seq can be used to turn a map into a list of vectors\n; notice how the list is built adding elements to the start of the list\n; not to the end, like in vectors\nuser=\u003E (seq {:key1 \"value1\" :key2 \"value2\"})\n([:key2 \"value 2\"] [:key1 \"value 1\"])","created-at":1380601368000,"updated-at":1380601368000,"_id":"542692d5c026201cdc32707b"}],"notes":null,"tag":"clojure.lang.ISeq","arglists":["coll"],"doc":"Returns a seq on the collection. If the collection is\n empty, returns nil. (seq nil) returns nil. seq also works on\n Strings, native Java arrays (of reference types) and any objects\n that implement Iterable. Note that seqs cache values, thus seq\n should not be used on any Iterable whose iterator repeatedly\n returns the same mutable object.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/seq"},{"added":"1.0","ns":"clojure.core","name":"reduce","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1289800599000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"reductions","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e01"},{"created-at":1289816968000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"apply","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e02"},{"created-at":1289816979000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"frequencies","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e03"}],"line":6947,"examples":[{"author":{"login":"cody","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/43db6edb2c82a7c76cb5b5911391f02a?r=PG&default=identicon"},"editors":[{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (reduce + [1 2 3 4 5])\n15\nuser=\u003E (reduce + [])\n0\nuser=\u003E (reduce + 1 [])\n1\nuser=\u003E (reduce + 1 [2 3])\n6","created-at":1278185820000,"updated-at":1332951412000,"_id":"542692ccc026201cdc326c36"},{"author":{"login":"jkkramer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/693b9bfd287e55741c2a4af6f7de0d72?r=PG&default=identicon"},"editors":[{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"}],"body":";converting a vector to a set\nuser=\u003E (reduce conj #{} [:a :b :c])\n#{:a :c :b}\n","created-at":1278632532000,"updated-at":1289816947000,"_id":"542692ccc026201cdc326c39"},{"author":{"login":"ghoseb","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8aa4490274249db8981283bdadb2ec2b?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},{"login":"uvtc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/34f159f89cbd1d9beac0276f5a7af552?r=PG&default=identicon"},{"login":"uvtc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/34f159f89cbd1d9beac0276f5a7af552?r=PG&default=identicon"}],"body":";; Create a word frequency map out of a large string s.\n\n;; `s` is a long string containing a lot of words :)\n(reduce #(assoc %1 %2 (inc (%1 %2 0)))\n {}\n (re-seq #\"\\w+\" s))\n\n; (This can also be done using the `frequencies` function.)\n","created-at":1279060391000,"updated-at":1343775932000,"_id":"542692ccc026201cdc326c3b"},{"author":{"login":"devijvers","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/81018e4231ac1ce8b7a9e6d377092656?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"goodmike","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/42e0998c3077ba0ac435423941a3978e?r=PG&default=identicon"},{"login":"goodmike","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/42e0998c3077ba0ac435423941a3978e?r=PG&default=identicon"},{"login":"goodmike","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/42e0998c3077ba0ac435423941a3978e?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; Calculate primes until 1000\n\nuser=\u003E (reduce\n (fn [primes number]\n (if (some zero? (map (partial mod number) primes))\n primes\n (conj primes number)))\n [2]\n (take 1000 (iterate inc 3)))\n\n[2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 503 509 521 523 541 547 557 563 569 571 577 587 593 599 601 607 613 617 619 631 641 643 647 653 659 661 673 677 683 691 701 709 719 727 733 739 743 751 757 761 769 773 787 797 809 811 821 823 827 829 839 853 857 859 863 877 881 883 887 907 911 919 929 937 941 947 953 967 971 977 983 991 997]","created-at":1279066766000,"updated-at":1285497580000,"_id":"542692ccc026201cdc326c40"},{"author":{"login":"devijvers","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/81018e4231ac1ce8b7a9e6d377092656?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; Add one sequence to another:\nuser=\u003E (reduce conj [1 2 3] [4 5 6])\n[1 2 3 4 5 6]\n","created-at":1279163552000,"updated-at":1285497592000,"_id":"542692ccc026201cdc326c46"},{"author":{"login":"gradysw","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a2d549191f2863bf87489949edebb548?r=PG&default=identicon"},"editors":[{"login":"gradysw","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a2d549191f2863bf87489949edebb548?r=PG&default=identicon"}],"body":"; Combine a set of collections into a single collection\nuser=\u003E (reduce into [[1 2 3] [:a :b :c] '([4 5] 6)])\n[1 2 3 :a :b :c [4 5] 6]","created-at":1325573490000,"updated-at":1325574121000,"_id":"542692d5c026201cdc327064"},{"author":{"login":"octopusgrabbus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fd31b8bcea99fa7b0711fbc424587774?r=PG&default=identicon"},"editors":[],"body":"(defn key-pres?\n \"This function accepts a value (cmp-val) and a vector of vectors\n (parsed output from clojure-csv) and returns the match value\n back if found and nil if not found. \n\n Using reduce, the function searches every vector row to see \n if cmp-val is at the col-idx location in the vector.\"\n\n [cmp-val cmp-idx csv-data]\n (reduce\n (fn [ret-rc csv-row]\n (if (= cmp-val (nth csv-row col-idx nil))\n (conj ret-rc cmp-val)))\n [] \n csv-data))","created-at":1334260928000,"updated-at":1334260928000,"_id":"542692d5c026201cdc327066"},{"author":{"login":"octopusgrabbus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fd31b8bcea99fa7b0711fbc424587774?r=PG&default=identicon"},"editors":[{"login":"octopusgrabbus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fd31b8bcea99fa7b0711fbc424587774?r=PG&default=identicon"}],"body":"(defn reduce-csv-row\n \"Accepts a csv-row (a vector) a list of columns to extract, \n and reduces (and returns) a csv-row to a subset based on \n selection using the values in col-nums (a vector of integer \n vector positions.)\"\n\n [csv-row col-nums]\n\n (reduce\n (fn [out-csv-row col-num]\n ; Don't consider short vectors containing junk.\n (if-not (\u003C= (count csv-row) 1)\n (conj out-csv-row (nth csv-row col-num nil))))\n []\n col-nums))\n\n","created-at":1334261221000,"updated-at":1334261450000,"_id":"542692d5c026201cdc327067"}],"notes":[{"updated-at":1278794710000,"body":"clojure.core/reduce seems to be a special case of a function that's defined twice in core.clj, and the first definition (at the line cited above: 773) is just a temporary definition; the real definition is later at line 5323, which contains the docstring.","created-at":1278794710000,"author":{"login":"JoshuaEckroth","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ef8bb10e14b41f71f8ea9ed9d66d07b7?r=PG&default=identicon"},"_id":"542692ebf6e94c6970521f80"}],"arglists":["f coll","f val coll"],"doc":"f should be a function of 2 arguments. If val is not supplied,\n returns the result of applying f to the first 2 items in coll, then\n applying f to that result and the 3rd item, etc. If coll contains no\n items, f must accept no arguments as well, and reduce returns the\n result of calling f with no arguments. If coll has only 1 item, it\n is returned and f is not called. If val is supplied, returns the\n result of applying f to val and the first item in coll, then\n applying f to that result and the 2nd item, etc. If coll contains no\n items, returns val and f is not called.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/reduce"},{"added":"1.0","ns":"clojure.core","name":"when-first","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1405367822000,"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"when-let","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b77"}],"line":4649,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (when-first [a [1 2 3]] a)\n1\nuser=\u003E (when-first [a []] a)\nnil\nuser=\u003E (when-first [a nil] a)\nnil","created-at":1280737783000,"updated-at":1332950242000,"_id":"542692cac026201cdc326b30"}],"macro":true,"notes":null,"arglists":["bindings & body"],"doc":"bindings =\u003E x xs\n\n Roughly the same as (when (seq xs) (let [x (first xs)] body)) but xs is evaluated only once","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/when-first"},{"added":"1.0","ns":"clojure.core","name":"find-ns","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1284970272000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"create-ns","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bd5"},{"created-at":1284970279000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"remove-ns","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bd6"}],"line":4152,"examples":[{"author":{"login":"teyc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bd6e62afb4881ab0f617611b8b65d003?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (require 'clojure.string)\nnil\n\nuser=\u003E (find-ns 'clojure.string)\n#<Namespace clojure.string>","created-at":1283925753000,"updated-at":1285487513000,"_id":"542692ccc026201cdc326c90"}],"notes":null,"arglists":["sym"],"doc":"Returns the namespace named by the symbol or nil if it doesn't exist.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/find-ns"},{"added":"1.1","ns":"clojure.core","name":"get-thread-bindings","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1350609423000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"bound-fn","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cbb"},{"created-at":1350609426000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"bound-fn*","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cbc"}],"line":1956,"examples":null,"notes":null,"arglists":[""],"doc":"Get a map with the Var/value pairs which is currently in effect for the\n current thread.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/get-thread-bindings"},{"added":"1.0","ns":"clojure.core","name":"contains?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1307097029000,"author":{"login":"stand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d7f9ed2753f8b3517f1539f6129f0a17?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"some","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d35"},{"created-at":1354058314000,"author":{"login":"uvtc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/34f159f89cbd1d9beac0276f5a7af552?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"get","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d36"}],"line":1498,"examples":[{"author":{"login":"Brian Marick","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a523012f661f603806ab1c22d855216f?r=PG&default=identicon"},"editors":[{"login":"Brian Marick","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a523012f661f603806ab1c22d855216f?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"Phalphalak","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a684c0fd4f27597437de953e92a15d4b?r=PG&default=identicon"},{"login":"alex_ndc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/289cf5fb7dc48bc0d1237a779b8b107?r=PG&default=identicon"}],"body":";; `contains?` is straightforward for maps:\nuser=\u003E (contains? {:a 1} :a)\ntrue\nuser=\u003E (contains? {:a nil} :a)\ntrue\nuser=\u003E (contains? {:a 1} :b)\nfalse\n\n\n;; It's likely to surprise you for other sequences because it's \n;; about *indices*, not *contents*:\n\nuser=\u003E (contains? [:a :b :c] :b)\nfalse\n\nuser=\u003E (contains? [:a :b :c] 2)\ntrue\n\nuser=\u003E (contains? \"f\" 0)\ntrue\n\nuser=\u003E (contains? \"f\" 1)\nfalse\n\n\n;; It can be applied to non-sequences:\n\nuser=\u003E (contains? 5 3)\nfalse\n\n\n;; Although lists are sequences, `contains?` seems to always return\n;; `false` for them. (Clojure 1.1)\n;;\n;; Note, this no longer works in Clojure 1.5, throwing an \n;; IllegalArgumentException.\n\nuser=\u003E (contains? '(1 2 3) 1) =\u003E false\n\n","created-at":1278821806000,"updated-at":1384273291000,"_id":"542692cdc026201cdc326d2a"},{"author":{"login":"stand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d7f9ed2753f8b3517f1539f6129f0a17?r=PG&default=identicon"},"editors":[],"body":";; Can be used to test set membership\nuser=\u003E (def s #{\"a\" \"b\" \"c\"})\n\nuser=\u003E (contains? s \"a\")\ntrue\n\nuser=\u003E (contains? s \"z\")\nfalse","created-at":1307097549000,"updated-at":1307097549000,"_id":"542692cdc026201cdc326d2f"}],"notes":[{"updated-at":1279546429000,"body":"If like me you wanted to find a value in a collection and read this article then you'll need to find an alternative. So instead of:\r\n\u003Cpre\u003E\r\n(contains (1 2 3) 1)\r\n\u003C/pre\u003E\r\nI used:\r\n\u003Cpre\u003E\r\n(some #(= 1 %) (1 2 3))\r\n\u003C/pre\u003E\r\n\r\nHope that helps.","created-at":1279546429000,"author":{"login":"robertpostill","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16aae57aa6b16e96fa81089bea6acad8?r=PG&default=identicon"},"_id":"542692ebf6e94c6970521f81"},{"updated-at":1279552212000,"body":"For collections I use the `java.util.Collection#contains()` method:\r\n\r\n\u003Cpre\u003E\r\nuser=\u003E (.contains [1 2 3] 1)\r\ntrue\r\nuser=\u003E (.contains [1 2 3] 4)\r\nfalse\r\n\u003C/pre\u003E","created-at":1279552212000,"author":{"login":"devijvers","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/81018e4231ac1ce8b7a9e6d377092656?r=PG&default=identicon"},"_id":"542692ebf6e94c6970521f82"},{"updated-at":1354058595000,"body":"As Rich points out on the ML: \r\n\r\n`contains?` tells you whether or not `get` will succeed. It is not a \"rummager\".\r\n\r\n`contains?` and `get` abstract over fast lookup.\r\n","created-at":1354058595000,"author":{"login":"uvtc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/34f159f89cbd1d9beac0276f5a7af552?r=PG&default=identicon"},"_id":"542692edf6e94c6970521ff5"},{"updated-at":1388617095000,"body":"If you have a vector or list and want to check whether a *value* is contained in it, you will find that `contains?` does not work.\r\n\r\n\u003Cpre\u003E; does not work as you might expect\r\n(contains? [:a :b :c] :b) ; = false\u003C/pre\u003E\r\n\r\nThere are four things you can try in this case:\r\n\r\n1. Consider whether you really need a vector or list. If you use a set instead, `contains?` will work.\r\n \u003Cpre\u003E(contains? #{:a :b :c} :b) ; = true\u003C/pre\u003E\r\n2. Use [`some`](http://clojuredocs.org/clojure_core/clojure.core/some) instead, wrapping the target in a set, as follows:\r\n \u003Cpre\u003E(some #{:b} [:a :b :c]) ; = :b, which is truthy\u003C/pre\u003E\r\n3. The set-as-function shortcut will not work if you might be searching for a falsy value (`false` or `nil`).\r\n \u003Cpre\u003E; will not work\r\n(some #{false} [true false true]) ; = nil\u003C/pre\u003E\r\n In that case, you will have to write the predicate function the long way:\r\n \u003Cpre\u003E(some #(= false %) [true false true]) ; = true\u003C/pre\u003E\r\n4. If you will need to do this kind of search a lot, write a function for it:\r\n \u003Cpre\u003E(defn seq-contains? [coll target] (some #(= target %) coll))\r\n(seq-contains? [true false true] false) ; = true\u003C/pre\u003E","created-at":1385323398000,"author":{"login":"roryokane","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5b2b185c814bb25f2f95a1152e58f033?r=PG&default=identicon"},"_id":"542692edf6e94c697052200f"}],"arglists":["coll key"],"doc":"Returns true if key is present in the given collection, otherwise\n returns false. Note that for numerically indexed collections like\n vectors and Java arrays, this tests if the numeric key is within the\n range of indexes. 'contains?' operates constant or logarithmic time;\n it will not perform a linear search for a value. See also 'some'.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/contains_q"},{"added":"1.0","ns":"clojure.core","name":"every?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1302013840000,"author":{"login":"pauldoo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5cb916d3c8abc9f45a093209e72489fb?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"some","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d9e"},{"created-at":1315793054000,"author":{"login":"wdkrnls","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/6d08a2f792f289b95fe1d982d4133d71?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"not-any?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d9f"}],"line":2689,"examples":[{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (every? even? '(2 4 6))\ntrue\nuser=\u003E (every? even? '(1 2 3))\nfalse","created-at":1279073869000,"updated-at":1332951153000,"_id":"542692cfc026201cdc326e56"},{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[{"login":"Rich_Morin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d4d28bd014f9e7324bad99dcc3b0d390?r=PG&default=identicon"}],"body":";; you can use every? with a set as the predicate to return true if \n;; every member of a collection is in the set\nuser=\u003E (every? #{1 2} [1 2 3])\nfalse\nuser=\u003E (every? #{1 2} [1 2])\ntrue\n\n;; or use a hash-map as the predicate with every? to return true \n;; if every member of a collection is a key within the map\nuser=\u003E (every? {1 \"one\" 2 \"two\"} [1 2])\ntrue\nuser=\u003E (every? {1 \"one\" 2 \"two\"} [1 2 3])\nfalse","created-at":1310851356000,"updated-at":1358775095000,"_id":"542692cfc026201cdc326e58"},{"author":{"login":"dkvasnicka","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/55c9f4624d94a0c87c4f4fcb7f152393?r=PG&default=identicon"},"editors":[{"login":"dkvasnicka","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/55c9f4624d94a0c87c4f4fcb7f152393?r=PG&default=identicon"}],"body":";; this is kind of weird IMO... but it works that way (the same for vectors)\nuser=\u003E (every? true? '())\ntrue\nuser=\u003E (every? false? '())\ntrue","created-at":1356575084000,"updated-at":1356575145000,"_id":"542692d3c026201cdc326fa1"}],"notes":null,"tag":"java.lang.Boolean","arglists":["pred coll"],"doc":"Returns true if (pred x) is logical true for every x in coll, else\n false.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/every_q"},{"added":"1.0","ns":"clojure.core","name":"proxy-mappings","file":"clojure/core_proxy.clj","type":"function","column":1,"see-alsos":null,"line":328,"examples":null,"notes":null,"arglists":["proxy"],"doc":"Takes a proxy instance and returns the proxy's fn map.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/proxy-mappings"},{"added":"1.2","ns":"clojure.core","name":"keep-indexed","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1324314274000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"map-indexed","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b55"},{"created-at":1337189104000,"author":{"login":"SoniaH","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/56a007a4b2c47b141bd39790278f88a7?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"keep","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b56"}],"line":7538,"examples":[{"author":{"login":"pkolloch","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/10b2fd3c0a4cc46dc241a48468dc551?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"SoniaH","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/56a007a4b2c47b141bd39790278f88a7?r=PG&default=identicon"}],"body":"user=\u003E (keep-indexed #(if (odd? %1) %2) [:a :b :c :d :e])\n(:b :d)","created-at":1282318865000,"updated-at":1337189353000,"_id":"542692c9c026201cdc326a84"},{"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (keep-indexed #(if (pos? %2) %1) [-9 0 29 -7 45 3 -8])\n(2 4 5)\n;; f takes 2 args: 'index' and 'value' where index is 0-based\n;; when f returns nil the index is not included in final result\nuser=\u003E (keep-indexed (fn [idx v]\n (if (pos? v) idx)) [-9 0 29 -7 45 3 -8])\n(2 4 5)","created-at":1292177237000,"updated-at":1292177237000,"_id":"542692c9c026201cdc326a87"},{"author":{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"},"editors":[{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"},{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"},{"login":"clojureking","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/92625b8a6be91bb8c688d0d07b4e2a32?r=PG&default=identicon"},{"login":"clojureking","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/92625b8a6be91bb8c688d0d07b4e2a32?r=PG&default=identicon"}],"body":"(defn position [x coll & {:keys [from-end all] :or {from-end false all false}}]\n (let [all-idxs (keep-indexed (fn [idx val] (when (= val x) idx)) coll)]\n (cond\n (true? from-end) (last all-idxs)\n (true? all) all-idxs\n :else (first all-idxs))))\n\nuser\u003E (position [1 1] [[1 0][1 1][2 3][1 1]])\n1\nuser\u003E (position [1 1] [[1 0][1 1][2 3][1 1]] :from-end true)\n3\nuser\u003E (position [1 1] [[1 0][1 1][2 3][1 1]] :all true)\n(1 3)\n\nuser\u003E (def foo (shuffle (range 10)))\n#'user/foo\nuser\u003E foo\n(5 8 9 1 2 7 0 6 3 4)\nuser\u003E (position 5 foo)\n0\nuser\u003E (position 0 foo)\n6","created-at":1306319468000,"updated-at":1409547666000,"_id":"542692c9c026201cdc326a88"}],"notes":null,"arglists":["f","f coll"],"doc":"Returns a lazy sequence of the non-nil results of (f index item). Note,\n this means false return values will be included. f must be free of\n side-effects. Returns a stateful transducer when no collection is\n provided.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/keep-indexed"},{"added":"1.5","ns":"clojure.core","name":"cond-\u003E\u003E","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":null,"line":7747,"examples":null,"macro":true,"notes":null,"arglists":["expr & clauses"],"doc":"Takes an expression and a set of test/form pairs. Threads expr (via -\u003E\u003E)\n through each form for which the corresponding test expression\n is true. Note that, unlike cond branching, cond-\u003E\u003E threading does not short circuit\n after the first true test expression.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/cond-\u003E\u003E"},{"added":"1.0","ns":"clojure.core","name":"subs","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1318625011000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.string","name":"replace","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f3a"},{"created-at":1318625250000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.string","name":"split","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f3b"},{"created-at":1379039766000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.string","name":"replace-first","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f3c"},{"created-at":1379039915000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"re-find","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f3d"},{"created-at":1379039920000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"re-seq","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f3e"},{"created-at":1379039970000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"re-matches","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f3f"}],"line":5034,"examples":[{"author":{"login":"citizen428","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b3881a28fe402dd2d1de44717486cae8?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (subs \"Clojure\" 1) \n\"lojure\"\nuser=\u003E (subs \"Clojure\" 1 3)\n\"lo\"\n\n\n;; String indexes have to be between 0 and (.length s)\n\nuser=\u003E (subs \"Clojure\" 1 20)\njava.lang.StringIndexOutOfBoundsException: String index out of range: 20 (NO_SOURCE_FILE:0)\n","created-at":1280470619000,"updated-at":1285496389000,"_id":"542692ccc026201cdc326cab"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":";; Note that subs uses method java.lang.String/substring\n;; http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#substring%28int,%20int%29\n\n;; See this link for more details:\n\n;; http://www.javaadvent.com/2012/12/changes-to-stringsubstring-in-java-7.html\n\n;; Briefly, before Java version 7u6, Java's substring method was\n;; guaranteed to work in O(1) time, by creating a String that refers\n;; to the original string's characters, rather than copying them.\n\n;; After Java 7u6, substring was changed to copy the string's original\n;; characters, thus taking time linear in the length of the substring,\n;; but it never refers to the original string.\n\n;; The potential disadvantage of the pre-version-7u6 behavior is that\n;; if you read in one or more strings with a large total size, and then\n;; use methods based on substring to keep only a small subset of that,\n;; e.g., because you parsed and found a small collection of substrings of\n;; interest for your computation, the large strings will still have\n;; references to them, and thus cannot be garbage collected, even if you\n;; have no other references to them.\n\n;; You can use the Java constructor (String. s) to guarantee that you\n;; copy a string s. (String. (subs s 5 20)) will copy the substring once\n;; pre-version-7u6, but it will copy the substring twice\n;; post-version-7u6.\n\n;; I believe java.util.regex.Matcher method group, and\n;; java.util.regex.Pattern method split, also have the same\n;; behavior as substring.\n\n;; This affects the behavior of Clojure functions such as:\n\n;; In clojure.core:\n;; subs, re-find, re-matches, re-seq\n;; In clojure.string:\n;; replace replace-first split\n","created-at":1379039736000,"updated-at":1379039895000,"_id":"542692d5c026201cdc32709d"}],"notes":null,"arglists":["s start","s start end"],"doc":"Returns the substring of s beginning at start inclusive, and ending\n at end (defaults to length of string), exclusive.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/subs"},{"added":"1.1","ns":"clojure.core","name":"ref-min-history","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1364770283000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ref","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c63"},{"created-at":1364770288000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ref-max-history","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c64"},{"created-at":1364770294000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ref-history-count","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c65"}],"line":2487,"examples":null,"notes":null,"arglists":["ref","ref n"],"doc":"Gets the min-history of a ref, or sets it and returns the ref","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/ref-min-history"},{"added":"1.0","ns":"clojure.core","name":"set","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1289811222000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"hash-set","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f12"},{"created-at":1289811227000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"sorted-set","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f13"},{"created-at":1289811237000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"conj","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f14"},{"created-at":1313621942000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.set","name":"join","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f15"},{"created-at":1313621949000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.set","name":"select","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f16"},{"created-at":1313621954000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.set","name":"difference","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f17"},{"created-at":1313621961000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.set","name":"intersection","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f18"},{"created-at":1313621965000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.set","name":"union","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f19"},{"created-at":1313621977000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.set","name":"index","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f1a"},{"created-at":1313621988000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.set","name":"project","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f1b"},{"created-at":1313621999000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.set","name":"rename","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f1c"},{"created-at":1313622003000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.set","name":"rename-keys","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f1d"},{"created-at":1313622018000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.set","name":"map-invert","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f1e"},{"created-at":1313622048000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"disj","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f1f"},{"created-at":1315819885000,"author":{"login":"wdkrnls","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/6d08a2f792f289b95fe1d982d4133d71?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"distinct","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f20"}],"line":4131,"examples":[{"author":{"login":"MrHus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4fa262299223e58030e9062d97224547?r=PG&default=identicon"},"editors":[{"login":"seancorfield","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9354eec0679e2d3b36b77ff62165f717?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"rafmagana","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/40bd727b22d74930f292b63d45a71b07?r=PG&default=identicon"}],"body":";; returns distinct elements\nuser=\u003E (set '(1 1 2 3 2 4 5 5))\n#{1 2 3 4 5}\n\n;; returns distinct elements (different nomenclature)\nuser=\u003E (set [1 1 2 3 2 4 5 5])\n#{1 2 3 4 5}\n\nuser=\u003E (set [1 2 3 4 5]) \n#{1 2 3 4 5}\n\nuser=\u003E (set \"abcd\")\n#{\\a \\b \\c \\d}\n\nuser=\u003E (set '(\"a\" \"b\" \"c\" \"d\"))\n#{\"a\" \"b\" \"c\" \"d\"}\n\nuser=\u003E (set {:one 1 :two 2 :three 3})\n#{[:two 2] [:three 3] [:one 1]}\n","created-at":1279417897000,"updated-at":1340286749000,"_id":"542692cbc026201cdc326bfb"},{"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"editors":[{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"}],"body":"(set [1 2 3 2 1 2 3])\n-\u003E #{1 2 3}\n\n#{:a :b :c :d}\n-\u003E #{:d :a :b :c}\n\n(hash-set :a :b :c :d)\n-\u003E #{:d :a :b :c}\n \n(sorted-set :a :b :c :d)\n-\u003E #{:a :b :c :d}\n\n;------------------------------------------------\n\n(def s #{:a :b :c :d})\n(conj s :e)\n-\u003E #{:d :a :b :e :c}\n \n(count s)\n-\u003E 4\n \n(seq s)\n-\u003E (:d :a :b :c)\n \n(= (conj s :e) #{:a :b :c :d :e})\n-\u003E true\n\n(s :b)\n-\u003E :b\n \n(s :k)\n-\u003E nil","created-at":1289811205000,"updated-at":1289811299000,"_id":"542692cbc026201cdc326bff"}],"notes":[{"updated-at":1316747546000,"body":"The documentation doesn't mention the order, is it undefined?\r\n\r\n#{:a :b :c :d}\r\n-\u003E #{:d :a :b :c}\r\n","created-at":1316747546000,"author":{"login":"icefox","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/dc848256f8954abd612cbe7e81859f91?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fce"}],"arglists":["coll"],"doc":"Returns a set of the distinct elements of coll.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/set"},{"added":"1.1","ns":"clojure.core","name":"take-last","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1306817623000,"author":{"login":"Dmitry Kakurin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/85b70be5da433a6adf5112e7140848da?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"last","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d0d"},{"created-at":1306817710000,"author":{"login":"Dmitry Kakurin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/85b70be5da433a6adf5112e7140848da?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"butlast","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d0e"},{"created-at":1306817740000,"author":{"login":"Dmitry Kakurin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/85b70be5da433a6adf5112e7140848da?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"drop-last","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d0f"}],"line":2964,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"Dmitry Kakurin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/85b70be5da433a6adf5112e7140848da?r=PG&default=identicon"}],"body":"user=\u003E (take-last 2 [1 2 3 4])\n(3 4)\n\nuser=\u003E (take-last 2 [4])\n(4)\n\nuser=\u003E (take-last 2 [])\nnil\n\nuser=\u003E (take-last 2 nil)\nnil","created-at":1280323099000,"updated-at":1306817395000,"_id":"542692cec026201cdc326de0"}],"notes":null,"arglists":["n coll"],"doc":"Returns a seq of the last n items in coll. Depending on the type\n of coll may be no better than linear time. For vectors, see also subvec.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/take-last"},{"added":"1.0","ns":"clojure.core","name":"bit-set","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":1351,"examples":[{"author":{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},"editors":[{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"}],"body":"\u003Cpre\u003Euser=> (bit-set 2r1011 2) ; index is 0-based\r\n15 \r\n;; 15 = 2r1111\r\n\u003C/pre\u003E\r\n\r\n\u003Cpre\u003E;; the same in decimal\r\nuser=> (bit-set 11 2) \r\n15 \r\n\u003C/pre\u003E","created-at":1280337241000,"updated-at":1280339131000,"_id":"542692c7c026201cdc32696f"}],"notes":null,"arglists":["x n"],"doc":"Set bit at index n","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/bit-set"},{"added":"1.7","ns":"clojure.core","name":"reader-conditional","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":7976,"examples":null,"notes":null,"arglists":["form splicing?"],"doc":"Construct a data representation of a reader conditional.\n If true, splicing? indicates read-cond-splicing.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/reader-conditional"},{"added":"1.0","ns":"clojure.core","name":"gen-class","file":"clojure/genclass.clj","type":"macro","column":1,"see-alsos":[{"created-at":1360270663000,"author":{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"proxy","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bd7"},{"created-at":1360270670000,"author":{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"gen-interface","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bd8"}],"line":518,"examples":[{"author":{"login":"devijvers","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/81018e4231ac1ce8b7a9e6d377092656?r=PG&default=identicon"},"editors":[{"login":"devijvers","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/81018e4231ac1ce8b7a9e6d377092656?r=PG&default=identicon"},{"login":"devijvers","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/81018e4231ac1ce8b7a9e6d377092656?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"(gen-class\n\t:name \"some.package.RefMap\"\n\t:implements [java.util.Map]\n\t:state \"state\"\n\t:init \"init\"\n\t:constructors {[] []}\n\t:prefix \"ref-map-\")\n\n(defn ref-map-init []\n\t[[] (ref {})])\n\n(defn ref-map-size [this]\n\t(let [state (.state this)] (.size @state)))\n\t\n(defn ref-map-isEmpty [this]\n\t(let [state (.state this)] (.isEmpty @state)))\n\n(defn ref-map-containsKey [this o]\n\t(let [state (.state this)] (.containsKey @state o)))\n\t\n(defn ref-map-containsValue [this o]\n\t(let [state (.state this)] (.containsValue @state o)))\n\t\n(defn ref-map-get [this o]\n\t(let [state (.state this)] (.get @state o)))\n\t\n(defn ref-map-keySet [this]\n\t(let [state (.state this)] (.keySet @state)))\n\t\n(defn ref-map-values [this]\n\t(let [state (.state this)] (.values @state)))\n\t\n(defn ref-map-entrySet [this]\n\t(let [state (.state this)] (.entrySet @state)))\n\t\n(defn ref-map-equals [this o]\n\t(let [state (.state this)] (.equals @state o)))\n\t\n(defn ref-map-hashCode [this]\n\t(let [state (.state this)] (.hashCode @state)))\n\t\n(defn ref-map-put [this k v]\n\t(let [state (.state this)] \n\t\t(dosync (alter state assoc k v)) v))\n\t\n(defn ref-map-putAll [this m]\n\t(let [state (.state this)]\n\t\t(doseq [[k v] (map identity m)] (.put this k v))))\n\t\t\n(defn ref-map-remove [this o]\n\t(let [state (.state this) v (get @state o)] \n\t\t(dosync (alter state dissoc o)) v))\n\t\n(defn ref-map-clear [this]\n\t(let [state (.state this)] \n\t\t(dosync (ref-set state {}))))\n\t\n(defn ref-map-toString [this]\n\t(let [state (.state this)] (.toString @state)))","created-at":1279770352000,"updated-at":1332952789000,"_id":"542692cec026201cdc326dab"},{"author":{"login":"DavidDurand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1b0513bd8cf8bc7123ab7b4e9f006786?r=PG&default=identicon"},"editors":[],"body":";; I found managing state a bit confusing at first.\n;; here's a dumb little class with a getter and setter for a \"location\" field.\n\n(ns com.example )\n\n(gen-class\n :name com.example.Demo\n :state state\n :init init\n :prefix \"-\"\n :main false\n ;; declare only new methods, not superclass methods\n :methods [[setLocation [String] void]\n [getLocation [] String]])\n\n;; when we are created we can set defaults if we want.\n(defn -init []\n \"store our fields as a hash\"\n [[] (atom {:location \"default\"})])\n\n;; little functions to safely set the fields.\n(defn setfield\n [this key value]\n (swap! (.state this) into {key value}))\n\n(defn getfield\n [this key]\n (@(.state this) key))\n\n;; \"this\" is just a parameter, not a keyword\n(defn -setLocation [this loc]\n (setfield this :location loc))\n\n(defn -getLocation\n [this]\n (getfield this :location))\n\n;; running it -- you must compile and put output on the classpath\n;; create a Demo, check the default value, then set it and check again.\nuser=\u003E (def ex (com.example.Demo.))\n#'user/ex\nuser=\u003E (.getLocation ex)\n\"default\"\nuser=\u003E (.setLocation ex \"time\")\nnil\nuser=\u003E (.getLocation ex)\n\"time\"\n","created-at":1325884685000,"updated-at":1325884685000,"_id":"542692d3c026201cdc326fbb"}],"macro":true,"notes":[{"updated-at":1280115806000,"body":"When implementing interface methods with `gen-class` (when using `:implements`) watch out for primitive return types in interface methods.\r\n\r\nWhen you get weird `NullPointerException`s or `ClassPathException`s then make sure whether the value returned by your functions can be converted by Clojure to the primitive return type defined in the interface for that method.\r\n\r\nExample:\r\n\r\nGiven:\r\n\r\n\u003Cpre\u003E\r\ninterface Test {\r\n boolean isTest();\r\n}\r\n\u003C/pre\u003E\r\n\r\nClojure implementation:\r\n\r\n\u003Cpre\u003E\r\n(gen-class :name \"MyTest\" :implements [Test])\r\n\r\n; Will throw NPE when executed, \r\n; can't be converted to boolean\r\n(defn -isTest [this] nil) \r\n\u003C/pre\u003E\r\n\r\n\u003Cpre\u003E\r\n(gen-class :name \"MyTest\" :implements [Test])\r\n\r\n; Will throw ClassCastExcpetion when executed, \r\n; can't be converted to boolean\r\n(defn -isTest [this] (Object.)) \r\n\u003C/pre\u003E","created-at":1280115806000,"author":{"login":"devijvers","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/81018e4231ac1ce8b7a9e6d377092656?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521f8a"},{"updated-at":1311325790000,"body":"When implementing an interface or extending an abstract class that implements an interface, be careful to implement all methods in the implemented interfaces. Note: The abstract class is not required to implement all methods in the interface. The clojure compiler does not throw compiler errors if you do not implement a method. A runtime error will be thrown when someone tries to use the function. The documentation suggests that you will receive UnsupportedOperationException, however in the case of the abstract class a java.lang.AbstractMethodError is thrown. \r\n\r\n**example:**\r\n\r\nLog4j appender - Extending AppenderSkeleton will fail with runtime error\r\n\u003Cpre\u003E(gen-class :name clj.TestAppender :extends org.apache.log4j.AppenderSkeleton)\r\n\r\n(defn -append [this event]\r\n (println (.getMessage event)))\r\n\u003C/pre\u003E\r\n\r\n\r\nNeed to implement close and requireLayout. These are not in AppenderSkeleton but are required by the interface Appender.\r\n\u003Cpre\u003E(gen-class :name TstAppender :extends org.apache.log4j.AppenderSkeleton)\r\n\r\n(defn -append [this event]\r\n (println (.getMessage event)))\r\n\r\n(defn -close [this]) ;nothing to clean up\r\n\r\n(defn -requireLayout [this] false)\r\n\r\n\u003C/pre\u003E\r\n\r\n\r\n","created-at":1306791528000,"author":{"login":"ckirkendall","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c29cd3a5f182e6de85cbd172fb9b5ab8?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fbf"}],"arglists":["& options"],"doc":"When compiling, generates compiled bytecode for a class with the\n given package-qualified :name (which, as all names in these\n parameters, can be a string or symbol), and writes the .class file\n to the *compile-path* directory. When not compiling, does\n nothing. The gen-class construct contains no implementation, as the\n implementation will be dynamically sought by the generated class in\n functions in an implementing Clojure namespace. Given a generated\n class org.mydomain.MyClass with a method named mymethod, gen-class\n will generate an implementation that looks for a function named by \n (str prefix mymethod) (default prefix: \"-\") in a\n Clojure namespace specified by :impl-ns\n (defaults to the current namespace). All inherited methods,\n generated methods, and init and main functions (see :methods, :init,\n and :main below) will be found similarly prefixed. By default, the\n static initializer for the generated class will attempt to load the\n Clojure support code for the class as a resource from the classpath,\n e.g. in the example case, ``org/mydomain/MyClass__init.class``. This\n behavior can be controlled by :load-impl-ns\n\n Note that methods with a maximum of 18 parameters are supported.\n\n In all subsequent sections taking types, the primitive types can be\n referred to by their Java names (int, float etc), and classes in the\n java.lang package can be used without a package qualifier. All other\n classes must be fully qualified.\n\n Options should be a set of key/value pairs, all except for :name are optional:\n\n :name aname\n\n The package-qualified name of the class to be generated\n\n :extends aclass\n\n Specifies the superclass, the non-private methods of which will be\n overridden by the class. If not provided, defaults to Object.\n\n :implements [interface ...]\n\n One or more interfaces, the methods of which will be implemented by the class.\n\n :init name\n\n If supplied, names a function that will be called with the arguments\n to the constructor. Must return [ [superclass-constructor-args] state] \n If not supplied, the constructor args are passed directly to\n the superclass constructor and the state will be nil\n\n :constructors {[param-types] [super-param-types], ...}\n\n By default, constructors are created for the generated class which\n match the signature(s) of the constructors for the superclass. This\n parameter may be used to explicitly specify constructors, each entry\n providing a mapping from a constructor signature to a superclass\n constructor signature. When you supply this, you must supply an :init\n specifier. \n\n :post-init name\n\n If supplied, names a function that will be called with the object as\n the first argument, followed by the arguments to the constructor.\n It will be called every time an object of this class is created,\n immediately after all the inherited constructors have completed.\n Its return value is ignored.\n\n :methods [ [name [param-types] return-type], ...]\n\n The generated class automatically defines all of the non-private\n methods of its superclasses/interfaces. This parameter can be used\n to specify the signatures of additional methods of the generated\n class. Static methods can be specified with ^{:static true} in the\n signature's metadata. Do not repeat superclass/interface signatures\n here.\n\n :main boolean\n\n If supplied and true, a static public main function will be generated. It will\n pass each string of the String[] argument as a separate argument to\n a function called (str prefix main).\n\n :factory name\n\n If supplied, a (set of) public static factory function(s) will be\n created with the given name, and the same signature(s) as the\n constructor(s).\n \n :state name\n\n If supplied, a public final instance field with the given name will be\n created. You must supply an :init function in order to provide a\n value for the state. Note that, though final, the state can be a ref\n or agent, supporting the creation of Java objects with transactional\n or asynchronous mutation semantics.\n\n :exposes {protected-field-name {:get name :set name}, ...}\n\n Since the implementations of the methods of the generated class\n occur in Clojure functions, they have no access to the inherited\n protected fields of the superclass. This parameter can be used to\n generate public getter/setter methods exposing the protected field(s)\n for use in the implementation.\n\n :exposes-methods {super-method-name exposed-name, ...}\n\n It is sometimes necessary to call the superclass' implementation of an\n overridden method. Those methods may be exposed and referred in \n the new method implementation by a local name.\n\n :prefix string\n\n Default: \"-\" Methods called e.g. Foo will be looked up in vars called\n prefixFoo in the implementing ns.\n\n :impl-ns name\n\n Default: the name of the current ns. Implementations of methods will be \n looked up in this namespace.\n\n :load-impl-ns boolean\n\n Default: true. Causes the static initializer for the generated class\n to reference the load code for the implementing namespace. Should be\n true when implementing-ns is the default, false if you intend to\n load the code via some other method.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/gen-class"},{"added":"1.9","ns":"clojure.core","name":"qualified-keyword?","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":1657,"examples":null,"notes":null,"arglists":["x"],"doc":"Return true if x is a keyword with a namespace","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/qualified-keyword_q"},{"added":"1.0","ns":"clojure.core","name":"while","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1360216659000,"author":{"login":"Phalphalak","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a684c0fd4f27597437de953e92a15d4b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"loop","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e4c"}],"line":6404,"examples":[{"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (def a (atom 10)) \n#'user/a\n\nuser=\u003E (while (pos? @a) (do (println @a) (swap! a dec)))\n10\n9\n8\n7\n6\n5\n4\n3\n2\n1\nnil","created-at":1280547677000,"updated-at":1332951249000,"_id":"542692ccc026201cdc326c69"}],"macro":true,"notes":null,"arglists":["test & body"],"doc":"Repeatedly executes body while test expression is true. Presumes\n some side-effect will cause test to become false/nil. Returns nil","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/while"},{"ns":"clojure.core","name":"-\u003EEduction","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":7874,"examples":null,"notes":null,"arglists":["xform coll"],"doc":"Positional factory function for class clojure.core.Eduction.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/-\u003EEduction"},{"added":"1.0","ns":"clojure.core","name":"butlast","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1289038922000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"first","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c0b"},{"created-at":1289038928000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"rest","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c0c"},{"created-at":1289038933000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"last","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c0d"},{"created-at":1289038937000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"next","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c0e"},{"created-at":1322055950000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"drop-last","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c0f"},{"created-at":1360842503000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"take-last","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c10"}],"line":274,"examples":[{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"}],"body":"user=\u003E (butlast [1 2 3])\n(1 2)\nuser=\u003E (butlast (butlast [1 2 3]))\n(1)\nuser=\u003E (butlast (butlast (butlast [1 2 3])))\nnil","created-at":1279073589000,"updated-at":1289038906000,"_id":"542692c8c026201cdc326a4c"},{"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"editors":[],"body":";really slow reverse\n;put the last item of the list at the start of a new list, and recur over all but the last item of the list.\n;butlast acts similar to next in that it returns null for a 1-item list.\n\n(defn my-reverse\n ([a-list]\n (cond (= a-list nil) nil\n :else (cons (last a-list)\n (my-reverse (butlast a-list))))))","created-at":1289038828000,"updated-at":1289038828000,"_id":"542692c8c026201cdc326a4e"}],"notes":null,"arglists":["coll"],"doc":"Return a seq of all but the last item in coll, in linear time","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/butlast"},{"added":"1.2","ns":"clojure.core","name":"satisfies?","file":"clojure/core_deftype.clj","type":"function","column":1,"see-alsos":[{"created-at":1326611358000,"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"extend","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b64"},{"created-at":1345918796000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"defprotocol","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b65"}],"line":571,"examples":[{"author":{"login":"Jeff Rose","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/567898c496278341be69087507d5ed24?r=PG&default=identicon"},"editors":[],"body":"(ns foo)\n\n(defprotocol Foo\n (foo [this]))\n\n(defprotocol Bar\n (bar [this]))\n\n(extend java.lang.Number\n Bar\n {:bar (fn [this] 42)})\n\n(extend java.lang.String\n Foo\n {:foo (fn [this] \"foo\")}\n Bar\n {:bar (fn [this] \"forty two\")})\n\n(satisfies? Foo \"zam\") ; =\u003E true\n(satisfies? Bar \"zam\") ; =\u003E true\n(satisfies? Foo 123) ; =\u003E false\n(satisfies? Bar 123) ; =\u003E true","created-at":1294900425000,"updated-at":1294900425000,"_id":"542692cfc026201cdc326e5a"}],"notes":null,"arglists":["protocol x"],"doc":"Returns true if x satisfies the protocol","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/satisfies_q"},{"added":"1.0","ns":"clojure.core","name":"line-seq","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":3093,"examples":[{"author":{"login":"juergenhoetzel","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2736dfffc803c704dcf25b45ff63cede?r=PG&default=identicon"},"editors":[{"login":"juergenhoetzel","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2736dfffc803c704dcf25b45ff63cede?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; Count lines of a file (loses head):\nuser=\u003E (with-open [rdr (clojure.java.io/reader \"/etc/passwd\")]\n (count (line-seq rdr)))\n\n","created-at":1279948343000,"updated-at":1285497370000,"_id":"542692cec026201cdc326de3"},{"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"editors":[],"body":"(import '(java.io BufferedReader StringReader))\n\n;; line terminators are stripped\nuser=\u003E (line-seq (BufferedReader. (StringReader. \"1\\n2\\n\\n3\")))\n(\"1\" \"2\" \"\" \"3\")\n\n;; empty string gives nil\nuser=\u003E (line-seq (BufferedReader. (StringReader. \"\")))\nnil\n","created-at":1301874056000,"updated-at":1301874056000,"_id":"542692cec026201cdc326de7"}],"notes":null,"arglists":["rdr"],"doc":"Returns the lines of text from rdr as a lazy sequence of strings.\n rdr must implement java.io.BufferedReader.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/line-seq"},{"added":"1.0","ns":"clojure.core","name":"unchecked-subtract-int","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":1219,"examples":null,"notes":null,"arglists":["x y"],"doc":"Returns the difference of x and y, both int.\n Note - uses a primitive operator subject to overflow.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/unchecked-subtract-int"},{"added":"1.9","ns":"clojure.core","name":"*print-namespace-maps*","file":"clojure/core_print.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":41,"examples":null,"notes":null,"arglists":[],"doc":"*print-namespace-maps* controls whether the printer will print\n namespace map literal syntax. It defaults to false, but the REPL binds\n to true.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/*print-namespace-maps*"},{"added":"1.0","ns":"clojure.core","name":"take-nth","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":4314,"examples":[{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (take-nth 2 (range 10))\n(0 2 4 6 8)\n","created-at":1280776443000,"updated-at":1285495759000,"_id":"542692cec026201cdc326dd9"}],"notes":null,"arglists":["n","n coll"],"doc":"Returns a lazy seq of every nth item in coll. Returns a stateful\n transducer when no collection is provided.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/take-nth"},{"added":"1.0","ns":"clojure.core","name":"first","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1289038142000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"rest","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f64"},{"created-at":1289038147000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"next","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f65"},{"created-at":1303125616000,"author":{"login":"Havvy","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e799a79441c7543be48562403411cd13?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"nth","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f66"},{"created-at":1303125622000,"author":{"login":"Havvy","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e799a79441c7543be48562403411cd13?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"second","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f67"},{"created-at":1328341708000,"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"take","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f68"},{"created-at":1348637402000,"author":{"login":"dansalmo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e33ee460f5f61bc5ba9b598934766215?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ffirst","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f69"}],"line":49,"examples":[{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (first '(:alpha :bravo :charlie))\n:alpha","created-at":1279071245000,"updated-at":1332951216000,"_id":"542692ccc026201cdc326c6c"},{"author":{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},"editors":[{"login":"jszakmeister","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/69ad2af1f028b1b7e76c14f83bdf26cb?r=PG&default=identicon"}],"body":"user=\u003E (first nil)\nnil\nuser=\u003E (first [])\nnil","created-at":1303680354000,"updated-at":1335629937000,"_id":"542692ccc026201cdc326c6e"}],"notes":null,"arglists":["coll"],"doc":"Returns the first item in the collection. Calls seq on its\n argument. If coll is nil, returns nil.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/first"},{"added":"1.0","ns":"clojure.core","name":"re-groups","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1282039215000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"re-find","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e6a"}],"line":4911,"examples":[{"author":{"login":"OnesimusUnbound","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fa4c391db0d2d1744cc2cd0d787dd3d?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (def phone-number \"672-345-456-3212\")\n#'user/phone-number\n\nuser=\u003E (def matcher (re-matcher #\"((\\d+)-(\\d+))\" phone-number))\n#'user/matcher\n\nuser=\u003E (re-find matcher)\n[\"672-345\" \"672-345\" \"672\" \"345\"]\n\n;; re-groups gets the most recent find or matches\nuser=\u003E (re-groups matcher)\n[\"672-345\" \"672-345\" \"672\" \"345\"]\nuser=\u003E (re-groups matcher)\n[\"672-345\" \"672-345\" \"672\" \"345\"]\n\n\nuser=\u003E (re-find matcher)\n[\"456-3212\" \"456-3212\" \"456\" \"3212\"]\n\nuser=\u003E (re-groups matcher)\n[\"456-3212\" \"456-3212\" \"456\" \"3212\"]\nuser=\u003E (re-groups matcher)\n[\"456-3212\" \"456-3212\" \"456\" \"3212\"]\n\n\nuser=\u003E (re-find matcher)\nnil\n\nuser=\u003E (re-groups matcher)\nIllegalStateException No match found java.util.regex.Matcher.group (Matcher.java:468)","created-at":1312374649000,"updated-at":1312374649000,"_id":"542692c9c026201cdc326a7f"}],"notes":null,"arglists":["m"],"doc":"Returns the groups from the most recent match/find. If there are no\n nested groups, returns a string of the entire match. If there are\n nested groups, returns a vector of the groups, the first element\n being the entire match.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/re-groups"},{"added":"1.0","ns":"clojure.core","name":"seq?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1286870491000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"seq","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bc7"},{"created-at":1304804140000,"author":{"login":"0x89","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/56bc4acd59315ed4dc1cb99c3be71102?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"sequential?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bc8"},{"created-at":1304804146000,"author":{"login":"0x89","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/56bc4acd59315ed4dc1cb99c3be71102?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"vector?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bc9"},{"created-at":1304804161000,"author":{"login":"0x89","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/56bc4acd59315ed4dc1cb99c3be71102?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"coll?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bca"},{"created-at":1304804189000,"author":{"login":"0x89","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/56bc4acd59315ed4dc1cb99c3be71102?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"list?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bcb"},{"created-at":1304804202000,"author":{"login":"0x89","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/56bc4acd59315ed4dc1cb99c3be71102?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"map?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bcc"},{"created-at":1304804206000,"author":{"login":"0x89","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/56bc4acd59315ed4dc1cb99c3be71102?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"set?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bcd"}],"line":148,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[],"body":"user\u003E (seq? 1)\nfalse\nuser\u003E (seq? [1])\nfalse\nuser\u003E (seq? (seq [1]))\ntrue","created-at":1286870431000,"updated-at":1286870431000,"_id":"542692c8c026201cdc326a5e"},{"author":{"login":"gregginca","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bad5f5cb177b0968d4288596691ec3cd?r=PG&default=identicon"},"editors":[],"body":";; contrast to example code for sequential?\n;;\nuser\u003E (seq? '(1 2 3))\ntrue\nuser\u003E (seq? [1 2 3]) ; for sequential?, returns true\nfalse\nuser\u003E (seq? (range 1 5))\ntrue\nuser\u003E (seq? 1)\nfalse\nuser\u003E (seq? {:a 2 :b 1})\nfalse\nuser\u003E ","created-at":1334018590000,"updated-at":1334018590000,"_id":"542692d5c026201cdc32707c"}],"notes":null,"arglists":["x"],"doc":"Return true if x implements ISeq","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/seq_q"},{"added":"1.0","ns":"clojure.core","name":"dec'","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":1149,"examples":[{"author":{"login":"szemek","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/78b14dbb96afe3befc04757dc5e06225?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (dec' 0.1)\n-0.9\n\nuser=\u003E (dec' 1)\n0\n\nuser=\u003E (dec' 1.0)\n0.0","created-at":1335130392000,"updated-at":1335130392000,"_id":"542692d2c026201cdc326f77"}],"notes":null,"arglists":["x"],"doc":"Returns a number one less than num. Supports arbitrary precision.\n See also: dec","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/dec'"},{"added":"1.0","ns":"clojure.core","name":"ns-unmap","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1288683645000,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.core","name":"remove-ns","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d33"},{"created-at":1341280172000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ns-map","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d34"}],"line":4204,"examples":[{"author":{"login":"james","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4b163432c99a124feee4be046a3f9d66?r=PG&default=identicon"},"editors":[{"login":"mde","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/61292ea4b013ef2834a28f9ff390c6fd?r=PG&default=identicon"}],"body":"user=\u003E (def foo 1)\n#'user/foo\n\nuser=\u003E foo\n1\n\nuser=\u003E (ns-unmap 'user 'foo) ; explicit\nnil\n\nuser=\u003E (ns-unmap *ns* 'foo) ; convenient\nnil\n\nuser=\u003E foo\n\"Unable to resolve symbol: foo in this context\"\n","created-at":1290213451000,"updated-at":1335243941000,"_id":"542692c7c026201cdc3269a3"}],"notes":null,"arglists":["ns sym"],"doc":"Removes the mappings for the symbol from the namespace.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/ns-unmap"},{"added":"1.0","ns":"clojure.core","name":"println-str","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1318573842000,"author":{"login":"haplo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/890d46f8c0e24dd6fb8546095b1144e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"println","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e07"},{"created-at":1374264235000,"author":{"login":"lbeschastny","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/416170465e4045f810f09a9300dda4dd?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"print-str","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e08"}],"line":4812,"examples":[{"author":{"login":"Miles","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bbb26d2a5e856c4fba0f72c3f7250f3f?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"Miles","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bbb26d2a5e856c4fba0f72c3f7250f3f?r=PG&default=identicon"},{"login":"philos99","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1de5617efb013ca7c9cf8e5646818ffa?r=PG&default=identicon"},{"login":"philos99","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1de5617efb013ca7c9cf8e5646818ffa?r=PG&default=identicon"},{"login":"matthewg","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b29dd31d183124d9e87d8037bb30e326?r=PG&default=identicon"}],"body":";; Create a newline-terminated string from the items and store it in x.\nuser=\u003E (def x (println-str 1 \"foo\" \\b \\a \\r {:a 2}))\n#'user/x\n\n;; It's a string.\nuser=\u003E (string? x)\ntrue\n\n;; Notice that the items are separated by a space. Also, the newline string is\n;; platform-specific. See clojure.core/newline.\nuser=\u003E x\n\"1 foo b a r {:a 2}\\r\\n\"\n","created-at":1284257337000,"updated-at":1323234147000,"_id":"542692cfc026201cdc326e4c"}],"notes":null,"tag":"java.lang.String","arglists":["& xs"],"doc":"println to a string, returning it","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/println-str"},{"added":"1.1","ns":"clojure.core","name":"with-bindings*","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1374313837000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"with-bindings","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bb4"}],"line":1990,"examples":[{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (let [f (fn [] *warn-on-reflection*)]\n (with-bindings* {#'*warn-on-reflection* true} f))\ntrue","created-at":1335591761000,"updated-at":1335591761000,"_id":"542692d6c026201cdc3270b8"}],"notes":null,"arglists":["binding-map f & args"],"doc":"Takes a map of Var/value pairs. Installs for the given Vars the associated\n values as thread-local bindings. Then calls f with the supplied arguments.\n Pops the installed bindings after f returned. Returns whatever f returns.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/with-bindings*"},{"added":"1.9","ns":"clojure.core","name":"inst-ms","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":6916,"examples":null,"notes":null,"arglists":["inst"],"doc":"Return the number of milliseconds since January 1, 1970, 00:00:00 GMT","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/inst-ms"},{"added":"1.0","ns":"clojure.core","name":"iterator-seq","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1398980083000,"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"seq","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e96"}],"line":5774,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; Note this is not strictly necessary since keySet is a collection\n;; implementing Iterable but it does show the usage.\n\nuser=\u003E (iterator-seq (.iterator (.keySet (java.lang.System/getProperties))))\n\n(\"java.runtime.name\" \"sun.boot.library.path\" \"java.vm.version\" \"java.vm.vendor\" \"java.vendor.url\" \"path.separator\" \"java.vm.name\" \"file.encoding.pkg\" \"sun.java.launcher\" \"user.country\" \"sun.os.patch.level\" \"java.vm.specification.name\" \"user.dir\" \"java.runtime.version\" \"java.awt.graphicsenv\" \"java.endorsed.dirs\" \"os.arch\" \"javax.accessibility.assistive_technologies\" \"java.io.tmpdir\" \"line.separator\" \"java.vm.specification.vendor\" \"os.name\" \"cljr.home\" \"sun.jnu.encoding\" \"java.library.path\" \"java.specification.name\" \"java.class.version\" \"sun.management.compiler\" \"os.version\" \"user.home\" \"user.timezone\" \"java.awt.printerjob\" \"file.encoding\" \"java.specification.version\" \"include.cljr.repo.jars\" \"java.class.path\" \"user.name\" \"java.vm.specification.version\" \"java.home\" \"sun.arch.data.model\" \"user.language\" \"java.specification.vendor\" \"java.vm.info\" \"java.version\" \"java.ext.dirs\" \"sun.boot.class.path\" \"java.vendor\" \"file.separator\" \"java.vendor.url.bug\" \"clojure.home\" \"sun.io.unicode.encoding\" \"sun.cpu.endian\" \"sun.desktop\" \"sun.cpu.isalist\")\n","created-at":1284711960000,"updated-at":1287995124000,"_id":"542692cdc026201cdc326d15"}],"notes":[{"updated-at":1287834466000,"body":"I've noticed that I needed to use iterator-seq when trying to map over a Java function that returns an AbstractList Iterator. It was not directly seq-able.","created-at":1287834466000,"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521f9d"}],"arglists":["iter"],"doc":"Returns a seq on a java.util.Iterator. Note that most collections\n providing iterators implement Iterable and thus support seq directly.\n Seqs cache values, thus iterator-seq should not be used on any\n iterator that repeatedly returns the same mutable object.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/iterator-seq"},{"added":"1.0","ns":"clojure.core","name":"iterate","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1291953286000,"author":{"login":"alimoeeny","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e8dd06976ead4082d2181f3807117e1?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"cycle","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b0d"},{"created-at":1335482527000,"author":{"login":"metajack","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/194d8437f5baed192c90be27369c4922?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"repeatedly","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b0e"},{"created-at":1343152603000,"author":{"login":"john.r.woodward","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/22b6fbc4a386291e45b1cb4449377086?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"repeat","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b0f"}],"line":3036,"examples":[{"author":{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},"editors":[{"login":"devijvers","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/81018e4231ac1ce8b7a9e6d377092656?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"rafmagana","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/40bd727b22d74930f292b63d45a71b07?r=PG&default=identicon"},{"login":"rafmagana","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/40bd727b22d74930f292b63d45a71b07?r=PG&default=identicon"},{"login":"rafmagana","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/40bd727b22d74930f292b63d45a71b07?r=PG&default=identicon"},{"login":"rafmagana","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/40bd727b22d74930f292b63d45a71b07?r=PG&default=identicon"}],"body":";; iterate Ad Infinitum starting at 5 using the inc (increment) function\nuser=\u003E (iterate inc 5)\n(5 6 7 8 9 10 11 12 13 14 15 ... n\n\n;; limit results\nuser=\u003E (take 5 (iterate inc 5))\n(5 6 7 8 9)\n\nuser=\u003E (take 10 (iterate (partial + 2) 0))\n(0 2 4 6 8 10 12 14 16 18)\n\nuser=\u003E (take 20 (iterate (partial + 2) 0))\n(0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38)\n\n","created-at":1279048785000,"updated-at":1340444430000,"_id":"542692cac026201cdc326b22"},{"author":{"login":"citizen428","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b3881a28fe402dd2d1de44717486cae8?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (def powers-of-two (iterate (partial * 2) 1))\n#'user/powers-of-two\n\nuser=\u003E (nth powers-of-two 10)\n1024\nuser=\u003E (take 10 powers-of-two)\n(1 2 4 8 16 32 64 128 256 512)\n","created-at":1280707793000,"updated-at":1285496060000,"_id":"542692cac026201cdc326b29"},{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},{"login":"Bobby","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c0541baac8a638e07f5895c7224f8b7e?r=PG&default=identicon"},{"login":"Bobby","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c0541baac8a638e07f5895c7224f8b7e?r=PG&default=identicon"},{"login":"maacl","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8ff89765136c38707e0f57cf48679a13?r=PG&default=identicon"}],"body":";; demonstrating the power of iterate\n;; to generate the Fibonacci sequence\n;; uses +' to promote to BigInt\nuser=\u003E (def fib (map first (iterate (fn [[a b]] [b (+' a b)]) [0 1])))\n#'user/fib\n\nuser=\u003E (take 10 fib)\n(0 1 1 2 3 5 8 13 21 34)","created-at":1310850870000,"updated-at":1388690059000,"_id":"542692cac026201cdc326b2b"}],"notes":null,"arglists":["f x"],"doc":"Returns a lazy (infinite!) sequence of x, (f x), (f (f x)) etc.\n f must be free of side-effects","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/iterate"},{"added":"1.0","ns":"clojure.core","name":"slurp","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1330170507000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.java.io","name":"reader","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521efd"},{"created-at":1314301885000,"author":{"login":"Havvy","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e799a79441c7543be48562403411cd13?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"spit","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f54"}],"line":7089,"examples":[{"author":{"login":"pkolloch","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/10b2fd3c0a4cc46dc241a48468dc551?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (spit \"blubber.txt\" \"test\")\nnil\nuser=\u003E (slurp \"blubber.txt\")\n\"test\"","created-at":1280458838000,"updated-at":1332952657000,"_id":"542692cac026201cdc326b32"},{"author":{"login":"OnesimusUnbound","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fa4c391db0d2d1744cc2cd0d787dd3d?r=PG&default=identicon"},"editors":[],"body":";; To access web page. Note the use of http://\n;; prefix\n\nuser=\u003E (slurp \"http://clojuredocs.org\")\n; This will return the html content of clojuredocs.org","created-at":1314221982000,"updated-at":1314221982000,"_id":"542692cac026201cdc326b34"},{"author":{"login":"Havvy","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e799a79441c7543be48562403411cd13?r=PG&default=identicon"},"editors":[],"body":";; Access absolute location on Windows\n\nuser=\u003E (slurp \"C:\\\\tasklists.xml\")\n","created-at":1314301837000,"updated-at":1314301837000,"_id":"542692cac026201cdc326b35"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[],"body":";; On Linux, some JVMs have a bug where they cannot read a file in the /proc\n;; filesystem as a buffered stream or reader. A workaround to this JVM issue\n;; is to open such a file as unbuffered:\n(slurp (java.io.FileReader. \"/proc/cpuinfo\"))","created-at":1330170476000,"updated-at":1330170476000,"_id":"542692d5c026201cdc327086"},{"author":{"login":"nils.grunwald","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/6c7661b3ea6397abbf5a2048ee07d995?r=PG&default=identicon"},"editors":[{"login":"nils.grunwald","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/6c7661b3ea6397abbf5a2048ee07d995?r=PG&default=identicon"},{"login":"nils.grunwald","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/6c7661b3ea6397abbf5a2048ee07d995?r=PG&default=identicon"}],"body":";; You can specify what encoding to use by giving a :encoding param, and an encoding string recognized by your JVM\n\nuser=\u003E (slurp \"/path/to/file\" :encoding \"ISO-8859-1\")","created-at":1342145976000,"updated-at":1342146268000,"_id":"542692d5c026201cdc327087"}],"notes":[{"updated-at":1309555971000,"body":"Use slurp also to read an input stream into a string.","created-at":1309555971000,"author":{"login":"mjg123","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2d7180cd610e068c47d3ba7337f1425c?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fc3"},{"updated-at":1387184994000,"body":"With link: “See [`clojure.java.io/reader`](http://clojuredocs.org/clojure_core/clojure.java.io/reader) for a complete list of supported arguments.�\r\n\r\nAccording to those docs, here are the supported types for `f`, the object to read:\r\n\r\n* [`Reader`](http://docs.oracle.com/javase/7/docs/api/java/io/Reader.html)\r\n* [`BufferedReader`](http://docs.oracle.com/javase/7/docs/api/java/io/BufferedReader.html)\r\n* [`InputStream`](http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html)\r\n* [`File`](http://docs.oracle.com/javase/7/docs/api/java/io/File.html)\r\n* [`URI`](http://docs.oracle.com/javase/7/docs/api/java/net/URI.html)\r\n* [`URL`](http://docs.oracle.com/javase/7/docs/api/java/net/URL.html)\r\n* [`Socket`](http://docs.oracle.com/javase/7/docs/api/java/net/Socket.html)\r\n* byte arrays (`byte[]`)\r\n* character arrays (`char[]`)\r\n* [`String`](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)\r\n\r\n`slurp` can read objects of any of these types into a string.","created-at":1387183993000,"author":{"login":"roryokane","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5b2b185c814bb25f2f95a1152e58f033?r=PG&default=identicon"},"_id":"542692edf6e94c6970522015"}],"tag":"java.lang.String","arglists":["f & opts"],"doc":"Opens a reader on f and reads all its contents, returning a string.\n See clojure.java.io/reader for a complete list of supported arguments.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/slurp"},{"added":"1.0","ns":"clojure.core","name":"newline","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":3723,"examples":[{"author":{"login":"jjcomer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ef581bba2f97adb539c67a35465b3e1b?r=PG&default=identicon"},"editors":[{"login":"cloojure","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1ad3de25d00d953de6e8c82f554cdbf5?r=PG&default=identicon"}],"body":";; This is equivalent to System.out.println() in Java\nuser=\u003E (newline)\n\nnil\n; Calling println w/o args is equivalent.\nuser=\u003E (println)\n\nnil\nuser=\u003E","created-at":1330655016000,"updated-at":1402384428000,"_id":"542692d4c026201cdc327012"}],"notes":null,"arglists":[""],"doc":"Writes a platform-specific newline to *out*","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/newline"},{"added":"1.1","ns":"clojure.core","name":"short-array","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1342917718000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"shorts","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ad6"}],"line":5362,"examples":[{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"}],"body":";; create an array of shorts using short-array\n;; and demonstrate how it can be used with the java Arrays functions\n;; (note the needed coercions)\n\nuser=\u003E (def ss (short-array (map short (range 3 10))))\n#'user/ss\nuser=\u003E (type ss)\n[S\nuser=\u003E (vec ss)\n[3 4 5 6 7 8 9]\nuser=\u003E (java.util.Arrays/binarySearch ss (short 6))\n3\nuser=\u003E (java.util.Arrays/fill ss (short 99))\nnil\nuser=\u003E (vec ss)\n[99 99 99 99 99 99 99]\nuser=\u003E","created-at":1313908642000,"updated-at":1313962982000,"_id":"542692c7c026201cdc326987"}],"notes":null,"arglists":["size-or-seq","size init-val-or-seq"],"doc":"Creates an array of shorts","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/short-array"},{"added":"1.0","ns":"clojure.core","name":"fn?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1321052077000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ifn?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b3c"}],"line":6293,"examples":[{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[{"login":"Dmitry Kakurin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/85b70be5da433a6adf5112e7140848da?r=PG&default=identicon"},{"login":"replore","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e7869fe1a48cb1814c657eaca6bea3eb?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (fn? 5)\nfalse\nuser=\u003E (fn? inc)\ntrue\nuser=\u003E (fn? (fn []))\ntrue\nuser=\u003E (fn? #(5))\ntrue","created-at":1279073964000,"updated-at":1332952252000,"_id":"542692c6c026201cdc3268f8"},{"author":{"login":"Dmitry Kakurin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/85b70be5da433a6adf5112e7140848da?r=PG&default=identicon"},"editors":[{"login":"Dmitry Kakurin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/85b70be5da433a6adf5112e7140848da?r=PG&default=identicon"},{"login":"Dmitry Kakurin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/85b70be5da433a6adf5112e7140848da?r=PG&default=identicon"},{"login":"Dmitry Kakurin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/85b70be5da433a6adf5112e7140848da?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; Even though maps, sets, vectors and keywords behave as functions:\nuser=\u003E ({:a 1} :a)\n1\n\n;; fn? still returns false for them because they are not created using fn:\nuser=\u003E (fn? {:a 1})\nfalse\n","created-at":1279155323000,"updated-at":1285500252000,"_id":"542692c6c026201cdc3268fc"}],"notes":null,"arglists":["x"],"doc":"Returns true if x implements Fn, i.e. is an object created via fn.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/fn_q"},{"added":"1.0","ns":"clojure.core","name":"doall","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1289672752000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"dorun","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521a8b"},{"created-at":1289672768000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"doseq","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521a8c"}],"line":3156,"examples":[{"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"editors":[{"login":"philos99","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1de5617efb013ca7c9cf8e5646818ffa?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},{"login":"orivej","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cab90c7de5efde92a29f1eacb603ba9a?r=PG&default=identicon"}],"body":";; Nothing is printed because map returns a lazy-seq\nuser=\u003E (def foo (map println [1 2 3]))\n#'user/foo\n\n;; doall forces the seq to be realized\nuser=\u003E (def foo (doall (map println [1 2 3])))\n1\n2\n3\n#'user/foo\n\n;; where\n(doall (map println [1 2 3]))\n1\n2\n3\n(nil nil nil)","created-at":1280548280000,"updated-at":1362554691000,"_id":"542692cbc026201cdc326ba2"}],"notes":[{"updated-at":1341951212000,"body":"Shouldn't we use seq instead of coll in the function signature since we should really pass a sequence?","created-at":1341951200000,"author":{"login":"johnnyluu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1ba99f2dc1064733c7badbb16db9254a?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fe5"},{"updated-at":1390120527000,"body":"'seq' is a function; using it in the function args as a value would shadow the function (and thereby making the function seq unusable in that scope)","created-at":1390120527000,"author":{"login":"zephjc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/47639b1aa7a7ccb90000a3ea12b84d7e?r=PG&default=identicon"},"_id":"542692edf6e94c697052201a"}],"arglists":["coll","n coll"],"doc":"When lazy sequences are produced via functions that have side\n effects, any effects other than those needed to produce the first\n element in the seq do not occur until the seq is consumed. doall can\n be used to force any effects. Walks through the successive nexts of\n the seq, retains the head and returns it, thus causing the entire\n seq to reside in memory at one time.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/doall"},{"added":"1.0","ns":"clojure.core","name":"prefers","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1337584993000,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"prefer-method","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b6f"},{"created-at":1337585000000,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"methods","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b70"},{"created-at":1337585004000,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"get-method","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b71"}],"line":1841,"examples":null,"notes":null,"arglists":["multifn"],"doc":"Given a multimethod, returns a map of preferred value -\u003E set of other values","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/prefers"},{"added":"1.0","ns":"clojure.core","name":"enumeration-seq","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":5784,"examples":[{"author":{"login":"leifp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d2f37720f063404ef83b987d2824353d?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (enumeration-seq (java.util.StringTokenizer. \"exciting example\"))\n(\"exciting\" \"example\")\n","created-at":1342527173000,"updated-at":1342527173000,"_id":"542692d2c026201cdc326f9d"}],"notes":null,"arglists":["e"],"doc":"Returns a seq on a java.util.Enumeration","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/enumeration-seq"},{"added":"1.7","ns":"clojure.core","name":"dedupe","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":7847,"examples":null,"notes":null,"arglists":["","coll"],"doc":"Returns a lazy sequence removing consecutive duplicates in coll.\n Returns a transducer when no collection is provided.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/dedupe"},{"added":"1.0","ns":"clojure.core","name":"dissoc","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1293866784000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"assoc","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c5a"},{"created-at":1351064004000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"disj","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c5c"},{"created-at":1367625873000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"select-keys","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c5d"}],"line":1519,"examples":[{"author":{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},"editors":[],"body":"\u003Cpre\u003Euser=> (dissoc {:a 1 :b 2 :c 3}) ; dissoc nothing \r\n{:a 1, :b 2, :c 3} \r\n\r\nuser=> (dissoc {:a 1 :b 2 :c 3} :b) ; dissoc key :b\r\n{:a 1, :c 3} \r\n\r\nuser=> (dissoc {:a 1 :b 2 :c 3} :d) ; dissoc not existed key\r\n{:a 1, :b 2, :c 3} \r\n\r\nuser=> (dissoc {:a 1 :b 2 :c 3} :c :b) ; several keys at once\r\n{:a 1} \r\n\u003C/pre\u003E\r\n","created-at":1280340610000,"updated-at":1280340610000,"_id":"542692cfc026201cdc326e63"}],"notes":null,"arglists":["map","map key","map key & ks"],"doc":"dissoc[iate]. Returns a new map of the same (hashed/sorted) type,\n that does not contain a mapping for key(s).","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/dissoc"},{"added":"1.0","ns":"clojure.core","name":"atom","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1281849237000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"reset!","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521eeb"},{"created-at":1281849248000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"swap!","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521eec"},{"created-at":1341623864000,"author":{"login":"johnnyluu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1ba99f2dc1064733c7badbb16db9254a?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"compare-and-set!","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521eed"},{"created-at":1349392634000,"author":{"login":"eric","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2b0c9ae6f1da9716451e7c86bc87230b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"add-watch","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521eee"},{"created-at":1349392638000,"author":{"login":"eric","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2b0c9ae6f1da9716451e7c86bc87230b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"remove-watch","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521eef"},{"created-at":1364873735000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"set-validator!","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ef0"}],"line":2344,"examples":[{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (def my-atom (atom 0))\n#'user/my-atom\n\nuser=\u003E @my-atom\n0\n\nuser=\u003E (swap! my-atom inc)\n1\n\nuser=\u003E @my-atom\n1\n\nuser=\u003E (swap! my-atom (fn [n] (* (+ n n) 2)))\n4","created-at":1281460949000,"updated-at":1285494889000,"_id":"542692cec026201cdc326db7"}],"notes":null,"arglists":["x","x & options"],"doc":"Creates and returns an Atom with an initial value of x and zero or\n more options (in any order):\n\n :meta metadata-map\n\n :validator validate-fn\n\n If metadata-map is supplied, it will become the metadata on the\n atom. validate-fn must be nil or a side-effect-free fn of one\n argument, which will be passed the intended new state on any state\n change. If the new state is unacceptable, the validate-fn should\n return false or throw an exception.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/atom"},{"added":"1.0","ns":"clojure.core","name":"import","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1291627622000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"require","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ace"},{"created-at":1291628363000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"use","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521acf"},{"created-at":1291628388000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ns","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ad0"}],"line":3451,"examples":[{"author":{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (import java.util.Date)\njava.util.Date\n\nuser=\u003E (def *now* (Date.))\n#'user/*now*\n\nuser=\u003E (str *now*)\n\"Tue Jul 13 17:53:54 IST 2010\"\n","created-at":1279049126000,"updated-at":1285502060000,"_id":"542692c8c026201cdc326a01"},{"author":{"login":"dale","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a7a1eca257c6cea943fea41e5cc3e9a3?r=PG&default=identicon"},"editors":[],"body":";; Multiple imports at once.\n(import '(java.util Date Calendar)\n '(java.net URI ServerSocket)\n java.sql.DriverManager)","created-at":1294019024000,"updated-at":1294019024000,"_id":"542692c8c026201cdc326a03"},{"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"editors":[],"body":";; importing multiple classes in a namespace\n(ns foo.bar\n (:import (java.util Date\n Calendar)\n (java.util.logging Logger\n Level)))","created-at":1320992711000,"updated-at":1320992711000,"_id":"542692d3c026201cdc326fce"}],"macro":true,"notes":[{"updated-at":1291628547000,"body":"Good description of use/require/import here:\r\n\r\nhttp://blog.8thlight.com/articles/2010/12/6/clojure-libs-and-namespaces-require-use-import-and-ns","created-at":1291628547000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fa9"},{"updated-at":1403035286000,"body":"`import` will also accept vectors instead of lists, but I would discourage folks from doing so:\r\n\r\n* It's undocumented.\r\n* Lists and vectors have different meanings for `require`, so there's precedent for making a distinction.\r\n* Lists have a distinguished first element, and so they indent more meaningfully here. :-P","created-at":1403035286000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"_id":"542692edf6e94c697052202a"}],"arglists":["& import-symbols-or-lists"],"doc":"import-list =\u003E (package-symbol class-name-symbols*)\n\n For each name in class-name-symbols, adds a mapping from name to the\n class named by package.name to the current namespace. Use :import in the ns\n macro in preference to calling this directly.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/import"},{"added":"1.12","ns":"clojure.core","name":"splitv-at","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":7422,"examples":null,"notes":null,"arglists":["n coll"],"doc":"Returns a vector of [(into [] (take n) coll) (drop n coll)]","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/splitv-at"},{"added":"1.0","ns":"clojure.core","name":"bit-shift-right","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1405719667000,"author":{"login":"phreed","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3a0c739cf289be18be932dc3022e6fd3?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"bit-shift-left","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521aaf"},{"created-at":1405719682000,"author":{"login":"phreed","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3a0c739cf289be18be932dc3022e6fd3?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"bit-xor","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ab0"},{"created-at":1405719694000,"author":{"login":"phreed","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3a0c739cf289be18be932dc3022e6fd3?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"bit-or","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ab1"},{"created-at":1405719700000,"author":{"login":"phreed","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3a0c739cf289be18be932dc3022e6fd3?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"bit-and","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ab2"},{"created-at":1405719706000,"author":{"login":"phreed","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3a0c739cf289be18be932dc3022e6fd3?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"bit-set","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ab3"},{"created-at":1405719712000,"author":{"login":"phreed","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3a0c739cf289be18be932dc3022e6fd3?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"bit-test","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ab4"},{"created-at":1405719724000,"author":{"login":"phreed","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3a0c739cf289be18be932dc3022e6fd3?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"bit-flip","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ab5"},{"created-at":1405719732000,"author":{"login":"phreed","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3a0c739cf289be18be932dc3022e6fd3?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"bit-and-not","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ab6"},{"created-at":1405719739000,"author":{"login":"phreed","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3a0c739cf289be18be932dc3022e6fd3?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"bit-clear","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ab7"},{"created-at":1412094678691,"author":{"login":"jafingerhut","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/109629?v=2"},"to-var":{"ns":"clojure.core","name":"unsigned-bit-shift-right","library-url":"https://github.com/clojure/clojure"},"_id":"542adad6e4b0df9bb778a5a4"}],"line":1376,"examples":[{"author":{"login":"devijvers","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/81018e4231ac1ce8b7a9e6d377092656?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; Convert number into bits:\nuser=\u003E (defn bits [n s]\n (take s\n (map\n (fn [i] (bit-and 0x01 i))\n (iterate\n (fn [i] (bit-shift-right i 1))\n n))))\n#'user/bits\n\nuser=\u003E (map (fn [n] (bits n 3)) (range 8))\n((0 0 0) (1 0 0) (0 1 0) (1 1 0) (0 0 1) (1 0 1) (0 1 1) (1 1 1))\n","created-at":1280029081000,"updated-at":1285497040000,"_id":"542692cec026201cdc326dbb"},{"author":{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},"editors":[{"login":"replore","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e7869fe1a48cb1814c657eaca6bea3eb?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (bit-shift-right 2r1101 0)\n13\nuser=\u003E (bit-shift-right 2r1101 1)\n6\nuser=\u003E (bit-shift-right 2r1101 2)\n3","created-at":1280339098000,"updated-at":1332951287000,"_id":"542692cec026201cdc326dbe"}],"notes":[{"updated-at":1326789497000,"body":"From the IRC channel, a way to get zero-fill bit-shift-right:\r\n\r\n\u003Cpre\u003E06:08 < mikera> (defn >>> [v bits] (bit-shift-right (bit-and 0xFFFFFFFF v) bits))\u003C/pre\u003E\r\n\r\nThere's also an open ticket for a [built-in version](http://dev.clojure.org/jira/browse/CLJ-827).","created-at":1326786313000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fd7"}],"arglists":["x n"],"doc":"Bitwise shift right","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/bit-shift-right"},{"ns":"clojure.core","name":"print-method","file":"clojure/core.clj","type":"var","column":1,"see-alsos":[{"created-at":1340861043000,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"print-dup","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dda"}],"line":3689,"examples":[{"author":{"login":"pangloss","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1202c95dec14eee416717e8c0add0f0c?r=PG&default=identicon"},"editors":[],"body":"(deftype XYZ [])\n\n; without custom print-method defined:\nuser=\u003E (prn (XYZ.))\n#\u003CXYZ user.XYZ@2670d85b\u003E \n\n(defmethod print-method XYZ [v ^java.io.Writer w]\n (.write w \"\u003C\u003C-XYZ-\u003E\u003E\"))\n\n; with print-method\nuser=\u003E (prn (XYZ.))\n\u003C\u003C-XYZ-\u003E\u003E\n","created-at":1369992423000,"updated-at":1369992423000,"_id":"542692d4c026201cdc327037"}],"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core/print-method"},{"added":"1.0","ns":"clojure.core","name":"peek","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1400493737000,"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"first","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ab8"},{"created-at":1400493750000,"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"pop","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ab9"},{"created-at":1400493759000,"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"conj","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521aba"}],"line":1474,"examples":[{"author":{"login":"pkolloch","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/10b2fd3c0a4cc46dc241a48468dc551?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (def large-vec (vec (range 0 10000)))\n#'user/large-vec\n\nuser=\u003E (time (last large-vec))\n\"Elapsed time: 1.279841 msecs\"\n9999\n\nuser=\u003E (time (peek large-vec))\n\"Elapsed time: 0.049238 msecs\"\n9999\n","created-at":1282321027000,"updated-at":1285494456000,"_id":"542692ccc026201cdc326c33"},{"author":{"login":"TravisHeeter","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fe491d07493e45af083b89b767342c6?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (peek '(:a :b :c))\n:a","created-at":1385176400000,"updated-at":1385176400000,"_id":"542692d4c026201cdc32702f"}],"notes":[{"updated-at":1349888814000,"body":"Small reminder:\r\n\r\n\u003Cbr\u003E\r\nDo not work for arbitrary seq but just for persistent types implementing clojure.lang.IPersistentStack (like clojure.lang.Persistent*).\r\n\r\n\u003Cbr\u003E\r\nExample:\r\n\u003Cpre\u003Euser> (peek (cons 1 '()))\r\n; Evaluation aborted.\r\n\u003C/pre\u003E\r\ndo not work because type is clojure.lang.Cons but\r\n\r\n\u003Cpre\u003Euser> (peek (conj '() 1))\r\n1\r\n\u003C/pre\u003E\r\nworks because type is clojure.lang.PersistentList.","created-at":1349884718000,"author":{"login":"tomby42","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/305033855efb82d6041586b874b5bb24?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fea"}],"arglists":["coll"],"doc":"For a list or queue, same as first, for a vector, same as, but much\n more efficient than, last. If the collection is empty, returns nil.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/peek"},{"added":"1.0","ns":"clojure.core","name":"aget","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1359687973000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"aclone","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521af2"},{"created-at":1389744326000,"author":{"login":"jw0","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ca45063da41a9f3aa9028295d8b66d89?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"get","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521af3"},{"created-at":1389744330000,"author":{"login":"jw0","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ca45063da41a9f3aa9028295d8b66d89?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"nth","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521af4"}],"line":3938,"examples":[{"author":{"login":"dermatthias","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/363fd6c774471e207b327fda11b246c7?r=PG&default=identicon"},"editors":[],"body":"\u003Cpre\u003E\r\n;; create two arrays\r\nuser=\u003E (def a1 (double-array '(1.0 2.0 3.0 4.0)))\r\n#'user/a1\r\nuser=\u003E (def a2 (int-array '(9 8 7 6)))\r\n#'user/a2\r\n\r\n;; get an item by index\r\nuser=\u003E (aget a1 2)\r\n3.0\r\nuser=\u003E (aget a2 3)\r\n6\r\n\r\n;; 2d array and 2 indicies\r\nuser=\u003E (def a3 (make-array Integer/TYPE 100 100))\r\n#'user/a3\r\nuser=\u003E (aget a3 23 42)\r\n0\r\n\u003C/pre\u003E","created-at":1284178036000,"updated-at":1284178036000,"_id":"542692cec026201cdc326da0"}],"notes":null,"arglists":["array idx","array idx & idxs"],"doc":"Returns the value at the index/indices. Works on Java arrays of all\n types.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/aget"},{"added":"1.0","ns":"clojure.core","name":"pvalues","file":"clojure/core.clj","static":true,"type":"macro","column":1,"see-alsos":[{"created-at":1329792245000,"author":{"login":"cmccoy","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cf46d3ffedb153a97fe69cb4719e0fd?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"pmap","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e7d"},{"created-at":1336537825000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"future","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e7e"}],"line":7191,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; expressions are calculated in parallel\n\nuser=\u003E (pvalues (expensive-calc-1) (expensive-calc-2))\n(2330 122)\n","created-at":1280322280000,"updated-at":1285496725000,"_id":"542692cac026201cdc326b59"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":";; pvalues is implemented using Clojure futures. See examples for 'future'\n;; for discussion of an undesirable 1-minute wait that can occur before\n;; your standalone Clojure program exits if you do not use shutdown-agents.","created-at":1336537820000,"updated-at":1406853126000,"_id":"542692d4c026201cdc327046"}],"macro":true,"notes":null,"arglists":["& exprs"],"doc":"Returns a lazy sequence of the values of the exprs, which are\n evaluated in parallel","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/pvalues"},{"added":"1.1","ns":"clojure.core","name":"bound-fn","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1331766568000,"author":{"login":"metajack","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/194d8437f5baed192c90be27369c4922?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"bound-fn*","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d55"}],"line":2023,"examples":[{"author":{"login":"metajack","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/194d8437f5baed192c90be27369c4922?r=PG&default=identicon"},"editors":[],"body":"(def ^:dynamic *some-var* nil)\n\n(defn f [] (println *some-var*))\n\n;; run f without a new binding\nuser=\u003E (f)\nnil\nnil\n\n;; run f with a new binding\nuser=\u003E (binding [*some-var* \"hello\"]\n (f))\nhello\nnil\n\n;; run f in a thread with a new binding\nuser=\u003E (binding [*some-var* \"goodbye\"]\n (.start (Thread. f)))\nnil\nnil\n\n;; run a bound f in a thread with a new binding\nuser=\u003E (binding [*some-var* \"goodbye\"]\n (.start (Thread. (bound-fn [] (f)))))\ngoodbye\nnil\n","created-at":1331769907000,"updated-at":1331769907000,"_id":"542692d2c026201cdc326f5c"}],"macro":true,"notes":null,"arglists":["& fntail"],"doc":"Returns a function defined by the given fntail, which will install the\n same bindings in effect as in the thread at the time bound-fn was called.\n This may be used to define a helper function which runs on a different\n thread, but needs the same bindings in place.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/bound-fn"},{"added":"1.7","ns":"clojure.core","name":"vswap!","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":null,"line":2556,"examples":null,"macro":true,"notes":null,"arglists":["vol f & args"],"doc":"Non-atomically swaps the value of the volatile as if:\n (apply f current-value-of-vol args). Returns the value that\n was swapped in.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/vswap!"},{"added":"1.0","ns":"clojure.core","name":"last","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1289038378000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"first","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e58"},{"created-at":1289038381000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"next","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e59"},{"created-at":1289038385000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"rest","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e5a"},{"created-at":1289038414000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"butlast","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e5b"},{"created-at":1306817792000,"author":{"login":"Dmitry Kakurin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/85b70be5da433a6adf5112e7140848da?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"take-last","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e5c"}],"line":264,"examples":[{"author":{"login":"MrHus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4fa262299223e58030e9062d97224547?r=PG&default=identicon"},"editors":[{"login":"MrHus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4fa262299223e58030e9062d97224547?r=PG&default=identicon"},{"login":"jszakmeister","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/69ad2af1f028b1b7e76c14f83bdf26cb?r=PG&default=identicon"}],"body":"\u003Cpre\u003Euser=\u003E (last [1 2 3 4 5])\n5\nuser=\u003E (last [\"a\" \"b\" \"c\" \"d\" \"e\"])\n\"e\"\nuser=\u003E (last {:one 1 :two 2 :three 3})\n[:three 3]\nuser=\u003E (last [])\nnil\n\u003C/pre\u003E","created-at":1279416204000,"updated-at":1335629895000,"_id":"542692c8c026201cdc326a2c"},{"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"editors":[],"body":";really slow reverse\n;put the last item of the list at the start of a new list, and recur over all but the last item of the list.\n;butlast acts similar to next in that it returns null for a 1-item list.\n\n(defn my-reverse\n ([a-list]\n (cond (= a-list nil) nil\n :else (cons (last a-list)\n (my-reverse (butlast a-list))))))","created-at":1289038818000,"updated-at":1289038818000,"_id":"542692c8c026201cdc326a2f"}],"notes":null,"arglists":["coll"],"doc":"Return the last item in coll, in linear time","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/last"},{"added":"1.0","ns":"clojure.core","name":"pr","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1290689171000,"author":{"login":"dale","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a7a1eca257c6cea943fea41e5cc3e9a3?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"print","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bd2"},{"created-at":1299623874000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"prn","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bd3"},{"created-at":1299623879000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"pr-str","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bd4"}],"dynamic":true,"line":3703,"examples":[{"author":{"login":"srid","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bd3a68d670372cd09876c26270a4299a?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (pr \"foo\")\n\"foo\"nil","created-at":1315392482000,"updated-at":1315392482000,"_id":"542692cec026201cdc326da1"},{"author":{"login":"srid","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bd3a68d670372cd09876c26270a4299a?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (pr {:foo \"hello\" :bar 34.5})\n{:foo \"hello\", :bar 34.5}nil","created-at":1315392515000,"updated-at":1315392515000,"_id":"542692cec026201cdc326da2"}],"notes":null,"arglists":["","x","x & more"],"doc":"Prints the object(s) to the output stream that is the current value\n of *out*. Prints the object(s), separated by spaces if there is\n more than one. By default, pr and prn print in a way that objects\n can be read by the reader","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/pr"},{"added":"1.0","ns":"clojure.core","name":"namespace","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1366844136000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ns","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d8a"},{"created-at":1385200446000,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"name","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d8b"}],"line":1612,"examples":[{"author":{"login":"Miles","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bbb26d2a5e856c4fba0f72c3f7250f3f?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"Miles","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bbb26d2a5e856c4fba0f72c3f7250f3f?r=PG&default=identicon"}],"body":"user=\u003E (def x \"Foobar\")\n#'user/x\n\nuser=\u003E (namespace 'user/x)\n\"user\"\n","created-at":1284256918000,"updated-at":1287791961000,"_id":"542692cbc026201cdc326c1d"}],"notes":null,"tag":"java.lang.String","arglists":["x"],"doc":"Returns the namespace String of a symbol or keyword, or nil if not present.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/namespace"},{"added":"1.1","ns":"clojure.core","name":"push-thread-bindings","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1374313643000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"pop-thread-bindings","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d2b"},{"created-at":1374313651000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"binding","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d2c"},{"created-at":1374313699000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"with-bindings","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d2d"}],"line":1930,"examples":null,"notes":null,"arglists":["bindings"],"doc":"WARNING: This is a low-level function. Prefer high-level macros like\n binding where ever possible.\n\n Takes a map of Var/value pairs. Binds each Var to the associated value for\n the current thread. Each call *MUST* be accompanied by a matching call to\n pop-thread-bindings wrapped in a try-finally!\n \n (push-thread-bindings bindings)\n (try\n ...\n (finally\n (pop-thread-bindings)))","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/push-thread-bindings"},{"added":"1.0","ns":"clojure.core","name":"bases","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":5596,"examples":[{"author":{"login":"teyc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bd6e62afb4881ab0f617611b8b65d003?r=PG&default=identicon"},"editors":[],"body":"\u003Cpre\u003Euser=\u003E (import 'java.io.File)\r\n\r\nuser=\u003E (bases java.io.File)\r\n(java.lang.Object java.io.Serializable java.lang.Comparable)\u003C/pre\u003E","created-at":1283977099000,"updated-at":1283977099000,"_id":"542692c9c026201cdc326ac4"}],"notes":null,"arglists":["c"],"doc":"Returns the immediate superclass and direct interfaces of c, if any","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/bases"},{"added":"1.0","ns":"clojure.core","name":"=","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1287469623000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"==","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f25"},{"created-at":1291975060000,"author":{"login":"alimoeeny","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e8dd06976ead4082d2181f3807117e1?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"not=","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f26"},{"created-at":1298162787000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"identical?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f27"}],"line":785,"examples":[{"author":{"login":"citizen428","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b3881a28fe402dd2d1de44717486cae8?r=PG&default=identicon"},"editors":[{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (= 1)\ntrue\nuser=\u003E (= 1 1)\ntrue\nuser=\u003E (= 1 2)\nfalse\nuser=\u003E (= 1 1 1)\ntrue\nuser=\u003E (= 1 1 2)\nfalse\nuser=\u003E (= '(1 2) [1 2])\ntrue\nuser=\u003E (= nil nil)\ntrue\n\n;; It should be noted that equality is not defined for Java arrays.\n;; Instead you can convert them into sequences and compare them that way.\n;; (= (seq array1) (seq array2))\n","created-at":1280470020000,"updated-at":1285495137000,"_id":"542692ccc026201cdc326c72"}],"notes":[{"updated-at":1287470783000,"body":"There is a difference between \"=\" and \"==\". For primitives you definitely want to use \"==\" as \"=\" will result in a cast to the wrapped types for it's arguments. \r\n\r\nThis may not be the case come Clojure 1.3 (see [1])\r\n\r\n[1] http://github.com/clojure/clojure/commit/df8c65a286e90e93972bb69392bc106128427dde","created-at":1287470783000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521f9b"}],"arglists":["x","x y","x y & more"],"doc":"Equality. Returns true if x equals y, false if not. Same as\n Java x.equals(y) except it also works for nil, and compares\n numbers and collections in a type-independent manner. Clojure's immutable data\n structures define equals() (and thus =) as a value, not an identity,\n comparison.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/="},{"added":"1.10","ns":"clojure.core","name":"read+string","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":3796,"examples":null,"notes":null,"arglists":["","stream","stream eof-error? eof-value","stream eof-error? eof-value recursive?","opts stream"],"doc":"Like read, and taking the same args. stream must be a LineNumberingPushbackReader.\n Returns a vector containing the object read and the (whitespace-trimmed) string read.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/read+string"},{"added":"1.0","ns":"clojure.core","name":"dosync","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1285922303000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"sync","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cdf"},{"created-at":1326521625000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ref","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ce0"},{"created-at":1343102755000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"locking","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ce1"}],"line":5129,"examples":[{"author":{"login":"devijvers","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/81018e4231ac1ce8b7a9e6d377092656?r=PG&default=identicon"},"editors":[{"login":"devijvers","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/81018e4231ac1ce8b7a9e6d377092656?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; Keep dosync body free of side-effects:\n(defn my-thread-unsafe-fn [important-ref]\n (let [start-work (ref false)]\n (dosync\n (when (not @important-ref)\n ;\"If a conflict occurs between 2 transactions \n ;trying to modify the same reference, \n ;one of them will be retried.\"\n ;http://clojure.org/concurrent_programming\n (ref-set important-ref true)\n (ref-set start-work true)))\n (when @start-work \n ;launch side-effects here\n )))\n","created-at":1279380650000,"updated-at":1285500150000,"_id":"542692c7c026201cdc32698d"}],"macro":true,"notes":null,"arglists":["& exprs"],"doc":"Runs the exprs (in an implicit do) in a transaction that encompasses\n exprs and any nested calls. Starts a transaction if none is already\n running on this thread. Any uncaught exception will abort the\n transaction and flow out of dosync. The exprs may be run more than\n once, but any effects on Refs will be atomic.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/dosync"},{"added":"1.0","ns":"clojure.core","name":"remove-ns","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1284970244000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"create-ns","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b5c"},{"created-at":1284970256000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"find-ns","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b5d"}],"line":4166,"examples":[{"author":{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},"editors":[{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"sillitor","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c6e7b175eb48c8e3db32f3ff7c2a205d?r=PG&default=identicon"}],"body":";; Let's create a namespace and then remove it\n\nuser=\u003E (create-ns 'my-new-namespace)\n#\u003CNamespace my-new-namespace\u003E\n\n;; removing a namespace will give you the namespace you just deleted, if one existed\nuser=\u003E (remove-ns 'my-new-namespace)\n#\u003CNamespace my-new-namespace\u003E\n\n;; removing a namespace that does not exist, will tell you that nothing was removed, \n;; by returning nil, and won't give any errors\nuser=\u003E (remove-ns 'my-new-namespace)\nnil\n","created-at":1284948400000,"updated-at":1375854900000,"_id":"542692c9c026201cdc326a90"}],"notes":null,"arglists":["sym"],"doc":"Removes the namespace named by the symbol. Use with caution.\n Cannot be used to remove the clojure namespace.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/remove-ns"},{"added":"1.0","ns":"clojure.core","name":"take","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1288872407000,"author":{"login":"jartur","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8eae7b45fd8d383bc1a49e24bee51c9b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"drop","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521db2"},{"created-at":1288872422000,"author":{"login":"jartur","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8eae7b45fd8d383bc1a49e24bee51c9b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"take-while","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521db3"},{"created-at":1288872427000,"author":{"login":"jartur","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8eae7b45fd8d383bc1a49e24bee51c9b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"take-last","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521db4"},{"created-at":1288872434000,"author":{"login":"jartur","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8eae7b45fd8d383bc1a49e24bee51c9b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"take-nth","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521db5"}],"line":2878,"examples":[{"author":{"login":"jandot","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/90df4ddea707147ac2ac11383108d700?r=PG&default=identicon"},"editors":[{"login":"jandot","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/90df4ddea707147ac2ac11383108d700?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"jszakmeister","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/69ad2af1f028b1b7e76c14f83bdf26cb?r=PG&default=identicon"}],"body":"user=\u003E (take 3 '(1 2 3 4 5 6))\n(1 2 3)\n\nuser=\u003E (take 3 [1 2 3 4 5 6])\n(1 2 3)\n\nuser=\u003E (take 3 [1 2])\n(1 2)\n\nuser=\u003E (take 1 [])\n()","created-at":1278905054000,"updated-at":1335630270000,"_id":"542692cec026201cdc326de8"},{"author":{"login":"citizen428","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b3881a28fe402dd2d1de44717486cae8?r=PG&default=identicon"},"editors":[{"login":"citizen428","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b3881a28fe402dd2d1de44717486cae8?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (take 3 (drop 5 (range 1 11)))\n(6 7 8)","created-at":1280469743000,"updated-at":1332951588000,"_id":"542692cec026201cdc326ded"}],"notes":null,"arglists":["n","n coll"],"doc":"Returns a lazy sequence of the first n items in coll, or all items if\n there are fewer than n. Returns a stateful transducer when\n no collection is provided.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/take"},{"added":"1.0","ns":"clojure.core","name":"vector?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":176,"examples":[{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (vector? [1 2 3])\ntrue\nuser=\u003E (vector? '(1 2 3))\nfalse\nuser=\u003E (vector? (vec '(1 2 3)))\ntrue","created-at":1279075424000,"updated-at":1332952940000,"_id":"542692c9c026201cdc326af5"}],"notes":null,"arglists":["x"],"doc":"Return true if x implements IPersistentVector","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/vector_q"},{"added":"1.11","ns":"clojure.core","name":"seq-to-map-for-destructuring","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":4417,"examples":null,"notes":null,"arglists":["s"],"doc":"Builds a map from a seq as described in\n https://clojure.org/reference/special_forms#keyword-arguments","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/seq-to-map-for-destructuring"},{"added":"1.12","ns":"clojure.core","name":"stream-transduce!","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":6877,"examples":null,"notes":null,"arglists":["xform f stream","xform f init stream"],"doc":"Works like transduce but takes a java.util.stream.BaseStream as its source.\n This is a terminal operation on the stream.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/stream-transduce!"},{"added":"1.2","ns":"clojure.core","name":"thread-bound?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1350609443000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"bound-fn","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ec5"},{"created-at":1350609447000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"bound-fn*","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ec6"}],"line":5573,"examples":null,"notes":null,"arglists":["& vars"],"doc":"Returns true if all of the vars provided as arguments have thread-local bindings.\n Implies that set!'ing the provided vars will succeed. Returns true if no vars are provided.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/thread-bound_q"},{"added":"1.5","ns":"clojure.core","name":"send-via","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":2118,"examples":null,"notes":null,"arglists":["executor a f & args"],"doc":"Dispatch an action to an agent. Returns the agent immediately.\n Subsequently, in a thread supplied by executor, the state of the agent\n will be set to the value of:\n\n (apply action-fn state-of-agent args)","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/send-via"},{"added":"1.0","ns":"clojure.core","name":"boolean","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":1620,"examples":[{"author":{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; Everything except `false' and `nil' is true in boolean context.\nuser=\u003E (into {} (map #(vector % (boolean %)) [true false nil [] {} '() #{} \"\"]))\n{true true, false false, nil false, [] true, {} true, #{} true, \"\" true}\n\nuser=\u003E (clojure.pprint/pp)\n{true true,\n false false,\n nil false,\n [] true,\n {} true,\n #{} true,\n \"\" true}\nnil\n","created-at":1279063882000,"updated-at":1285501758000,"_id":"542692c9c026201cdc326ad4"}],"notes":null,"arglists":["x"],"doc":"Coerce to boolean","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/boolean"},{"added":"1.0","ns":"clojure.core","name":"bit-shift-left","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1405720522000,"author":{"login":"phreed","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3a0c739cf289be18be932dc3022e6fd3?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"bit-shift-left","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d80"},{"created-at":1412094597343,"author":{"login":"jafingerhut","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/109629?v=2"},"to-var":{"ns":"clojure.core","name":"unsigned-bit-shift-right","library-url":"https://github.com/clojure/clojure"},"_id":"542ada85e4b0df9bb778a5a1"},{"created-at":1412094642694,"author":{"login":"jafingerhut","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/109629?v=2"},"to-var":{"ns":"clojure.core","name":"bit-shift-right","library-url":"https://github.com/clojure/clojure"},"_id":"542adab2e4b0df9bb778a5a2"}],"line":1370,"examples":[{"author":{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},"editors":[{"login":"tomas","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c0c2f195479ae4a71cb6484679f6f49?r=PG&default=identicon"},{"login":"tomas","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c0c2f195479ae4a71cb6484679f6f49?r=PG&default=identicon"}],"body":"\u003Cpre\u003Euser=\u003E (bit-shift-left 1 10)\n1024\n\u003C/pre\u003E\n\n\u003Cpre\u003Euser=\u003E (bit-shift-left 2r1101 2) ; fill rightmost bits with 0s\n52 \n;; 52 = 2r110100\n\u003C/pre\u003E\n","created-at":1280339401000,"updated-at":1408597384000,"_id":"542692ccc026201cdc326cc2"},{"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"editors":[{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"}],"body":";;a bogus bit-array implementation\n\n(def ba (atom (long 0)))\n\n(defn set-ba \n\"sets bit n in long atom ba\"\n [n]\n (let [number-set (bit-shift-left 1 n)\n\t_ (println \"number to set: \" number-set)\n\tnew-array (bit-or @ba number-set)]\n (reset! ba new-array)))\n\n(defn get-ba \n\"gets bit n in long atom ba\"\n[n]\n (not (zero? (bit-and (bit-shift-left 1 n) @ba))))\n\n(comment\n (set-ba 0) ;; 0 [....0001]\n (set-ba 3) ;; 2^3 = 8 [....1001]\n (get-ba 0) ;; (bit-and ba 2^0) = 1\n (get-ba 1) ;; (bit-and ba 2^1) = 0\n (get-ba 3) ;; (bit-and ba 2^3) = 1\n ;;but:\n (set-ba 65) ;; [....1011]\n ;;number to set: 2\n ;;modulo because long has only 64 bit\n ;;also note that long always is two-complemented (signed) in java implementation\n )","created-at":1334315926000,"updated-at":1334316062000,"_id":"542692d2c026201cdc326f59"}],"notes":null,"arglists":["x n"],"doc":"Bitwise shift left","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/bit-shift-left"},{"added":"1.11","ns":"clojure.core","name":"random-uuid","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":6939,"examples":null,"notes":null,"arglists":[""],"doc":"Returns a pseudo-randomly generated java.util.UUID instance (i.e. type 4).\n\n See: https://docs.oracle.com/javase/8/docs/api/java/util/UUID.html#randomUUID--","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/random-uuid"},{"added":"1.9","ns":"clojure.core","name":"any?","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":540,"examples":null,"notes":null,"tag":"java.lang.Boolean","arglists":["x"],"doc":"Returns true given any argument.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/any_q"},{"added":"1.0","ns":"clojure.core","name":"find-var","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":2032,"examples":[{"author":{"login":"franks42","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b3ee701dd6c481e5d310467ddfe62c48?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (find-var 'map)\nIllegalArgumentException Symbol must be namespace-qualified clojure.lang.Var.find (Var.java:150)\nuser=\u003E (find-var 'clojure.core/map)\n#'clojure.core/map\nuser=\u003E (find-var 'clojure.core/qwerty)\nnil\n","created-at":1353813768000,"updated-at":1353813768000,"_id":"542692d3c026201cdc326fa5"}],"notes":null,"arglists":["sym"],"doc":"Returns the global var named by the namespace-qualified symbol, or\n nil if no var with that name.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/find-var"},{"added":"1.0","ns":"clojure.core","name":"rand-int","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1311342554000,"author":{"login":"Havvy","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e799a79441c7543be48562403411cd13?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"rand","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b5a"},{"created-at":1343068893000,"author":{"login":"john.r.woodward","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/22b6fbc4a386291e45b1cb4449377086?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"int","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b5b"}],"line":4972,"examples":[{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"john.r.woodward","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/22b6fbc4a386291e45b1cb4449377086?r=PG&default=identicon"}],"body":"user=\u003E (rand-int 30)\n10\n\nuser=\u003E (rand-int 30)\n7\n\n;compare with \nuser=\u003E (int (rand 30))\n","created-at":1280776684000,"updated-at":1343069015000,"_id":"542692cac026201cdc326b17"}],"notes":null,"arglists":["n"],"doc":"Returns a random integer between 0 (inclusive) and n (exclusive).","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/rand-int"},{"added":"1.0","ns":"clojure.core","name":"aclone","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1359687987000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"aget","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d98"}],"line":3931,"examples":[{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[],"body":";; create an Java integer array, then clone it\n;; note that when you modify b, a remains the same\n;; showing that b is not just a reference to a\n\nuser=\u003E (def a (int-array [1 2 3 4]))\n#'user/a\nuser=\u003E (def b (aclone a))\n#'user/b\nuser=\u003E (aset b 0 23)\n23\nuser=\u003E (vec b)\n[23 2 3 4]\nuser=\u003E (vec a)\n[1 2 3 4]","created-at":1313834307000,"updated-at":1313834307000,"_id":"542692cec026201cdc326db4"}],"notes":null,"arglists":["array"],"doc":"Returns a clone of the Java array. Works on arrays of known\n types.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/aclone"},{"added":"1.10","ns":"clojure.core","name":"PrintWriter-on","file":"clojure/core_print.clj","type":"function","column":1,"see-alsos":null,"line":561,"examples":null,"notes":null,"tag":"java.io.PrintWriter","arglists":["flush-fn close-fn","flush-fn close-fn autoflush?"],"doc":"implements java.io.PrintWriter given flush-fn, which will be called\n when .flush() is called, with a string built up since the last call to .flush().\n if not nil, close-fn will be called with no arguments when .close is called.\n autoflush? determines if the PrintWriter will autoflush, false by default.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/PrintWriter-on"},{"added":"1.7","ns":"clojure.core","name":"vreset!","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":2549,"examples":null,"notes":null,"arglists":["vol newval"],"doc":"Sets the value of volatile to newval without regard for the\n current value. Returns newval.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/vreset!"},{"ns":"clojure.core","name":"chunk","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":700,"examples":null,"notes":null,"tag":"clojure.lang.IChunk","arglists":["b"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core/chunk"},{"added":"1.2","ns":"clojure.core","name":"dec","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1318548547000,"author":{"login":"arkh","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1c6ed9b963d758914c2744befd4974ca?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"dec'","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b3e"}],"line":1156,"examples":[{"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (dec 2)\n1\n\nuser=\u003E (dec 2.0)\n1.0\n\nuser=\u003E (dec 1)\n0\n\nuser=\u003E (dec -1)\n-2","created-at":1279992356000,"updated-at":1411919526590,"_id":"542692cec026201cdc326d98"}],"notes":null,"arglists":["x"],"doc":"Returns a number one less than num. Does not auto-promote\n longs, will throw on overflow. See also: dec'","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/dec"},{"added":"1.1","ns":"clojure.core","name":"future-call","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1300437112000,"author":{"login":"ninjudd","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7ced25585a7556e9b9b975c1f9e136e3?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"future","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f43"}],"line":7110,"examples":[{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[],"body":";; future-call is used to implement 'future'. See examples for 'future'\n;; for discussion of an undesirable 1-minute wait that can occur before\n;; your standalone Clojure program exits if you do not use shutdown-agents.","created-at":1336538018000,"updated-at":1336538018000,"_id":"542692d3c026201cdc326fb2"}],"notes":null,"arglists":["f"],"doc":"Takes a function of no args and yields a future object that will\n invoke the function in another thread, and will cache the result and\n return it on all subsequent calls to deref/@. If the computation has\n not yet finished, calls to deref/@ will block, unless the variant\n of deref with timeout is used. See also - realized?.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/future-call"},{"added":"1.0","ns":"clojure.core","name":"resultset-seq","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":5755,"examples":null,"notes":null,"arglists":["rs"],"doc":"Creates and returns a lazy sequence of structmaps corresponding to\n the rows in the java.sql.ResultSet rs","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/resultset-seq"},{"added":"1.0","ns":"clojure.core","name":"struct","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1293674730000,"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"defstruct","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bb5"}],"line":4088,"examples":[{"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"editors":[],"body":"user\u003E (defstruct mystruct :foo :bar)\n#'user/mystruct\n\nuser\u003E (struct mystruct \"eggplant\" \"pizza\")\n{:foo \"eggplant\", :bar \"pizza\"}","created-at":1293674725000,"updated-at":1293674725000,"_id":"542692cec026201cdc326d8b"}],"notes":null,"arglists":["s & vals"],"doc":"Returns a new structmap instance with the keys of the\n structure-basis. vals must be supplied for basis keys in order -\n where values are not supplied they will default to nil.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/struct"},{"added":"1.0","ns":"clojure.core","name":"map","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1318598944000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"map-indexed","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b92"},{"created-at":1346930884000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"pmap","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b93"},{"created-at":1346930913000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"amap","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b94"},{"created-at":1371842453000,"author":{"login":"adereth","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5ad11b4e208a6cdb3bd45fe01dea59b7?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"mapcat","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b95"},{"created-at":1399907437000,"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"keep","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b96"},{"created-at":1407836917000,"author":{"login":"Thomas Stephens","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/40024617164314f70f7584ac09b96c1d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"juxt","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b97"}],"line":2744,"examples":[{"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"tomas","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c0c2f195479ae4a71cb6484679f6f49?r=PG&default=identicon"},{"login":"tomas","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c0c2f195479ae4a71cb6484679f6f49?r=PG&default=identicon"},{"login":"tomas","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c0c2f195479ae4a71cb6484679f6f49?r=PG&default=identicon"}],"body":"user=\u003E (map inc [1 2 3 4 5])\n(2 3 4 5 6)\n\n\n;; map can be used with multiple collections. Collections will be consumed\n;; and passed to the mapping function in parallel:\nuser=\u003E (map + [1 2 3] [4 5 6])\n(5 7 9)\n\n\n;; When map is passed more than one collection, the mapping function will\n;; be applied until one of the collections runs out:\nuser=\u003E (map + [1 2 3] (iterate inc 1))\n(2 4 6)\n\n\n\n;; map is often used in conjunction with the # reader macro:\nuser=\u003E (map #(str \"Hello \" % \"!\" ) [\"Ford\" \"Arthur\" \"Tricia\"])\n(\"Hello Ford!\" \"Hello Arthur!\" \"Hello Tricia!\")\n\n;; A useful idiom to pull \"columns\" out of a collection of collections. \n;; Note, it is equivalent to:\n;; user=\u003E (map vector [:a :b :c] [:d :e :f] [:g :h :i])\n\nuser=\u003E (apply map vector [[:a :b :c]\n [:d :e :f]\n [:g :h :i]])\n\n([:a :d :g] [:b :e :h] [:c :f :i])\n\n;; From http://clojure-examples.appspot.com/clojure.core/map","created-at":1278720977000,"updated-at":1403290428000,"_id":"542692cac026201cdc326b01"},{"author":{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (map #(vector (first %) (* 2 (second %)))\n {:a 1 :b 2 :c 3})\n([:a 2] [:b 4] [:c 6])\n\nuser=\u003E (into {} *1)\n{:a 2, :b 4, :c 6}\n","created-at":1279062371000,"updated-at":1285501856000,"_id":"542692cac026201cdc326b09"},{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[],"body":";; Use a hash-map as a function to translate values in a collection from the \n;; given key to the associated value\n\nuser=\u003E (map {2 \"two\" 3 \"three\"} [5 3 2])\n(nil \"three\" \"two\")\n\n;; then use (filter identity... to remove the nils\nuser=\u003E (filter identity (map {2 \"two\" 3 \"three\"} [5 3 2]))\n(\"three\" \"two\")","created-at":1310850029000,"updated-at":1310850029000,"_id":"542692cac026201cdc326b0b"},{"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"editors":[{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"}],"body":";; mapping over a hash-map applies (into) first. \n;; need to use functions that deal with arrays (fn [[key val]] ...)\n(map pprint {:key :val :key1 :val1})\n([:key :val]\n[:key1 :val1]\nnil nil)\n\n;;above, the pprint output appears to be part of the return value but it's not:\n(hash-set (map pprint {:key :val :key1 :val1}))\n[:key :val]\n[:key1 :val1]\n#{(nil nil)}\n\n(map second {:key :val :key1 :val1})\n(:val :val1)","created-at":1320357817000,"updated-at":1350052567000,"_id":"542692d4c026201cdc326ffb"},{"author":{"login":"dansalmo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e33ee460f5f61bc5ba9b598934766215?r=PG&default=identicon"},"editors":[{"login":"dansalmo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e33ee460f5f61bc5ba9b598934766215?r=PG&default=identicon"},{"login":"dansalmo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e33ee460f5f61bc5ba9b598934766215?r=PG&default=identicon"},{"login":"dansalmo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e33ee460f5f61bc5ba9b598934766215?r=PG&default=identicon"}],"body":"(map fn [a 4 x]\n [b 5 y]\n [c 6]) \n; ^ ^\n; applies fn to a b c as (fn a b c)\n; applies fn to 4 5 6 as (fn 4 5 6)\n; ignores (x y)\n; returns a list of results\n; equivalent to (list (fn a b c) (fn 4 5 6))\n\n;example\n(map list [1 2 3]\n '(a b c)\n '(4 5))\n\nuser=\u003E (map list [1 2 3] '(a b c) '(4 5))\n((1 a 4) (2 b 5))\n;same as\nuser=\u003E (list (list 1 'a 4) (list 2 'b 5))\n((1 a 4) (2 b 5))","created-at":1345087524000,"updated-at":1345087844000,"_id":"542692d4c026201cdc327000"},{"author":{"login":"octopusgrabbus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fd31b8bcea99fa7b0711fbc424587774?r=PG&default=identicon"},"editors":[],"body":"; map passed two collection arguments. From 4Clojure Problem #157\n\n(def d1 [:a :b :c])\n(#(map list % (range)) d1)\n((:a 0) (:b 1) (:c 2))","created-at":1371168552000,"updated-at":1371168552000,"_id":"542692d4c026201cdc327004"}],"notes":[{"updated-at":1361257529000,"body":"To create a *hashmap*, use the [`hash-map`](hash-map) function, or the `{...}` sugar:\r\n\r\n (= {:a 1 :b 2 :c 3} (hash-map :a 1 :b 2 :c 3))","created-at":1361257529000,"author":{"login":"Howard Abrams","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/eef504f83cde9913a37eefa515de56a8?r=PG&default=identicon"},"_id":"542692edf6e94c6970521ffd"}],"arglists":["f","f coll","f c1 c2","f c1 c2 c3","f c1 c2 c3 & colls"],"doc":"Returns a lazy sequence consisting of the result of applying f to\n the set of first items of each coll, followed by applying f to the\n set of second items in each coll, until any one of the colls is\n exhausted. Any remaining items in other colls are ignored. Function\n f should accept number-of-colls arguments. Returns a transducer when\n no collection is provided.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/map"},{"added":"1.1","ns":"clojure.core","name":"juxt","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1297561266000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"partial","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f05"},{"created-at":1297561270000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"comp","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f06"}],"line":2593,"examples":[{"author":{"login":"kotarak","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5db30f607f0b5fa70d690311aa3bfd3b?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; Extract values from a map.\n\nuser=\u003E ((juxt :a :b) {:a 1 :b 2 :c 3 :d 4})\n[1 2]\n","created-at":1279213578000,"updated-at":1285496887000,"_id":"542692cfc026201cdc326e0a"},{"author":{"login":"kotarak","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5db30f607f0b5fa70d690311aa3bfd3b?r=PG&default=identicon"},"editors":[{"login":"kotarak","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5db30f607f0b5fa70d690311aa3bfd3b?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; \"Explode\" a value.\n\nuser=\u003E ((juxt identity name) :keyword)\n[:keyword \"keyword\"]\n\n\n;; eg. to create a map:\n\nuser=\u003E (into {} (map (juxt identity name) [:a :b :c :d]))\n{:a \"a\" :b \"b\" :c \"c\" :d \"d\"}\n","created-at":1279213673000,"updated-at":1285496904000,"_id":"542692cfc026201cdc326e0c"},{"author":{"login":"adie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/26a4d75105ed437cdba82981ff7c78f6?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"}],"body":";; Get the first character and length of string\n\nuser=\u003E ((juxt first count) \"Clojure Rocks\")\n[\\C 13]\n","created-at":1280240324000,"updated-at":1289034846000,"_id":"542692cfc026201cdc326e0f"},{"author":{"login":"ordnungswidrig","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/47018db2b156f6c7f606950e19cf6134?r=PG&default=identicon"},"editors":[],"body":";; sort list of maps by multiple values\nuser =\u003E (sort-by (juxt :a :b) [{:a 1 :b 3} {:a 1 :b 2} {:a 2 :b 1}]\n[{:a 1 :b 2} {:a 1 :b 3} {:a 2 :b 1}]","created-at":1342498131000,"updated-at":1342498131000,"_id":"542692d3c026201cdc326fdd"},{"author":{"login":"Phalphalak","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a684c0fd4f27597437de953e92a15d4b?r=PG&default=identicon"},"editors":[],"body":";; Create lookup maps via a specific key\n\nuser=\u003E (defn index-by [coll key-fn]\n (into {} (map (juxt key-fn identity) coll)))\n#'user/index-by\nuser=\u003E (index-by [{:id 1 :name \"foo\"} \n {:id 2 :name \"bar\"} \n {:id 3 :name \"baz\"}] :id)\n{1 {:name \"foo\", :id 1}, 2 {:name \"bar\", :id 2}, 3 {:name \"baz\", :id 3}}\n\nuser=\u003E (index-by [{:id 1 :name \"foo\"} \n {:id 2 :name \"bar\"} \n {:id 3 :name \"baz\"}] :name)\n{\"foo\" {:name \"foo\", :id 1}, \"bar\" {:name \"bar\", :id 2}, \"baz\" {:name \"baz\", :id 3}}\n","created-at":1392423622000,"updated-at":1392423622000,"_id":"542692cfc026201cdc326e12"}],"notes":[{"updated-at":1291541271000,"body":"I kinda love this fn =)","created-at":1291541271000,"author":{"login":"Nevena","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fa0e495ccb6ed2997e14f687817e9299?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fa8"},{"updated-at":1359899617000,"body":"\"reduce1\" -\u003E \"reduce\"\r\n\r\ncore sources from 33 line to 37 line","created-at":1359899617000,"author":{"login":"lispro06","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/20c3faad6f66a434dae42b5ed8ad305?r=PG&default=identicon"},"_id":"542692edf6e94c6970521ffc"}],"arglists":["f","f g","f g h","f g h & fs"],"doc":"Takes a set of functions and returns a fn that is the juxtaposition\n of those fns. The returned fn takes a variable number of args, and\n returns a vector containing the result of applying each fn to the\n args (left-to-right).\n ((juxt a b c) x) =\u003E [(a x) (b x) (c x)]","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/juxt"},{"added":"1.0","ns":"clojure.core","name":"ns-publics","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1288055164000,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.core","name":"ns-map","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d13"},{"created-at":1298556634000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ns-interns","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d14"},{"created-at":1303419098000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"resolve","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d15"}],"line":4215,"examples":[{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":";; create the namespace and switch to it\nuser=\u003E (in-ns 'demo.ns)\n#\u003CNamespace demo.ns\u003E\n\n;; Make sure all of the good stuff in clojure.core is usable here, too.\ndemo.ns=\u003E (clojure.core/use 'clojure.core)\nnil\n\n;; define some public functions\ndemo.ns=\u003E (defn public-fn1 [x y] (+ x y))\n#'demo.ns/public-fn1\ndemo.ns=\u003E (defn public-fn2 [t] (* t t t))\n#'demo.ns/public-fn2\n\n;; define a private function with defn-\ndemo.ns=\u003E (defn- private-fn [s] (/ s 5))\n#'demo.ns/private-fn\n\n;; Switch back to the user namespace\ndemo.ns=\u003E (in-ns 'user)\n#\u003CNamespace user\u003E\n\n;; Get a map of all intern mappings for namespace demo.ns\nuser=\u003E (ns-interns 'demo.ns)\n{public-fn1 #'demo.ns/public-fn1, private-fn #'demo.ns/private-fn, public-fn2 #'demo.ns/public-fn2}\n\n;; Now get a map of only the public mappings. No private-fn here.\nuser=\u003E (ns-publics 'demo.ns)\n{public-fn1 #'demo.ns/public-fn1, public-fn2 #'demo.ns/public-fn2}\n","created-at":1298556164000,"updated-at":1298556944000,"_id":"542692c7c026201cdc326989"},{"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"editors":[],"body":";; See also http://clojure.org/namespaces for information on namespaces in Clojure and how to inspect and manipulate them","created-at":1348479386000,"updated-at":1348479386000,"_id":"542692d4c026201cdc32701d"}],"notes":null,"arglists":["ns"],"doc":"Returns a map of the public intern mappings for the namespace.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/ns-publics"},{"added":"1.0","ns":"clojure.core","name":"\u003C","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1291975111000,"author":{"login":"alimoeeny","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e8dd06976ead4082d2181f3807117e1?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"=","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ef6"},{"created-at":1291975116000,"author":{"login":"alimoeeny","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e8dd06976ead4082d2181f3807117e1?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"not=","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ef7"},{"created-at":1291975125000,"author":{"login":"alimoeeny","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e8dd06976ead4082d2181f3807117e1?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"\u003E","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ef8"},{"created-at":1391516309000,"author":{"login":"rob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/89cc77a97a299e2e6295b2d7be194b2b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"\u003C=","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ef9"},{"created-at":1391516316000,"author":{"login":"rob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/89cc77a97a299e2e6295b2d7be194b2b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"\u003E=","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521efa"}],"line":902,"examples":[{"author":{"login":"mattdw","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ee24aacb65359196b0a1bad050f9a62f?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (\u003C 1 2)\ntrue\nuser=\u003E (\u003C 2 1)\nfalse\nuser=\u003E (\u003C 1.5 2)\ntrue\nuser=\u003E (\u003C 2 3 4 5 6)\ntrue","created-at":1280321780000,"updated-at":1332952819000,"_id":"542692cbc026201cdc326c25"}],"notes":[{"updated-at":1391516536000,"body":"I think the docstring for \u003C should say \"strictly increasing\" instead of \"monotonically increasing.\" In contrast, I think \u003C= is the function that tests for \"monotonically increasing.\"\r\n\r\nHere's a quote from wikitionary...\r\n\r\nmonotonic increasing: (mathematics, of a function) always increasing or remaining constant, and never decreasing; contrast this with strictly increasing\r\n","created-at":1391516536000,"author":{"login":"rob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/89cc77a97a299e2e6295b2d7be194b2b?r=PG&default=identicon"},"_id":"542692edf6e94c697052201b"}],"arglists":["x","x y","x y & more"],"doc":"Returns non-nil if nums are in monotonically increasing order,\n otherwise false.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/\u003C"},{"ns":"clojure.core","name":"*source-path*","type":"var","see-alsos":null,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core/*source-path*"},{"ns":"clojure.core","name":"with-loading-context","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":null,"line":5808,"examples":null,"macro":true,"notes":null,"arglists":["& body"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core/with-loading-context"},{"added":"1.0","ns":"clojure.core","name":"test","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1289286348000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"var","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521beb"},{"created-at":1289286374000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"meta","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bec"},{"created-at":1289286382000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"assert","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bed"},{"created-at":1289287269000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.test","name":"with-test","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bee"}],"line":4882,"examples":[{"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"editors":[{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"}],"body":"(defn my-function\n \"this function adds two numbers\"\n {:test #(do\n (assert (= (my-function 2 3) 5))\n (assert (= (my-function 4 4) 8)))}\n ([x y] (+ x y)))\n\n(test #'my-function) ;equal to (test (var my-function))\n=\u003E :ok\n\n-----------------------------------------------------------------------\n\n(defn my-function\n \"this function adds two numbers\"\n {:test #(do\n (assert (= (my-function 2 3) 5))\n (assert (= (my-function 99 4) 8)))}\n ([x y] (+ x y)))\n\n(test #'my-function)\n=\u003E java.lang.AssertionError: Assert failed: (= (my-function 99 4) 8) (NO_SOURCE_FILE:0\n\n---------------------------------------------------------------------------\n\n(defn my-function\n \"this function adds two numbers\"\n ([x y] (+ x y)))\n\n(test #'my-function)\n=\u003E :no-test","created-at":1289286249000,"updated-at":1289286329000,"_id":"542692cac026201cdc326b8a"}],"notes":null,"arglists":["v"],"doc":"test [v] finds fn at key :test in var metadata and calls it,\n presuming failure will throw exception","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/test"},{"added":"1.0","ns":"clojure.core","name":"rest","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1300352361000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"next","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b01"},{"created-at":1302912314000,"author":{"login":"hoornet","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5834f829a9def19620d4014c46642172?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"first","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b02"},{"created-at":1328341652000,"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"drop","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b03"},{"created-at":1399433624000,"author":{"login":"Yun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/f18708f979ad613ab134cb5002558965?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"pop","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b04"}],"line":66,"examples":[{"author":{"login":"MrHus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4fa262299223e58030e9062d97224547?r=PG&default=identicon"},"editors":[],"body":"\u003Cpre\u003Euser=> (rest [1 2 3 4 5])\r\n(2 3 4 5)\r\nuser=> (rest [\"a\" \"b\" \"c\" \"d\" \"e\"])\r\n(\"b\" \"c\" \"d\" \"e\")\u003C/pre\u003E","created-at":1279416340000,"updated-at":1279416340000,"_id":"542692cec026201cdc326d69"},{"author":{"login":"hoornet","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5834f829a9def19620d4014c46642172?r=PG&default=identicon"},"editors":[{"login":"steveminer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d28543d134185d12d4006a74738d233e?r=PG&default=identicon"}],"body":"user=\u003E (rest '())\n()","created-at":1302100429000,"updated-at":1306985081000,"_id":"542692cec026201cdc326d6a"},{"author":{"login":"steveminer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d28543d134185d12d4006a74738d233e?r=PG&default=identicon"},"editors":[{"login":"steveminer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d28543d134185d12d4006a74738d233e?r=PG&default=identicon"}],"body":"user=\u003E (rest nil)\n()","created-at":1306983166000,"updated-at":1306985092000,"_id":"542692cec026201cdc326d6c"},{"author":{"login":"steveminer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d28543d134185d12d4006a74738d233e?r=PG&default=identicon"},"editors":[{"login":"steveminer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d28543d134185d12d4006a74738d233e?r=PG&default=identicon"}],"body":";; A simple implementation using rest for recursing over a collection. Note that (seq coll) is used as the test.\n(defn my-map [func coll]\n (when-let [s (seq coll)]\n (cons (func (first s))\n\t (my-map func (rest s)))))","created-at":1306983565000,"updated-at":1306984946000,"_id":"542692cec026201cdc326d6e"},{"author":{"login":"TravisHeeter","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fe491d07493e45af083b89b767342c6?r=PG&default=identicon"},"editors":[],"body":"user=\u003E(rest '(1 2 3 4 5))\n'(2 3 4 5)","created-at":1385175807000,"updated-at":1385175807000,"_id":"542692d5c026201cdc327075"}],"notes":[{"updated-at":1306987831000,"body":"\u003Cb\u003Erest\u003C/b\u003E is generally preferred over [next](../clojure.core/next). See the Clojure.org documentation on writing [lazy](http://clojure.org/lazy) functions.\r\n\r\nAlso, the topic is covered on StackOverflow.com: [rest vs. next](http://stackoverflow.com/questions/4288476/clojure-rest-vs-next).\r\n","created-at":1306985238000,"author":{"login":"steveminer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d28543d134185d12d4006a74738d233e?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fc1"}],"tag":"clojure.lang.ISeq","arglists":["coll"],"doc":"Returns a possibly empty seq of the items after the first. Calls seq on its\n argument.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/rest"},{"added":"1.4","ns":"clojure.core","name":"ex-data","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":4841,"examples":null,"notes":null,"arglists":["ex"],"doc":"Returns exception data (a map) if ex is an IExceptionInfo.\n Otherwise returns nil.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/ex-data"},{"added":"1.11","ns":"clojure.core","name":"NaN?","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":8214,"examples":null,"notes":null,"arglists":["num"],"doc":"Returns true if num is NaN, else false","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/NaN_q"},{"added":"1.0","ns":"clojure.core","name":"compile","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":6191,"examples":[{"author":{"login":"rafmagana","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/40bd727b22d74930f292b63d45a71b07?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (compile (symbol \"clojure.java.io\")\nclojure.java.io\n\nuser=\u003E (compile (symbol \"unexistent.namespace\")\nFileNotFoundException Could not locate unexistent/namespace__init.class or unexistent/namespace.clj on classpath: clojure.lang.RT.load (RT.java:432)","created-at":1406012047000,"updated-at":1406012047000,"_id":"542692d2c026201cdc326f65"}],"notes":null,"arglists":["lib"],"doc":"Compiles the namespace named by the symbol lib into a set of\n classfiles. The source for the lib must be in a proper\n classpath-relative directory. The output files will go into the\n directory specified by *compile-path*, and that directory too must\n be in the classpath.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/compile"},{"added":"1.0","ns":"clojure.core","name":"isa?","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1302036060000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"derive","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e89"},{"created-at":1327820991000,"author":{"login":"Chouser","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7a0192050ed6488670acfd3f59405c10?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"instance?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e8a"},{"created-at":1341101444000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"underive","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e8b"},{"created-at":1341101451000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ancestors","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e8c"},{"created-at":1341101454000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"parents","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e8d"},{"created-at":1341101462000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"descendants","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e8e"},{"created-at":1341101476000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"make-hierarchy","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e8f"}],"line":5617,"examples":[{"author":{"login":"OnesimusUnbound","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fa4c391db0d2d1744cc2cd0d787dd3d?r=PG&default=identicon"},"editors":[{"login":"Magomimmo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/dafac6cd52df3a895b8375ed6b4fe8ee?r=PG&default=identicon"}],"body":"user=\u003E (import 'java.util.PriorityQueue)\njava.util.PriorityQueue\n\nuser=\u003E (bases PriorityQueue)\n(java.util.AbstractQueue java.io.Serializable)\n\nuser=\u003E (import 'java.util.AbstractQueue)\njava.util.AbstractQueue\n\nuser=\u003E (isa? PriorityQueue AbstractQueue)\ntrue\n\nuser=\u003E (bases AbstractQueue)\n(java.util.AbstractCollection java.util.Queue)\n\nuser=\u003E (isa? PriorityQueue java.util.AbstractCollection)\ntrue\n\nuser=\u003E (isa? PriorityQueue java.util.Queue)\ntrue\n\nuser=\u003E (isa? java.util.PriorityQueue java.util.TreeMap)\nfalse","created-at":1312394065000,"updated-at":1342891952000,"_id":"542692c9c026201cdc326ae2"},{"author":{"login":"OnesimusUnbound","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fa4c391db0d2d1744cc2cd0d787dd3d?r=PG&default=identicon"},"editors":[{"login":"Magomimmo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/dafac6cd52df3a895b8375ed6b4fe8ee?r=PG&default=identicon"}],"body":"user=\u003E (derive ::Feline ::Animal)\nnil\nuser=\u003E (derive ::Cat ::Feline)\nnil\n\nuser=\u003E (derive ::Lion ::Feline)\nnil\n\nuser=\u003E (isa? ::Lion ::Feline)\ntrue\n\nuser=\u003E (isa? ::Lion ::Animal)\ntrue\n\nuser=\u003E (isa? ::Tuna ::Feline)\nfalse","created-at":1313009767000,"updated-at":1342892300000,"_id":"542692c9c026201cdc326ae4"}],"notes":null,"arglists":["child parent","h child parent"],"doc":"Returns true if (= child parent), or child is directly or indirectly derived from\n parent, either via a Java type inheritance relationship or a\n relationship established via derive. h must be a hierarchy obtained\n from make-hierarchy, if not supplied defaults to the global\n hierarchy","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/isa_q"},{"added":"1.9","ns":"clojure.core","name":"boolean?","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":521,"examples":null,"notes":null,"arglists":["x"],"doc":"Return true if x is a Boolean","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/boolean_q"},{"added":"1.0","ns":"clojure.core","name":"..","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":null,"line":1676,"examples":[{"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"editors":[{"login":"OnesimusUnbound","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fa4c391db0d2d1744cc2cd0d787dd3d?r=PG&default=identicon"}],"body":"user\u003E (.. \"fooBAR\" (toLowerCase) (contains \"ooba\"))\ntrue\n\n;; use macroexpand to see how the form above will appear\nuser\u003E (macroexpand '(.. \"fooBAR\" (toLowerCase) (contains \"ooba\")))\n(. (. \"fooBAR\" (toLowerCase)) (contains \"ooba\"))","created-at":1286507932000,"updated-at":1313788944000,"_id":"542692c8c026201cdc326a65"}],"macro":true,"notes":null,"arglists":["x form","x form & more"],"doc":"form =\u003E fieldName-symbol or (instanceMethodName-symbol args*)\n\n Expands into a member access (.) of the first member on the first\n argument, followed by the next member on the result, etc. For\n instance:\n\n (.. System (getProperties) (get \"os.name\"))\n\n expands to:\n\n (. (. System (getProperties)) (get \"os.name\"))\n\n but is easier to write, read, and understand.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/_.."},{"ns":"clojure.core","name":"munge","file":"clojure/core_deftype.clj","type":"function","column":1,"see-alsos":null,"line":131,"examples":[{"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"editors":[],"body":"user\u003E (defn foo [] (println \"foo\"))\n#'user/foo\n\nuser\u003E foo\n#\u003Cuser$foo user$foo@a0dc71\u003E\n\nuser\u003E (munge foo)\n\"user_DOLLARSIGN_foo_CIRCA_a0dc71\"","created-at":1293673710000,"updated-at":1293673710000,"_id":"542692c8c026201cdc3269ef"}],"notes":null,"arglists":["s"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core/munge"},{"added":"1.0","ns":"clojure.core","name":"delay","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1342465174000,"author":{"login":"sergey","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fbf950615302e00a14bceec914af32ca?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"force","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b78"},{"created-at":1350107212000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"realized?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b79"},{"created-at":1358780682000,"author":{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"memoize","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b7a"},{"created-at":1291441377000,"author":{"login":"pauldoo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5cb916d3c8abc9f45a093209e72489fb?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"future","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d7e"},{"created-at":1291473063000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"delay?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d7f"}],"line":748,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; In this example you can see that the first time the delay is forced\n;; the println is executed however the second dereference shows just the\n;; precomputed value.\n\nuser=\u003E (def my-delay (delay (println \"did some work\") 100))\n#'user/my-delay\n\nuser=\u003E @my-delay\ndid some work\n100\n\nuser=\u003E @my-delay\n100\n","created-at":1280737965000,"updated-at":1285495988000,"_id":"542692cdc026201cdc326d44"}],"macro":true,"notes":null,"arglists":["& body"],"doc":"Takes a body of expressions and yields a Delay object that will\n invoke the body only the first time it is forced (with force or deref/@), and\n will cache the result and return it on all subsequent force\n calls. See also - realized?","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/delay"},{"added":"1.2","ns":"clojure.core","name":"set-error-mode!","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":2229,"examples":null,"notes":null,"arglists":["a mode-keyword"],"doc":"Sets the error-mode of agent a to mode-keyword, which must be\n either :fail or :continue. If an action being run by the agent\n throws an exception or doesn't pass the validator fn, an\n error-handler may be called (see set-error-handler!), after which,\n if the mode is :continue, the agent will continue as if neither the\n action that caused the error nor the error itself ever happened.\n \n If the mode is :fail, the agent will become failed and will stop\n accepting new 'send' and 'send-off' actions, and any previously\n queued actions will be held until a 'restart-agent'. Deref will\n still work, returning the state of the agent before the error.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/set-error-mode!"},{"added":"1.0","ns":"clojure.core","name":"re-seq","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1289192565000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"re-find","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521eb9"},{"created-at":1289192579000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"re-groups","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521eba"},{"created-at":1289192595000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"re-pattern","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ebb"},{"created-at":1289192599000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"re-matcher","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ebc"},{"created-at":1289192606000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"re-matches","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ebd"},{"created-at":1309320690000,"author":{"login":"pauldoo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5cb916d3c8abc9f45a093209e72489fb?r=PG&default=identicon"},"to-var":{"ns":"clojure.string","name":"split","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ebe"},{"created-at":1379040134000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"subs","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ebf"}],"line":4927,"examples":[{"author":{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (re-seq #\"\\d\" \"clojure 1.1.0\")\n(\"1\" \"1\" \"0\")\n","created-at":1279050384000,"updated-at":1285501878000,"_id":"542692cac026201cdc326b6a"},{"author":{"login":"ghoseb","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8aa4490274249db8981283bdadb2ec2b?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; Get a sequence of words out of a string.\nuser=\u003E (re-seq #\"\\w+\" \"mary had a little lamb\")\n(\"mary\" \"had\" \"a\" \"little\" \"lamb\")\n","created-at":1279060112000,"updated-at":1285501890000,"_id":"542692cac026201cdc326b6c"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[],"body":";; Parenthesized groups in the regex cause each returned match to be a\n;; vector of matched strings. See re-find for more examples.\nuser=\u003E (def line \" RX pkts:18 err:5 drop:48\")\n#'user/line\n\nuser=\u003E (re-seq #\"(\\S+):(\\d+)\" line)\n([\"pkts:18\" \"pkts\" \"18\"] [\"err:5\" \"err\" \"5\"] [\"drop:48\" \"drop\" \"48\"])\n","created-at":1324028413000,"updated-at":1324028413000,"_id":"542692d4c026201cdc327054"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[],"body":";; Note: See clojure.core/subs for discussion of behavior of substrings\n;; holding onto references of the original strings, which can\n;; significantly affect your memory usage in some cases.","created-at":1379040138000,"updated-at":1379040138000,"_id":"542692d4c026201cdc327055"}],"notes":null,"arglists":["re s"],"doc":"Returns a lazy sequence of successive matches of pattern in string,\n using java.util.regex.Matcher.find(), each such match processed with\n re-groups.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/re-seq"},{"added":"1.0","ns":"clojure.core","name":"char?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1321310793000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"char","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b4e"}],"line":155,"examples":[{"author":{"login":"mattdw","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ee24aacb65359196b0a1bad050f9a62f?r=PG&default=identicon"},"editors":[{"login":"philos99","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1de5617efb013ca7c9cf8e5646818ffa?r=PG&default=identicon"}],"body":"user=\u003E (char? \\a)\ntrue\n\nuser=\u003E (char? 22)\nfalse\n\nuser=\u003E (char? \"a\")\nfalse\n\nuser=\u003E (char? (first \"abc\"))\ntrue","created-at":1280322160000,"updated-at":1317219140000,"_id":"542692c9c026201cdc326a8d"}],"notes":null,"arglists":["x"],"doc":"Return true if x is a Character","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/char_q"},{"added":"1.0","ns":"clojure.core","name":"make-hierarchy","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1324008864000,"author":{"login":"stand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d7f9ed2753f8b3517f1539f6129f0a17?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"isa?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b84"},{"created-at":1332885418000,"author":{"login":"luskwater","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/f3b2650c3d4aa47c9e22bf9ba5596a9f?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"derive","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b85"},{"created-at":1341101551000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"underive","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b86"},{"created-at":1341101555000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"parents","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b87"},{"created-at":1341101559000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"descendants","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b88"},{"created-at":1341101563000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ancestors","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b89"}],"line":5581,"examples":[{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[],"body":";; use make-hierarchy to build your own local hierarchy for derive, isa?, etc. \n;; instead of using the global hierarchy\n;; note that the first ancestors call returns a nil since that type does not \n;; exist in the global hierarchy\n\nuser=\u003E (def h (make-hierarchy))\n#'user/h\nuser=\u003E (def h (derive h ::rect ::shape))\n#'user/h\nuser=\u003E (def h (derive h ::square ::rect))\n#'user/h\nuser=\u003E h\n{:parents {:user/square #{:user/rect}, :user/rect #{:user/shape}}, :ancestors {:\nuser/square #{:user/shape :user/rect}, :user/rect #{:user/shape}}, :descendants\n{:user/rect #{:user/square}, :user/shape #{:user/square :user/rect}}}\nuser=\u003E (ancestors ::square)\nnil\nuser=\u003E (ancestors h ::square)\n#{:user/shape :user/rect}\nuser=\u003E","created-at":1313896274000,"updated-at":1313896274000,"_id":"542692c8c026201cdc326a17"}],"notes":null,"arglists":[""],"doc":"Creates a hierarchy object for use with derive, isa? etc.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/make-hierarchy"},{"added":"1.5","ns":"clojure.core","name":"set-agent-send-executor!","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":2106,"examples":null,"notes":null,"arglists":["executor"],"doc":"Sets the ExecutorService to be used by send","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/set-agent-send-executor!"},{"added":"1.9","ns":"clojure.core","name":"swap-vals!","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":2374,"examples":null,"notes":null,"arglists":["atom f","atom f x","atom f x y","atom f x y & args"],"doc":"Atomically swaps the value of atom to be:\n (apply f current-value-of-atom args). Note that f may be called\n multiple times, and thus should be free of side effects.\n Returns [old new], the value of the atom before and after the swap.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/swap-vals!"},{"added":"1.2","ns":"clojure.core","name":"keep","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1337189081000,"author":{"login":"SoniaH","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/56a007a4b2c47b141bd39790278f88a7?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"keep-indexed","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c71"},{"created-at":1399907394000,"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"map","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c72"},{"created-at":1399907399000,"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"filter","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c73"}],"line":7505,"examples":[{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"},{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"}],"body":"user=\u003E (keep even? (range 1 10))\n(false true false true false true false true false)\n","created-at":1279071510000,"updated-at":1306319281000,"_id":"542692cfc026201cdc326e7f"},{"author":{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"},"editors":[{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"},{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"},{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"}],"body":";; comparisons among keep, map and for.\n\nuser\u003E (keep #(if (odd? %) %) (range 10))\n(1 3 5 7 9)\nuser\u003E (map #(if (odd? %) %) (range 10))\n(nil 1 nil 3 nil 5 nil 7 nil 9)\nuser\u003E (for [ x (range 10) :when (odd? x)] x)\n(1 3 5 7 9)\u0000\n\nuser\u003E (keep #(if(even? %) %) (range 10))\n(0 2 4 6 8)\nuser\u003E (map #(if (even? %) %) (range 10))\n(0 nil 2 nil 4 nil 6 nil 8 nil)\nuser\u003E (for [ x (range 10) :when (even? x)] x)\n(0 2 4 6 8)\n\n","created-at":1306319295000,"updated-at":1306356196000,"_id":"542692cfc026201cdc326e82"},{"author":{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"},"editors":[{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"},{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"},{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"},{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"},{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"}],"body":";; Sieve of Eratosthenes by using 'keep'.\n\n(defn keep-mcdr [f coll]\n (lazy-seq\n (when-let [x (first coll)]\n (cons x (keep-mcdr f (f x (rest coll)))))))\n\n(defn prime-number [n]\n (cons 1\n\t(keep-mcdr\n\t (fn[x xs] (if (not-empty xs)\n\t\t (keep #(if-not (zero? (rem % x)) %)\n\t\t\t xs)))\n\t (range 2 n))))\n\nuser\u003E (prime-number 100)\n(1 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97)\n","created-at":1306319303000,"updated-at":1306321343000,"_id":"542692cfc026201cdc326e86"}],"notes":null,"arglists":["f","f coll"],"doc":"Returns a lazy sequence of the non-nil results of (f item). Note,\n this means false return values will be included. f must be free of\n side-effects. Returns a transducer when no collection is provided.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/keep"},{"added":"1.1","ns":"clojure.core","name":"char","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1321310785000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"char?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b80"},{"created-at":1333595214000,"author":{"login":"Ljos","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/45b996a79abca465acaf6c0f10b0437?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"int","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b81"},{"created-at":1342917303000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"chars","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b82"},{"created-at":1342917307000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"char-array","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b83"}],"line":3536,"examples":[{"author":{"login":"mattdw","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ee24aacb65359196b0a1bad050f9a62f?r=PG&default=identicon"},"editors":[{"login":"philos99","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1de5617efb013ca7c9cf8e5646818ffa?r=PG&default=identicon"}],"body":";; can coerce an int (or similar)\nuser=\u003E (char 97)\n\\a\n\n;; a byte can be coerced to a char\nuser=\u003E (let [bytes-array (.getBytes \"abc\")]\n (char (first bytes-array)))\n\\a\n\n;; char is just a function\nuser=\u003E (map char [65 66 67 68])\n(\\A \\B \\C \\D)","created-at":1280322589000,"updated-at":1317219055000,"_id":"542692cdc026201cdc326d01"}],"notes":null,"arglists":["x"],"doc":"Coerce to char","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/char"},{"added":"1.0","ns":"clojure.core","name":"mapcat","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1294988622000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"map","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cb4"},{"created-at":1294988628000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"concat","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cb5"}],"line":2800,"examples":[{"author":{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (mapcat reverse [[3 2 1 0] [6 5 4] [9 8 7]])\n(0 1 2 3 4 5 6 7 8 9)\n","created-at":1279063141000,"updated-at":1285501773000,"_id":"542692cac026201cdc326b36"},{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (mapcat (fn [[k v]] \n (for [[k2 v2] v] \n (concat [k k2] v2)))\n '{:a {:x (1 2) :y (3 4)}\n :b {:x (1 2) :z (5 6)}})\n\n((:a :x 1 2) (:a :y 3 4) (:b :x 1 2) (:b :z 5 6))","created-at":1337333286000,"updated-at":1337333286000,"_id":"542692d4c026201cdc327006"},{"author":{"login":"uvtc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/34f159f89cbd1d9beac0276f5a7af552?r=PG&default=identicon"},"editors":[{"login":"uvtc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/34f159f89cbd1d9beac0276f5a7af552?r=PG&default=identicon"}],"body":"user=\u003E (require '[clojure.string :as cs])\nnil\n\n;; Suppose you have a fn in a `map` that itself returns\n;; multiple values.\nuser=\u003E (map #(cs/split % #\"\\d\") [\"aa1bb\" \"cc2dd\" \"ee3ff\"])\n([\"aa\" \"bb\"] [\"cc\" \"dd\"] [\"ee\" \"ff\"])\n\n;; Now, if you want to concat them all together, you *could*\n;; do this:\nuser=\u003E (apply concat (map #(cs/split % #\"\\d\") [\"aa1bb\" \"cc2dd\" \"ee3ff\"]))\n(\"aa\" \"bb\" \"cc\" \"dd\" \"ee\" \"ff\")\n\n;; But `mapcat` can save you a step:\nuser=\u003E (mapcat #(cs/split % #\"\\d\") [\"aa1bb\" \"cc2dd\" \"ee3ff\"])\n(\"aa\" \"bb\" \"cc\" \"dd\" \"ee\" \"ff\")\n","created-at":1340097786000,"updated-at":1340099694000,"_id":"542692d4c026201cdc327007"},{"author":{"login":"uvtc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/34f159f89cbd1d9beac0276f5a7af552?r=PG&default=identicon"},"editors":[],"body":";; Suppose you've got a function that takes a value\n;; and returns a list of things from it, for example:\n(defn f1\n [n]\n [(- n 1) n (+ n 1)])\n\n(f1 1)\n;=\u003E [0 1 2]\n\n;; Perhaps you'd like to map it onto each item in a collection:\n(map f1 [1 2 3])\n;=\u003E ([0 1 2] [1 2 3] [2 3 4])\n\n;; But suppose you wanted them all concatenated? You could do this:\n(apply concat (map f1 [1 2 3]))\n;=\u003E (0 1 2 1 2 3 2 3 4)\n\n;; Or you could get the same thing with `mapcat`:\n(mapcat f1 [1 2 3])\n;=\u003E (0 1 2 1 2 3 2 3 4)\n","created-at":1343650918000,"updated-at":1343650918000,"_id":"542692d4c026201cdc327009"},{"author":{"login":"devth","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/70c7535cbb9fea0353250a4edda155be?r=PG&default=identicon"},"editors":[],"body":"; Flatten a map, consing keys on to each nested vector \n(mapcat (fn [[k vs]] (map (partial cons k) vs)) {:foo [[1 2] [3 2]] :bar [[3 1]]})\n;=\u003E ((:foo 1 2) (:foo 3 2) (:bar 3 1))\n","created-at":1357801138000,"updated-at":1357801138000,"_id":"542692d4c026201cdc32700a"}],"notes":null,"arglists":["f","f & colls"],"doc":"Returns the result of applying concat to the result of applying map\n to f and colls. Thus function f should return a collection. Returns\n a transducer when no collections are provided","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/mapcat"},{"added":"1.3","ns":"clojure.core","name":"unchecked-long","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":3566,"examples":null,"notes":null,"arglists":["x"],"doc":"Coerce to long. Subject to rounding or truncation.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/unchecked-long"},{"added":"1.0","ns":"clojure.core","name":"aset-long","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":3977,"examples":[{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[],"body":";; create an array of 10 longs and set one of the values to 31415\n\nuser=\u003E (def ls (long-array 10))\n#'user/ls\nuser=\u003E (vec ls)\n[0 0 0 0 0 0 0 0 0 0]\nuser=\u003E (aset-long ls 3 31415)\n31415\nuser=\u003E (vec ls)\n[0 0 0 31415 0 0 0 0 0 0]\nuser=\u003E","created-at":1313915173000,"updated-at":1313915173000,"_id":"542692cec026201cdc326d8a"}],"notes":null,"arglists":["array idx val","array idx idx2 & idxv"],"doc":"Sets the value at the index/indices. Works on arrays of long. Returns val.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/aset-long"},{"added":"1.6","ns":"clojure.core","name":"some?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":533,"examples":null,"notes":null,"tag":"java.lang.Boolean","arglists":["x"],"doc":"Returns true if x is not nil, false otherwise.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/some_q"},{"added":"1.0","ns":"clojure.core","name":"unchecked-negate","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1289217312000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unchecked-add","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c21"},{"created-at":1289217314000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unchecked-dec","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c22"},{"created-at":1289217316000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unchecked-inc","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c23"},{"created-at":1289217318000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unchecked-negate","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c24"},{"created-at":1289217321000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unchecked-divide","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c25"},{"created-at":1289217324000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unchecked-subtract","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c26"},{"created-at":1289217326000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unchecked-multiply","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c27"},{"created-at":1289217329000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unchecked-remainder","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c28"}],"line":1198,"examples":null,"notes":null,"arglists":["x"],"doc":"Returns the negation of x, a long.\n Note - uses a primitive operator subject to overflow.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/unchecked-negate"},{"added":"1.10","ns":"clojure.core","name":"remove-tap","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":8117,"examples":null,"notes":null,"arglists":["f"],"doc":"Remove f from the tap set.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/remove-tap"},{"added":"1.0","ns":"clojure.core","name":"gen-interface","file":"clojure/genclass.clj","type":"macro","column":1,"see-alsos":[{"created-at":1360270679000,"author":{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"proxy","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dbf"},{"created-at":1360270682000,"author":{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"gen-class","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dc0"}],"line":700,"examples":null,"macro":true,"notes":null,"arglists":["& options"],"doc":"When compiling, generates compiled bytecode for an interface with\n the given package-qualified :name (which, as all names in these\n parameters, can be a string or symbol), and writes the .class file\n to the *compile-path* directory. When not compiling, does nothing.\n \n In all subsequent sections taking types, the primitive types can be\n referred to by their Java names (int, float etc), and classes in the\n java.lang package can be used without a package qualifier. All other\n classes must be fully qualified.\n \n Options should be a set of key/value pairs, all except for :name are\n optional:\n\n :name aname\n\n The package-qualified name of the class to be generated\n\n :extends [interface ...]\n\n One or more interfaces, which will be extended by this interface.\n\n :methods [ [name [param-types] return-type], ...]\n\n This parameter is used to specify the signatures of the methods of\n the generated interface. Do not repeat superinterface signatures\n here.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/gen-interface"},{"added":"1.0","ns":"clojure.core","name":"*command-line-args*","type":"var","see-alsos":null,"examples":[{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[],"body":";; If you save this program as showargs.clj on a Unix-like system, then the\n;; following command will produce the output shown.\n\n;; % java -classpath clojure-1.2.0.jar clojure.main showargs.clj arg1 2 \"whitespace in most command shells if you quote\"\n;; arg='arg1'\n;; arg='2'\n;; arg='whitespace in most command shells if you quote'\n;; \n;; \n;; Second arg is string 2, not number 2.\n\n(ns com.demo.showargs)\n\n(doseq [arg *command-line-args*]\n (printf \"arg='%s'\\n\" arg))\n\n(if (= \"2\" (second *command-line-args*))\n (println \"\\n\\nSecond arg is string 2, not number 2.\"))\n","created-at":1298557801000,"updated-at":1298557801000,"_id":"542692c8c026201cdc326a6a"}],"notes":null,"arglists":[],"doc":"A sequence of the supplied command line arguments, or nil if\n none were supplied","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/*command-line-args*"},{"added":"1.0","ns":"clojure.core","name":"reverse","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1293103264000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"rseq","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521de3"}],"line":949,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (reverse '(1 2 3))\n(3 2 1)\n","created-at":1280321963000,"updated-at":1285496763000,"_id":"542692cbc026201cdc326bf7"}],"notes":[{"updated-at":1293103337000,"body":"If you've got a vector rseq is a good option instead of reverse.","created-at":1293103337000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fb0"}],"arglists":["coll"],"doc":"Returns a seq of the items in coll in reverse order. Not lazy.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/reverse"},{"added":"1.9","ns":"clojure.core","name":"inst?","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":6922,"examples":null,"notes":null,"arglists":["x"],"doc":"Return true if x satisfies Inst","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/inst_q"},{"added":"1.0","ns":"clojure.core","name":"range","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":3043,"examples":[{"author":{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},"editors":[{"login":"Dmitry Kakurin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/85b70be5da433a6adf5112e7140848da?r=PG&default=identicon"},{"login":"Dmitry Kakurin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/85b70be5da433a6adf5112e7140848da?r=PG&default=identicon"},{"login":"Dmitry Kakurin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/85b70be5da433a6adf5112e7140848da?r=PG&default=identicon"},{"login":"Dmitry Kakurin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/85b70be5da433a6adf5112e7140848da?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"MrHus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4fa262299223e58030e9062d97224547?r=PG&default=identicon"},{"login":"rafmagana","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/40bd727b22d74930f292b63d45a71b07?r=PG&default=identicon"},{"login":"rafmagana","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/40bd727b22d74930f292b63d45a71b07?r=PG&default=identicon"}],"body":";; default value of 'end' is infinity\nuser=\u003E (range)\n(0 1 2 3 4 5 6 7 8 9 10 ... 12770 12771 12772 12773 ... n\n\n;; Since clojure 1.2:\nuser=\u003E (take 10 (range))\n(0 1 2 3 4 5 6 7 8 9)\n\nuser=\u003E (range 10)\n(0 1 2 3 4 5 6 7 8 9)\n\nuser=\u003E (range -5 5)\n(-5 -4 -3 -2 -1 0 1 2 3 4)\n\nuser=\u003E (range -100 100 10)\n(-100 -90 -80 -70 -60 -50 -40 -30 -20 -10 0 10 20 30 40 50 60 70 80 90)\n\nuser=\u003E (range 0 4 2)\n(0 2)\n\nuser=\u003E (range 0 5 2)\n(0 2 4)\n\nuser=\u003E (range 0 6 2)\n(0 2 4)\n\nuser=\u003E (range 0 7 2)\n(0 2 4 6)\n\nuser=\u003E (range 100 0 -10)\n(100 90 80 70 60 50 40 30 20 10)\n\nuser=\u003E (range 10 -10 -1)\n(10 9 8 7 6 5 4 3 2 1 0 -1 -2 -3 -4 -5 -6 -7 -8 -9)\n \n\n","created-at":1279160563000,"updated-at":1340442981000,"_id":"542692ccc026201cdc326c77"},{"author":{"login":"pkolloch","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/10b2fd3c0a4cc46dc241a48468dc551?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; Since clojure 1.2:\n\nuser=\u003E (take 10 (range))\n(0 1 2 3 4 5 6 7 8 9)\n","created-at":1282319317000,"updated-at":1285494502000,"_id":"542692ccc026201cdc326c80"},{"author":{"login":"rebcabin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/880b0bb3a4be9237326dd69565444dee?r=PG&default=identicon"},"editors":[],"body":";; finite range over java Integers\nuser=\u003E (take 5 (range 42 (java.lang.Integer/MAX_VALUE)))\n(42 43 44 45 46)\n\n;; infinite range starting at a certain point\nuser=\u003E (take 5 (drop 42 (range)))\n(42 43 44 45 46)\n","created-at":1374181746000,"updated-at":1374181746000,"_id":"542692d4c026201cdc327048"}],"notes":null,"arglists":["","end","start end","start end step"],"doc":"Returns a lazy seq of nums from start (inclusive) to end\n (exclusive), by step, where start defaults to 0, step to 1, and end to\n infinity. When step is equal to 0, returns an infinite sequence of\n start. When start is equal to end, returns empty list.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/range"},{"added":"1.0","ns":"clojure.core","name":"sort","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1285265346000,"author":{"login":"morphling","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/90ffa70a579c3e0c398b7523ecdc6a87?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"sort-by","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e7c"}],"line":3110,"examples":[{"author":{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},"editors":[{"login":"morphling","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/90ffa70a579c3e0c398b7523ecdc6a87?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (sort [3 1 2 4])\n(1 2 3 4)\n\nuser=\u003E (sort \u003E (vals {:foo 5, :bar 2, :baz 10}))\n(10 5 2)\n\n;; do not do this, use sort-by instead\nuser=\u003E (sort #(compare (last %1) (last %2)) {:b 1 :c 3 :a 2})\n([:b 1] [:a 2] [:c 3])\n\n;; like this:\nuser=\u003E (sort-by last {:b 1 :c 3 :a 2})\n([:b 1] [:a 2] [:c 3])","created-at":1281550866000,"updated-at":1332950452000,"_id":"542692cfc026201cdc326e5b"},{"author":{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"},"editors":[{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"},{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"},{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"},{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"}],"body":";; make a struct 'goods'. it assumes that every goods has\n;; its id number and price.\n(defstruct goods :id :price)\n\n;; generate data.\n(def data (map #(struct goods %1 %2)\n\t (shuffle (range 0 10)) (shuffle\n\t\t\t\t (into (range 100 500 100)\n\t\t\t\t\t (range 100 500 100)))))\n\n(defn comp-goods-price\n \"a compare function by :price of the struct 'goods.' the sort order \n is superior to the lower price and if the price is same, it is \n superior to the lower id.\"\n [el1 el2]\n (if (or (\u003C (:price el1) (:price el2))\n\t (and (= (:price el1) (:price el2))(\u003C (:id el1) (:id el2))))\n true\n false))\n\nuser\u003E data\n({:id 1, :price 300} {:id 6, :price 100} {:id 3, :price 100} {:id 4, :price 400} {:id 0, :price 300} {:id 2, :price 200} {:id 5, :price 200} {:id 8, :price 400})\nuser\u003E (sort (comp comp-goods-price) data)\n({:id 3, :price 100} {:id 6, :price 100} {:id 2, :price 200} {:id 5, :price 200} {:id 0, :price 300} {:id 1, :price 300} {:id 4, :price 400} {:id 8, :price 400})\nuser\u003E (sort-by :price \u003C data) ; compare this with the above.\n({:id 6, :price 100} {:id 3, :price 100} {:id 2, :price 200} {:id 5, :price 200} {:id 1, :price 300} {:id 0, :price 300} {:id 4, :price 400} {:id 8, :price 400})\n\n\n","created-at":1306322169000,"updated-at":1306322544000,"_id":"542692cfc026201cdc326e5e"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":";; Warning: You can sort a Java array and get back a sorted immutable Clojure\n;; data structure, but it will also change the input Java array, by sorting it.\n;; Copy the array before sorting if you want to avoid this.\n\nuser=\u003E (def x (to-array [32 11]))\n#'user/x\n\nuser=\u003E (seq x)\n(32 11)\n\nuser=\u003E (def y (sort x))\n#'user/y\n\n;; Return sorted sequence\nuser=\u003E y\n(11 32)\n\nuser=\u003E (class y)\nclojure.lang.ArraySeq\n\n;; but also modifies x, because it used the array to do the sorting.\nuser=\u003E (seq x)\n(11 32)\n\n;; One way to avoid this is copying the array before sorting:\nuser=\u003E (def y (sort (aclone x)))\n#'user/y","created-at":1331771749000,"updated-at":1332833601000,"_id":"542692d5c026201cdc32708e"}],"notes":null,"arglists":["coll","comp coll"],"doc":"Returns a sorted sequence of the items in coll. If no comparator is\n supplied, uses compare. comparator must implement\n java.util.Comparator. Guaranteed to be stable: equal elements will\n not be reordered. If coll is a Java array, it will be modified. To\n avoid this, sort a copy of the array.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/sort"},{"ns":"clojure.core","name":"-cache-protocol-fn","file":"clojure/core_deftype.clj","type":"function","column":1,"see-alsos":null,"line":577,"examples":null,"notes":null,"arglists":["pf x c interf"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core/-cache-protocol-fn"},{"added":"1.0","ns":"clojure.core","name":"unchecked-inc-int","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":1163,"examples":null,"notes":null,"arglists":["x"],"doc":"Returns a number one greater than x, an int.\n Note - uses a primitive operator subject to overflow.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/unchecked-inc-int"},{"added":"1.2","ns":"clojure.core","name":"map-indexed","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1290495691000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"map","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e3e"},{"created-at":1324314182000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"keep-indexed","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e3f"}],"line":7475,"examples":[{"author":{"login":"kredaxx","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4c1869a83a1bf9c5090b07b0db6fb450?r=PG&default=identicon"},"editors":[{"login":"kredaxx","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4c1869a83a1bf9c5090b07b0db6fb450?r=PG&default=identicon"},{"login":"kredaxx","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4c1869a83a1bf9c5090b07b0db6fb450?r=PG&default=identicon"},{"login":"kredaxx","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4c1869a83a1bf9c5090b07b0db6fb450?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (map-indexed (fn [idx itm] [idx itm]) \"foobar\")\n([0 \\f] [1 \\o] [2 \\o] [3 \\b] [4 \\a] [5 \\r])\n\n","created-at":1280778877000,"updated-at":1285495435000,"_id":"542692cdc026201cdc326d25"},{"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"editors":[],"body":";; or simply\nuser=\u003E (map-indexed vector \"foobar\")\n([0 \\f] [1 \\o] [2 \\o] [3 \\b] [4 \\a] [5 \\r])","created-at":1324306400000,"updated-at":1324306400000,"_id":"542692d4c026201cdc327005"}],"notes":null,"arglists":["f","f coll"],"doc":"Returns a lazy sequence consisting of the result of applying f to 0\n and the first item of coll, followed by applying f to 1 and the second\n item in coll, etc, until coll is exhausted. Thus function f should\n accept 2 arguments, index and item. Returns a stateful transducer when\n no collection is provided.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/map-indexed"},{"added":"1.1","ns":"clojure.core","name":"with-bindings","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1365637665000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"with-bindings*","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ade"},{"created-at":1374310477000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"with-local-vars","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521adf"},{"created-at":1374313569000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"binding","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ae0"},{"created-at":1375792510000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"with-redefs","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ae1"}],"line":2003,"examples":null,"macro":true,"notes":null,"arglists":["binding-map & body"],"doc":"Takes a map of Var/value pairs. Installs for the given Vars the associated\n values as thread-local bindings. Then executes body. Pops the installed\n bindings after body was evaluated. Returns the value of body.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/with-bindings"},{"added":"1.2","ns":"clojure.core","name":"rand-nth","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1292321208000,"author":{"login":"alimoeeny","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e8dd06976ead4082d2181f3807117e1?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"rand","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f63"}],"line":7379,"examples":[{"author":{"login":"pkolloch","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/10b2fd3c0a4cc46dc241a48468dc551?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"XPherior","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/656a48d6bef2a9f034af0e8b2b4d588d?r=PG&default=identicon"}],"body":"user=\u003E (def food [:ice-cream :steak :apple])\n#'user/food\n\nuser=\u003E (rand-nth food)\n:apple\nuser=\u003E (rand-nth food)\n:ice-cream\n","created-at":1282319178000,"updated-at":1352188362000,"_id":"542692cec026201cdc326dfe"}],"notes":null,"arglists":["coll"],"doc":"Return a random element of the (sequential) collection. Will have\n the same performance characteristics as nth for the given\n collection.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/rand-nth"},{"added":"1.0","ns":"clojure.core","name":"comp","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1358904701000,"author":{"login":"Ljos","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/45b996a79abca465acaf6c0f10b0437?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"partial","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ec3"},{"created-at":1358904763000,"author":{"login":"Ljos","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/45b996a79abca465acaf6c0f10b0437?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"juxt","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ec4"}],"line":2574,"examples":[{"author":{"login":"citizen428","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b3881a28fe402dd2d1de44717486cae8?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (def negative-quotient (comp - /))\n#'user/negative-quotient\n\nuser=\u003E (negative-quotient 8 3) \n-8/3\n\n\nuser=\u003E (def concat-and-reverse (comp (partial apply str) reverse str)) \n#'user/concat-and-reverse\n\nuser=\u003E (concat-and-reverse \"hello\" \"clojuredocs\")\n\"scoderujolcolleh\"\n","created-at":1280554862000,"updated-at":1285496113000,"_id":"542692cbc026201cdc326c04"},{"author":{"login":"zpinter","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e8a89e26df41f3dd921ff1de2afa4db7?r=PG&default=identicon"},"editors":[],"body":"user=\u003E ((comp str +) 8 8 8)\n\"24\"","created-at":1292499977000,"updated-at":1292499977000,"_id":"542692cbc026201cdc326c06"},{"author":{"login":"semperos","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/edeae8e7534b3d554e4ec2c35ffc68d?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (map\n (comp - (partial + 3) (partial * 2))\n [1 2 3 4])\n; returns\n(-5 -7 -9 -11)","created-at":1296193214000,"updated-at":1296193214000,"_id":"542692cbc026201cdc326c07"},{"author":{"login":"MrHus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4fa262299223e58030e9062d97224547?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (filter (comp not zero?) [0 1 0 2 0 3 0 4])\n(1 2 3 4)","created-at":1305843170000,"updated-at":1305843170000,"_id":"542692cbc026201cdc326c08"},{"author":{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"},"editors":[{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"},{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"},{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"},{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"},{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"}],"body":";; make a struct 'goods'. it assumes that every goods has\n;; its id number and price.\n(defstruct goods :id :price)\n\n;; generate data.\n(def data (map #(struct goods %1 %2)\n\t (shuffle (range 0 10)) (shuffle\n\t\t\t\t (into (range 100 500 100)\n\t\t\t\t\t (range 100 500 100)))))\n\n(defn comp-goods-price\n \"a compare function by :price of the struct 'goods.' the sort order \n is that the lower price is superior to the higher one and if the \n price is same, the lower id is superior to the higher one.\"\n [el1 el2]\n (if (or (\u003C (:price el1) (:price el2))\n (and (= (:price el1) (:price el2))(\u003C (:id el1) (:id el2))))\n true\n false))\n\nuser\u003E data\n({:id 1, :price 300} {:id 6, :price 100} {:id 3, :price 100} {:id 4, :price 400} {:id 0, :price 300} {:id 2, :price 200} {:id 5, :price 200} {:id 8, :price 400})\nuser\u003E (sort (comp comp-goods-price) data)\n({:id 3, :price 100} {:id 6, :price 100} {:id 2, :price 200} {:id 5, :price 200} {:id 0, :price 300} {:id 1, :price 300} {:id 4, :price 400} {:id 8, :price 400})\nuser\u003E (sort-by :price \u003C data) ; compare this with the above.\n({:id 6, :price 100} {:id 3, :price 100} {:id 2, :price 200} {:id 5, :price 200} {:id 1, :price 300} {:id 0, :price 300} {:id 4, :price 400} {:id 8, :price 400})\n\n;; Yet another example of 'comp' by PriorityBlockingQueue.\n\nuser\u003E (import [java.util.concurrent PriorityBlockingQueue])\njava.util.concurrent.PriorityBlockingQueue\nuser\u003E (def pqdata (new PriorityBlockingQueue 8\n\t\t (comp comp-goods-price)))\n#'user/pqdata\nuser\u003E (doseq [x data]\n\t (.add pqdata x))\nnil\nuser\u003E (dotimes [_ 8]\n\t (println (.poll pqdata)))\n{:id 3, :price 100}\n{:id 6, :price 100}\n{:id 2, :price 200}\n{:id 5, :price 200}\n{:id 0, :price 300}\n{:id 1, :price 300}\n{:id 4, :price 400}\n{:id 8, :price 400}\nnil\nuser\u003E ","created-at":1306322829000,"updated-at":1306344018000,"_id":"542692cbc026201cdc326c09"},{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (def countif (comp count filter))\n#'user/countif\nuser=\u003E (countif even? [2 3 1 5 4])\n2","created-at":1313975540000,"updated-at":1313975540000,"_id":"542692cbc026201cdc326c0f"},{"author":{"login":"Will","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a449004e52cfddd142e63a1d317b191d?r=PG&default=identicon"},"editors":[],"body":"; Get 2nd to last element from a list\nuser=\u003E ( (comp second reverse) '(\"a\" 2 7 \"b\"))\n7","created-at":1344506218000,"updated-at":1344506218000,"_id":"542692d2c026201cdc326f64"}],"notes":null,"arglists":["","f","f g","f g & fs"],"doc":"Takes a set of functions and returns a fn that is the composition\n of those fns. The returned fn takes a variable number of args,\n applies the rightmost of fns to the args, the next\n fn (right-to-left) to the result, etc.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/comp"},{"added":"1.0","ns":"clojure.core","name":"await","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1298860359000,"author":{"login":"ninjudd","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7ced25585a7556e9b9b975c1f9e136e3?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"await-for","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521a8a"}],"line":3292,"examples":[{"author":{"login":"ghoseb","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8aa4490274249db8981283bdadb2ec2b?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"(def *agnt* (agent {}))\n\nuser=\u003E (send-off *agnt* (fn [state] \n (Thread/sleep 10000)\n (assoc state :done true)))\n#<Agent@5db18235: {}>\n\nuser=\u003E (await *agnt*) ; blocks till the agent action is finished\nnil","created-at":1283693589000,"updated-at":1285488477000,"_id":"542692cdc026201cdc326cdb"}],"notes":null,"arglists":["& agents"],"doc":"Blocks the current thread (indefinitely!) until all actions\n dispatched thus far, from this thread or agent, to the agent(s) have\n occurred. Will block on failed agents. Will never return if\n a failed agent is restarted with :clear-actions true or shutdown-agents was called.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/await"},{"added":"1.2","ns":"clojure.core","name":"spit","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1330170569000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"slurp","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e97"},{"created-at":1330170573000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.java.io","name":"writer","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e98"},{"created-at":1350073135000,"author":{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"load-file","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e99"}],"line":7101,"examples":[{"author":{"login":"pkolloch","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/10b2fd3c0a4cc46dc241a48468dc551?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"}],"body":"user=\u003E (spit \"flubber.txt\" \"test\")\nnil\nuser=\u003E (slurp \"flubber.txt\")\n\"test\"","created-at":1280458792000,"updated-at":1366325983000,"_id":"542692c7c026201cdc326972"},{"author":{"login":"megapatch","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9a9b25017146e62801acc97861d74c4e?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (spit \"event.log\" \"test 1\\n\" :append true)\nnil\n\nuser=\u003E (spit \"event.log\" \"test 2\\n\" :append true)\nnil\n\nuser=\u003E (println (slurp \"event.log\"))\ntest 1\ntest 2\n\nnil\n","created-at":1283972766000,"updated-at":1285487376000,"_id":"542692c7c026201cdc326975"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[{"login":"Juxtaspiral","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1b0546af898df8046160d0ed80e13165?r=PG&default=identicon"}],"body":"(defn append-to-file\n \"Uses spit to append to a file specified with its name as a string, or\n anything else that writer can take as an argument. s is the string to\n append.\" \n [file-name s]\n (spit file-name s :append true))","created-at":1334796093000,"updated-at":1348351258000,"_id":"542692d5c026201cdc32709b"}],"notes":null,"arglists":["f content & options"],"doc":"Opposite of slurp. Opens f with writer, writes content, then\n closes f. Options passed to clojure.java.io/writer.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/spit"},{"added":"1.1","ns":"clojure.core","name":"future-done?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1297120552000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"future","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521df0"},{"created-at":1339251476000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"future-cancel","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521df1"},{"created-at":1339252213000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"future?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521df2"},{"created-at":1339252225000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"future-cancelled?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521df3"}],"line":6615,"examples":[{"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (def f (future (Thread/sleep 5000) (inc 0)))\n\nuser=\u003E (future-done? f) \nfalse\n\nuser=\u003E (Thread/sleep 5000)\nnil\n\nuser=\u003E (future-done? f)\ntrue\n\n","created-at":1339251719000,"updated-at":1339251719000,"_id":"542692d3c026201cdc326fb7"},{"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"editors":[],"body":";; beware of cancellation !!!\n\nuser=\u003E (def f (future (Thread/sleep 5000) (inc 0)))\n#'user/f\n\nuser=\u003E (future-cancel f) \ntrue\n\nuser=\u003E (future-cancelled? f) \ntrue\n\nuser=\u003E (future-done? f) \ntrue\n\nuser=\u003E @f \njava.util.concurrent.CancellationException (NO_SOURCE_FILE:0)","created-at":1339252193000,"updated-at":1339252193000,"_id":"542692d3c026201cdc326fb8"}],"notes":[{"updated-at":1300164452000,"body":"Future \"done\" returns true even for abnormal termination like being cancelled or throwing an exception.\r\n\r\nhttp://download.oracle.com/javase/6/docs/api/java/util/concurrent/Future.html#isDone()","created-at":1300164452000,"author":{"login":"pauldoo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5cb916d3c8abc9f45a093209e72489fb?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fb8"}],"arglists":["f"],"doc":"Returns true if future f is done","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/future-done_q"},{"added":"1.0","ns":"clojure.core","name":"*read-eval*","type":"var","see-alsos":[{"created-at":1352963695000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"read","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d50"},{"created-at":1352963701000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"read-string","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d51"},{"created-at":1352963704000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"load","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d52"}],"examples":[{"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"editors":[{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"}],"body":";;just from the doc\n\n(binding [*read-eval* false] (read-string \"#=(eval (def x 3))\"))\n=\u003E EvalReader not allowed when *read-eval* is false.\n [Thrown class java.lang.RuntimeException]\n\n;;remove the anonymous function:\n\n(binding [*read-eval* false] (read-string \"(def x 3)\"))\n=\u003E (def x 3)\n\n;;which is evaluable\n\n(eval (binding [*read-eval* false] (read-string \"(def x 3)\")))\n=\u003E #'user/x\n\nx\n=\u003E3","created-at":1327090750000,"updated-at":1327090760000,"_id":"542692d1c026201cdc326f3a"}],"notes":null,"arglists":[],"doc":"Defaults to true (or value specified by system property, see below)\n ***This setting implies that the full power of the reader is in play,\n including syntax that can cause code to execute. It should never be\n used with untrusted sources. See also: clojure.edn/read.***\n\n When set to logical false in the thread-local binding,\n the eval reader (#=) and record/type literal syntax are disabled in read/load.\n Example (will fail): (binding [*read-eval* false] (read-string \"#=(* 2 21)\"))\n\n The default binding can be controlled by the system property\n 'clojure.read.eval' System properties can be set on the command line\n like this:\n\n java -Dclojure.read.eval=false ...\n\n The system property can also be set to 'unknown' via\n -Dclojure.read.eval=unknown, in which case the default binding\n is :unknown and all reads will fail in contexts where *read-eval*\n has not been explicitly bound to either true or false. This setting\n can be a useful diagnostic tool to ensure that all of your reads\n occur in considered contexts. You can also accomplish this in a\n particular scope by binding *read-eval* to :unknown\n ","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/*read-eval*"},{"added":"1.0","ns":"clojure.core","name":"dorun","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1296708499000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"doall","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d8c"}],"line":3141,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[],"body":"\u003Cpre\u003E\r\nuser=\u003E (dorun 5 (repeatedly #(println \"hi\")))\r\nhi\r\nhi\r\nhi\r\nhi\r\nhi\r\nhi\r\nnil\r\n\u003C/pre\u003E","created-at":1281092803000,"updated-at":1281092803000,"_id":"542692c6c026201cdc326907"},{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (let [x (atom 0)]\n (dorun (take 10 (repeatedly #(swap! x inc))))\n @x)\n10","created-at":1335431834000,"updated-at":1335431834000,"_id":"542692d2c026201cdc326f8e"},{"author":{"login":"john.r.woodward","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/22b6fbc4a386291e45b1cb4449377086?r=PG&default=identicon"},"editors":[{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},{"login":"orivej","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cab90c7de5efde92a29f1eacb603ba9a?r=PG&default=identicon"},{"login":"orivej","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cab90c7de5efde92a29f1eacb603ba9a?r=PG&default=identicon"}],"body":"user=\u003E (dorun (map #(println \"hi\" %) [\"mum\" \"dad\" \"sister\"]))\nhi mum\nhi dad\nhi sister\nnil","created-at":1343166324000,"updated-at":1362554649000,"_id":"542692d2c026201cdc326f8f"}],"notes":null,"arglists":["coll","n coll"],"doc":"When lazy sequences are produced via functions that have side\n effects, any effects other than those needed to produce the first\n element in the seq do not occur until the seq is consumed. dorun can\n be used to force any effects. Walks through the successive nexts of\n the seq, does not retain the head and returns nil.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/dorun"},{"added":"1.9","ns":"clojure.core","name":"simple-symbol?","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":1642,"examples":null,"notes":null,"arglists":["x"],"doc":"Return true if x is a symbol without a namespace","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/simple-symbol_q"},{"added":"1.0","ns":"clojure.core","name":"disj","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1351063996000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"dissoc","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e31"},{"created-at":1351064021000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"disj!","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e32"},{"created-at":1405367718000,"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"to-var":{"ns":"clojure.set","name":"difference","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e33"}],"line":1533,"examples":[{"author":{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},"editors":[{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (disj #{1 2 3}) ; disjoin nothing \n#{1 2 3} \n\nuser=\u003E (disj #{1 2 3} 2) ; disjoin 2\n#{1 3} \n\nuser=\u003E (disj #{1 2 3} 4) ; disjoin not existed item\n#{1 2 3} \n\nuser=\u003E (disj #{1 2 3} 1 3) ; disjoin several items at once\n#{2}","created-at":1280340321000,"updated-at":1332950019000,"_id":"542692cec026201cdc326dc6"}],"notes":null,"arglists":["set","set key","set key & ks"],"doc":"disj[oin]. Returns a new set of the same (hashed/sorted) type, that\n does not contain key(s).","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/disj"},{"added":"1.0","ns":"clojure.core","name":"*2","file":"clojure/core.clj","type":"var","column":1,"see-alsos":[{"created-at":1303109714000,"author":{"login":"Havvy","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e799a79441c7543be48562403411cd13?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"*1","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ad4"},{"created-at":1303109726000,"author":{"login":"Havvy","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e799a79441c7543be48562403411cd13?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"*3","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ad5"}],"dynamic":true,"line":6350,"examples":[{"author":{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E \"Hello!\"\n\"Hello!\"\n\nuser=\u003E \"Hello World!\"\n\"Hello World!\"\n\nuser=\u003E [*1 *2]\n[\"Hello World!\" \"Hello!\"]\n","created-at":1279048024000,"updated-at":1285502123000,"_id":"542692c7c026201cdc326960"}],"notes":null,"arglists":[],"doc":"bound in a repl thread to the second most recent value printed","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/*2"},{"added":"1.0","ns":"clojure.core","name":"eval","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1318930260000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"read-string","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ea3"}],"line":3228,"examples":[{"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (def *foo* \"(println [1 2 3])\")\n#'user/*foo*\n\nuser=\u003E *foo*\n\"(println [1 2 3])\"\n\nuser=\u003E (eval *foo*) ; Notice eval'ing a string does not work.\n\"(println [1 2 3])\"\n\nuser=\u003E (eval (read-string *foo*))\n[1 2 3]\nnil","created-at":1280547525000,"updated-at":1332949962000,"_id":"542692cec026201cdc326daf"},{"author":{"login":"steveminer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d28543d134185d12d4006a74738d233e?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (eval '(let [a 10] (+ 3 4 a)))\n17\n","created-at":1308973342000,"updated-at":1308973342000,"_id":"542692cec026201cdc326db1"}],"notes":[{"updated-at":1308973573000,"body":"In normal code, `eval` is rarely used.","created-at":1308973573000,"author":{"login":"steveminer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d28543d134185d12d4006a74738d233e?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fc2"}],"arglists":["form"],"doc":"Evaluates the form data structure (not text!) and returns the result.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/eval"},{"added":"1.0","ns":"clojure.core","name":"cons","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1297212928000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"conj","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d54"}],"line":22,"examples":[{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},{"login":"OnesimusUnbound","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fa4c391db0d2d1744cc2cd0d787dd3d?r=PG&default=identicon"}],"body":"user=\u003E (cons 1 '(2 3 4 5 6))\n(1 2 3 4 5 6)\n\nuser=\u003E (cons [1 2] [4 5 6])\n([1 2] 4 5 6)","created-at":1279071078000,"updated-at":1311798462000,"_id":"542692ccc026201cdc326c5b"}],"notes":null,"arglists":["x seq"],"doc":"Returns a new seq where x is the first element and seq is\n the rest.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/cons"},{"added":"1.0","ns":"clojure.core","name":"refer","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1327515389000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"refer-clojure","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f2c"},{"created-at":1351990184000,"author":{"login":"Mark Addleman","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/768de71b6c873394290733acf422b4d5?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ns","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f2d"}],"line":4243,"examples":[{"author":{"login":"teyc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bd6e62afb4881ab0f617611b8b65d003?r=PG&default=identicon"},"editors":[{"login":"teyc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bd6e62afb4881ab0f617611b8b65d003?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"}],"body":"user=\u003E (refer 'clojure.string :only '[capitalize trim])\nnil\n\nuser=\u003E (capitalize (trim \" hOnduRAS \"))\n\"Honduras\"","created-at":1283925242000,"updated-at":1321967031000,"_id":"542692cdc026201cdc326d0b"},{"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"editors":[{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"}],"body":"user=\u003E (refer 'clojure.string\n :rename '{capitalize cap, trim trm})\nWARNING: replace already refers to: #'clojure.core/replace in namespace: user, being replaced by: #'clojure.string/replace\nWARNING: reverse already refers to: #'clojure.core/reverse in namespace: user, being replaced by: #'clojure.string/reverse\nnil\n\nuser=\u003E (cap (trm \" hOnduRAS \"))\n\"Honduras\"\n\nuser=\u003E (join \\, [1 2 3])\n\"1,2,3\"","created-at":1399370253000,"updated-at":1399636313000,"_id":"542692d5c026201cdc32706a"},{"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"editors":[{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"}],"body":";;; `:only' accepts only original names.\n;; wrong\nuser=\u003E (refer 'clojure.string\n :rename '{capitalize cap, trim trm}\n :only '[cap trm])\nIllegalAccessError cap does not exist clojure.core/refer (core.clj:3849)\n\n;; right\nuser=\u003E (refer 'clojure.string\n :rename '{capitalize cap, trim trm}\n :only '[capitalize trim])\nnil\n\n;; work well\nuser=\u003E (cap (trm \" hOnduRAS \"))\n\"Honduras\"\n\n;; and also, cannot use either of them.\nuser=\u003E (join \\, [1 2 3])\nCompilerException java.lang.RuntimeException: Unable to resolve symbol: join in this context, compiling:(NO_SOURCE_PATH:1:1)","created-at":1399370354000,"updated-at":1399662756000,"_id":"542692d5c026201cdc32706c"}],"notes":null,"arglists":["ns-sym & filters"],"doc":"refers to all public vars of ns, subject to filters.\n filters can include at most one each of:\n\n :exclude list-of-symbols\n :only list-of-symbols\n :rename map-of-fromsymbol-tosymbol\n\n For each public interned var in the namespace named by the symbol,\n adds a mapping from the name of the var to the var to the current\n namespace. Throws an exception if name is already mapped to\n something else in the current namespace. Filters can be used to\n select a subset, via inclusion or exclusion, or to provide a mapping\n to a symbol different from the var's name, in order to prevent\n clashes. Use :use in the ns macro in preference to calling this directly.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/refer"},{"ns":"clojure.core","name":"print-dup","file":"clojure/core.clj","type":"var","column":1,"see-alsos":[{"created-at":1300959285000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"print-ctor","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e2a"},{"created-at":1332539534000,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"print-method","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e2b"}],"line":3692,"examples":[{"author":{"login":"cdorrat","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5dedcb7069d39421760f6d255def10c3?r=PG&default=identicon"},"editors":[{"login":"cdorrat","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5dedcb7069d39421760f6d255def10c3?r=PG&default=identicon"}],"body":";; print-dup can be used for basic serialization\n;; the following methods write/read clojure forms to/from a file\n\n(defn to-file\n \"Save a clojure form to a file\"\n [#^java.io.File file form]\n (with-open [w (java.io.FileWriter. file)]\n (print-dup form w)))\n \n(defn from-file\n \"Load a clojure form from file.\"\n [#^java.io.File file]\n (with-open [r (java.io.PushbackReader. (java.io.FileReader. file))]\n (read r)))","created-at":1300104716000,"updated-at":1300104999000,"_id":"542692cac026201cdc326b8c"},{"author":{"login":"cdorrat","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5dedcb7069d39421760f6d255def10c3?r=PG&default=identicon"},"editors":[],"body":";; print-dup is a multimethod, you can extend it to support new types.\n;; The following statement adds print-dup support to \n;; the java.util.Date class\n(defmethod print-dup java.util.Date [o w]\n (print-ctor o (fn [o w] (print-dup (.getTime o) w)) w)) ","created-at":1300104973000,"updated-at":1300104973000,"_id":"542692cac026201cdc326b8e"}],"notes":[{"updated-at":1300480179000,"body":"This is a multimethod that can be implemented to define the printing of various values when \\*print-dup\\* is bound to true.","created-at":1299414938000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fb7"}],"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core/print-dup"},{"ns":"clojure.core","name":"-reset-methods","file":"clojure/core_deftype.clj","type":"function","column":1,"see-alsos":null,"line":630,"examples":null,"notes":null,"arglists":["protocol"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core/-reset-methods"},{"added":"1.0","ns":"clojure.core","name":"floats","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":5421,"examples":null,"notes":null,"arglists":["xs"],"doc":"Casts to float[]","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/floats"},{"added":"1.12","ns":"clojure.core","name":"partitionv","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":7428,"examples":null,"notes":null,"arglists":["n coll","n step coll","n step pad coll"],"doc":"Returns a lazy sequence of vectors of n items each, at offsets step\n apart. If step is not supplied, defaults to n, i.e. the partitions\n do not overlap. If a pad collection is supplied, use its elements as\n necessary to complete last partition upto n items. In case there are\n not enough padding elements, return a partition with less than n items.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/partitionv"},{"added":"1.0","ns":"clojure.core","name":"pos?","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1345518606000,"author":{"login":"cbare","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b394e97f24f3576861239e2b839703a4?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"neg?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e09"},{"created-at":1400618875000,"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"zero?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e0a"}],"line":1261,"examples":[{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (pos? 1)\ntrue\nuser=\u003E (pos? 0)\nfalse\nuser=\u003E (pos? -1)\nfalse","created-at":1279074734000,"updated-at":1332952273000,"_id":"542692cdc026201cdc326cff"}],"notes":null,"arglists":["num"],"doc":"Returns true if num is greater than zero, else false","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/pos_q"},{"added":"1.2","ns":"clojure.core","name":"fnil","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":6635,"examples":[{"author":{"login":"looselytyped","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9bfc2e772db334c8b8516c86b9da7a0c?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; a function that expects a non-nil value\n(defn say-hello [name] (str \"Hello \" name))\n#'user/say-hello\n\n;; fnil lets you create another function with a default\n;; arg in case it is passed a nil\n(def say-hello-with-defaults (fnil say-hello \"World\"))\n#'user/say-hello-with-defaults\n\n;; the happy path works as you would expect\n(say-hello-with-defaults \"Sir\")\n\"Hello Sir\"\n\n;; but in the case that the function is passed a nil it will use the \n;; default supplied to fnil\n(say-hello-with-defaults nil)\n\"Hello World\"\n\n;; this works with different arities too\n(defn say-hello [first other] (str \"Hello \" first \" and \" other))\n#'user/say-hello\n\n;; lets create it with defaults\n(def say-hello-with-defaults (fnil say-hello \"World\" \"People\"))\n#'user/say-hello-with-defaults\n\n;; call the function with all nil args - notice it uses the defaults\n;; supplied to fnil\n(say-hello-with-defaults nil nil)\n\"Hello World and People\"\n\n;; any of the args can be nil - the function will supply \n;; the default supplied with fnil\n(say-hello-with-defaults \"Sir\" nil)\n\"Hello Sir and People\"\n\n;; and again - notice that \"World\" is the default here\n(say-hello-with-defaults nil \"Ma'am\")\n\"Hello World and Ma'am\"\n\n;; or pass all args \n(say-hello-with-defaults \"Sir\" \"Ma'am\")\n\"Hello Sir and Ma'am\"\n","created-at":1284845008000,"updated-at":1285486873000,"_id":"542692cdc026201cdc326ce4"}],"notes":null,"arglists":["f x","f x y","f x y z"],"doc":"Takes a function f, and returns a function that calls f, replacing\n a nil first argument to f with the supplied value x. Higher arity\n versions can replace arguments in the second and third\n positions (y, z). Note that the function f can take any number of\n arguments, not just the one(s) being nil-patched.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/fnil"},{"added":"1.0","ns":"clojure.core","name":"merge-with","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1294676734000,"author":{"login":"Nebulus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/61aa4140c24b0cded6b20d88200e7f16?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"merge","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e16"}],"line":3075,"examples":[{"author":{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},"editors":[{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (merge-with concat\n\t\t {\"Lisp\" [\"Common Lisp\" \"Clojure\"]\n\t\t \"ML\" [\"Caml\" \"Objective Caml\"]}\n\t\t {\"Lisp\" [\"Scheme\"]\n\t\t \"ML\" [\"Standard ML\"]})\n{\"Lisp\" (\"Common Lisp\" \"Clojure\" \"Scheme\"), \"ML\" (\"Caml\" \"Objective Caml\" \"Standard ML\")}\n\nuser=\u003E (clojure.pprint/pp)\n{\"Lisp\" (\"Common Lisp\" \"Clojure\" \"Scheme\"), \"ML\" (\"Caml\" \"Objective Caml\" \"Standard ML\")}\nnil\n","created-at":1279052705000,"updated-at":1285487752000,"_id":"542692cec026201cdc326dce"},{"author":{"login":"fogus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5aa24eee4238e1e964210ed447e8dc91?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; merge two maps using the addition function\n\nuser=\u003E (merge-with + \n {:a 1 :b 2}\n {:a 9 :b 98 :c 0})\n \n{:c 0, :a 10, :b 100}","created-at":1279058935000,"updated-at":1285487796000,"_id":"542692cec026201cdc326dd1"},{"author":{"login":"fogus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5aa24eee4238e1e964210ed447e8dc91?r=PG&default=identicon"},"editors":[{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},{"login":"fogus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5aa24eee4238e1e964210ed447e8dc91?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; 'merge-with' works with an arbitrary number of maps:\n\nuser=\u003E (merge-with + \n {:a 1 :b 2}\n {:a 9 :b 98 :c 0}\n {:a 10 :b 100 :c 10}\n {:a 5}\n {:c 5 :d 42})\n \n{:d 42, :c 15, :a 25, :b 200}","created-at":1279059124000,"updated-at":1285487849000,"_id":"542692cec026201cdc326dd3"},{"author":{"login":"jaley","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d8dc27aff613e5972bb6af8521a07891?r=PG&default=identicon"},"editors":[{"login":"Iceland_jack","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c889e0a95a3bb07f90ab28ad442f1127?r=PG&default=identicon"}],"body":";; Use union to merge sets of elements\nuser=\u003E (use 'clojure.set)\nuser=\u003E (merge-with union\n {:a #{1 2 3}, :b #{4 5 6}}\n {:a #{2 3 7 8}, :c #{1 2 3}})\n\n{:c #{1 2 3}, :a #{1 2 3 7 8}, :b #{4 5 6}}","created-at":1325882151000,"updated-at":1338787519000,"_id":"542692d4c026201cdc32700f"}],"notes":null,"arglists":["f & maps"],"doc":"Returns a map that consists of the rest of the maps conj-ed onto\n the first. If a key occurs in more than one map, the mapping(s)\n from the latter (left-to-right) will be combined with the mapping in\n the result by calling (f val-in-result val-in-latter).","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/merge-with"},{"added":"1.3","ns":"clojure.core","name":"nthrest","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1356088808000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"drop","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ddb"},{"created-at":1356088885000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"nthnext","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ddc"},{"created-at":1356088888000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"nth","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ddd"}],"line":3186,"examples":[{"author":{"login":"jmglov","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/67e9a6f766dc4b30bd5e9ff3e77c1777?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (nthrest (range 10) 5)\n(5 6 7 8 9)","created-at":1338817014000,"updated-at":1338817014000,"_id":"542692d4c026201cdc327021"}],"notes":[{"updated-at":1356088840000,"body":"This differs from clojure.core/drop in that it immediately drops the head of the seq, instead of doing so on the first call to first or seq.","created-at":1356088381000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"_id":"542692edf6e94c6970521ff9"}],"arglists":["coll n"],"doc":"Returns the nth rest of coll, coll when n is 0.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/nthrest"},{"added":"1.0","ns":"clojure.core","name":"load","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1286271399000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"load-file","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c29"},{"created-at":1352963712000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"*read-eval*","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c2a"}],"line":6172,"examples":[{"author":{"login":"lambder","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1c0c20072f52de3a6335cae183b865f6?r=PG&default=identicon"},"editors":[{"login":"lambder","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1c0c20072f52de3a6335cae183b865f6?r=PG&default=identicon"}],"body":";; file located at src/address_book/core.clj\n\n(load \"address_book/core\")","created-at":1307936370000,"updated-at":1307936562000,"_id":"542692cbc026201cdc326c1b"}],"notes":null,"arglists":["& paths"],"doc":"Loads Clojure code from resources in classpath. A path is interpreted as\n classpath-relative if it begins with a slash or relative to the root\n directory for the current namespace otherwise.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/load"},{"added":"1.0","ns":"clojure.core","name":"if-not","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1334293416000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"if","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e44"},{"created-at":1374149749000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"when-not","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e45"}],"line":769,"examples":[{"author":{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (defn has-neg [coll] \n (if-not (empty? coll) ;; = (if (not (empty? coll)) ...\n (or (neg? (first coll)) (recur (rest coll)))))\n#'user/has-neg\n\nuser=\u003E (has-neg [])\nnil \n\nuser=\u003E (has-neg [1 2 -3 4])\ntrue","created-at":1280505406000,"updated-at":1332951095000,"_id":"542692c6c026201cdc32692d"},{"author":{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (if-not (zero? 0) :then :else)\n:else","created-at":1280506136000,"updated-at":1332951114000,"_id":"542692c6c026201cdc32692f"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[],"body":";; See examples for \"if\" explaining Clojure's idea of logical true\n;; and logical false.","created-at":1334293411000,"updated-at":1334293411000,"_id":"542692d3c026201cdc326fcd"}],"macro":true,"notes":null,"arglists":["test then","test then else"],"doc":"Evaluates test. If logical false, evaluates and returns then expr, \n otherwise else expr, if supplied, else nil.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/if-not"},{"added":"1.12","ns":"clojure.core","name":"stream-into!","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":6887,"examples":null,"notes":null,"arglists":["to stream","to xform stream"],"doc":"Returns a new coll consisting of coll with all of the items of the\n stream conjoined. This is a terminal operation on the stream.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/stream-into!"},{"ns":"clojure.core","name":"*verbose-defrecords*","file":"clojure/core_print.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":39,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core/*verbose-defrecords*"},{"added":"1.0","ns":"clojure.core","name":"sequential?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1304804232000,"author":{"login":"0x89","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/56bc4acd59315ed4dc1cb99c3be71102?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"seq?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d22"},{"created-at":1304804263000,"author":{"login":"0x89","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/56bc4acd59315ed4dc1cb99c3be71102?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"coll?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d23"}],"line":6306,"examples":[{"author":{"login":"rustem.suniev","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e2051c4ebaaa8c22fa9c0bb2f32f64fd?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"Dmitry Kakurin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/85b70be5da433a6adf5112e7140848da?r=PG&default=identicon"},{"login":"pmbauer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/65f765955a0a25d112d33528ae6f811b?r=PG&default=identicon"}],"body":"user=\u003E (sequential? '(1 2 3))\ntrue\n\nuser=\u003E (sequential? [1 2 3])\ntrue\n\nuser =\u003E (sequential? (range 1 5))\ntrue\n\nuser=\u003E (sequential? 1)\nfalse\n\nuser =\u003E (sequential? {:a 2 :b 1})\nfalse\n","created-at":1284875508000,"updated-at":1333681979000,"_id":"542692c6c026201cdc3268f4"}],"notes":null,"arglists":["coll"],"doc":"Returns true if coll implements Sequential","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/sequential_q"},{"added":"1.0","ns":"clojure.core","name":"*print-level*","file":"clojure/core_print.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":27,"examples":null,"notes":null,"arglists":[],"doc":"*print-level* controls how many levels deep the printer will\n print nested objects. If it is bound to logical false, there is no\n limit. Otherwise, it must be bound to an integer indicating the maximum\n level to print. Each argument to print is at level 0; if an argument is a\n collection, its items are at level 1; and so on. If an object is a\n collection and is at a level greater than or equal to the value bound to\n *print-level*, the printer prints '#' to represent it. The root binding\n is nil indicating no limit.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/*print-level*"},{"added":"1.12","ns":"clojure.core","name":"stream-reduce!","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":6861,"examples":null,"notes":null,"arglists":["f s","f init s"],"doc":"Works like reduce but takes a java.util.stream.BaseStream as its source.\n Honors 'reduced', is a terminal operation on the stream","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/stream-reduce!"},{"added":"1.2","ns":"clojure.core","name":"shuffle","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":7466,"examples":[{"author":{"login":"pkolloch","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/10b2fd3c0a4cc46dc241a48468dc551?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (repeatedly 5 (partial shuffle [1 2 3]))\n([1 2 3] [1 2 3] [1 2 3] [1 2 3] [3 1 2])","created-at":1282319846000,"updated-at":1332952491000,"_id":"542692cac026201cdc326b48"}],"notes":null,"arglists":["coll"],"doc":"Return a random permutation of coll","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/shuffle"},{"added":"1.1","ns":"clojure.core","name":"boolean-array","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":5338,"examples":[{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"}],"body":";; create an array of Java boolean's using boolean-array\n;; and demonstrate that it can be used for input into the standard\n;; Java Arrays.fill function\n\nuser=\u003E (def bs (boolean-array (map even? (range 3 10))))\n#'user/bs\nuser=\u003E (type bs)\n[Z\nuser=\u003E (vec bs)\n[false true false true false true false]\nuser=\u003E (java.util.Arrays/fill bs 3 7 false)\nnil\nuser=\u003E (vec bs)\n[false true false false false false false]\nuser=\u003E","created-at":1313908154000,"updated-at":1313963403000,"_id":"542692c7c026201cdc326947"}],"notes":null,"arglists":["size-or-seq","size init-val-or-seq"],"doc":"Creates an array of booleans","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/boolean-array"},{"added":"1.0","ns":"clojure.core","name":"find","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1360286923000,"author":{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"get","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e77"},{"created-at":1360286926000,"author":{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"get-in","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e78"}],"line":1549,"examples":[{"author":{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},"editors":[{"login":"alexander-yakushev","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/468477?v=2"}],"body":"(find {:b 2 :a 1 :c 3} :d)\n;;=\u003E nil \n\n(find {:b 2 :a 1 :c 3} :a)\n;;=\u003E [:a 1]\n","created-at":1280345792000,"updated-at":1412270019994,"_id":"542692cfc026201cdc326e3e"},{"author":{"login":"Nevena","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fa0e495ccb6ed2997e14f687817e9299?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (find [:a :b :c :d] 2)\n[2 :c]\n\nuser=\u003E (find [:a :b :c :d] 5)\nnil","created-at":1305594606000,"updated-at":1305594606000,"_id":"542692cfc026201cdc326e3f"}],"notes":null,"arglists":["map key"],"doc":"Returns the map entry for key, or nil if key not present.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/find"},{"added":"1.0","ns":"clojure.core","name":"alength","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":3924,"examples":[{"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (def my-array (into-array Integer/TYPE [1 2 3]))\n#'user/my-array\n\nuser=\u003E (alength my-array)\n3","created-at":1286508271000,"updated-at":1286508271000,"_id":"542692cfc026201cdc326e13"}],"notes":null,"arglists":["array"],"doc":"Returns the length of the Java array. Works on arrays of all\n types.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/alength"},{"added":"1.0","ns":"clojure.core","name":"bit-xor","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":1325,"examples":[{"author":{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},"editors":[{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; set bits to 1 where bits of the arguments are different\nuser=\u003E (bit-xor 2r1100 2r1001) \n5 \n;; 5 = 2r0101\n\n","created-at":1280338778000,"updated-at":1285496577000,"_id":"542692c7c026201cdc3269b3"}],"notes":null,"arglists":["x y","x y & more"],"doc":"Bitwise exclusive or","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/bit-xor"},{"added":"1.1","ns":"clojure.core","name":"deliver","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1324962689000,"author":{"login":"neotyk","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/366ff985977b3aab09510bc335cd44a4?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"promise","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bba"}],"line":7275,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (def x (promise))\n#'user/x\n;; Trying to deref at this point will make your repl wait forever\n\n\nuser=\u003E (deliver x 100)\n#<core$promise$reify__5534@4369a50b: 100>\n\n;; the promise has been delivered, deref x will return immediately\nuser=\u003E @x\n100\n","created-at":1280748782000,"updated-at":1285495947000,"_id":"542692c8c026201cdc326a04"},{"author":{"login":"neotyk","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/366ff985977b3aab09510bc335cd44a4?r=PG&default=identicon"},"editors":[],"body":";; Create a promise\nuser\u003E (def p (promise))\n#'user/p ; p is our promise\n\n;; Check if was delivered/realized\nuser\u003E (realized? p)\nfalse ; No yet\n\n;; Delivering the promise\nuser\u003E (deliver p 42)\n#\u003Ccore$promise$reify__5727@47122d: 42\u003E\n\n;; Check again if it was delivered\nuser\u003E (realized? p)\ntrue ; Yes!\n\n;; Deref to see what has been delivered\nuser\u003E @p\n42\n\n;; Note that @ is shorthand for deref\nuser\u003E (deref p)\n42","created-at":1324962699000,"updated-at":1324962699000,"_id":"542692d2c026201cdc326f8c"}],"notes":[{"updated-at":1385511406000,"body":"As of Clojure 1.3 `deliver` does not throw an exception when it is called multiple times on the same promise. See [CLJ-1038](http://dev.clojure.org/jira/browse/CLJ-1038).","created-at":1385511406000,"author":{"login":"gyim","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/14df9ffd78d1e7062ac317d8bcfcde9f?r=PG&default=identicon"},"_id":"542692edf6e94c6970522012"}],"arglists":["promise val"],"doc":"Delivers the supplied value to the promise, releasing any pending\n derefs. A subsequent call to deliver on a promise will have no effect.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/deliver"},{"added":"1.0","ns":"clojure.core","name":"doseq","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1296708559000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"doall","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d9a"},{"created-at":1296708565000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"dorun","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d9b"},{"created-at":1318959035000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"for","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d9c"},{"created-at":1340037689000,"author":{"login":"Parijat Mishra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e3aba44539a78ea92373418456f090e3?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"dotimes","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d9d"}],"line":3234,"examples":[{"author":{"login":"devijvers","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/81018e4231ac1ce8b7a9e6d377092656?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (doseq [x [1 2 3] \n y [1 2 3]] \n (prn (* x y)))\n1\n2\n3\n2\n4\n6\n3\n6\n9\nnil\n","created-at":1279807621000,"updated-at":1285651390000,"_id":"542692c6c026201cdc326919"},{"author":{"login":"devijvers","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/81018e4231ac1ce8b7a9e6d377092656?r=PG&default=identicon"},"editors":[{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (doseq [[x y] (map list [1 2 3] [1 2 3])] \n (prn (* x y)))\n1\n4\n9\nnil\n\n;; where\nuser=\u003E (map list [1 2 3] [1 2 3])\n((1 1) (2 2) (3 3))","created-at":1279807704000,"updated-at":1285651402000,"_id":"542692c6c026201cdc32691b"},{"author":{"login":"devijvers","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/81018e4231ac1ce8b7a9e6d377092656?r=PG&default=identicon"},"editors":[{"login":"devijvers","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/81018e4231ac1ce8b7a9e6d377092656?r=PG&default=identicon"},{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"edbond","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/671af8c4a2d223c7d2e2ede3a0154975?r=PG&default=identicon"},{"login":"edbond","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/671af8c4a2d223c7d2e2ede3a0154975?r=PG&default=identicon"}],"body":"user=\u003E (doseq [[[a b] [c d]] (map list {:1 1 :2 2} {:3 3 :4 4})] \n (prn (* b d)))\n3\n8\nnil\n\n;; where\nuser=\u003E (map list {:1 1 :2 2} {:3 3 :4 4})\n(([:1 1] [:3 3]) ([:2 2] [:4 4]))","created-at":1279808561000,"updated-at":1390253567000,"_id":"542692c6c026201cdc32691e"},{"author":{"login":"devijvers","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/81018e4231ac1ce8b7a9e6d377092656?r=PG&default=identicon"},"editors":[{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"Parijat Mishra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e3aba44539a78ea92373418456f090e3?r=PG&default=identicon"}],"body":"user=\u003E (doseq [[k v] (map identity {:1 1 :2 2 :3 3})] \n (prn k v))\n:1 1\n:2 2\n:3 3\nnil\n\n;; where\nuser=\u003E (map identity {:1 1 :2 2 :3 3})\n([:1 1] [:2 2] [:3 3])\n\n;; or simply\nuser=\u003E (doseq [[k v] {:1 1 :2 2 :3 3}]\n (prn k v))\n:1 1\n:3 3\n:2 2\nnil","created-at":1279817912000,"updated-at":1340037554000,"_id":"542692c6c026201cdc326924"},{"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"editors":[],"body":"; Multiple sequences results in a Cartesian cross of their values.\nuser=\u003E (doseq [a [1 2]\n b [3 4]]\n (println a b))\n1 3\n1 4\n2 3\n2 4\nnil","created-at":1297827822000,"updated-at":1297827822000,"_id":"542692c6c026201cdc326928"},{"author":{"login":"cloojure","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1ad3de25d00d953de6e8c82f554cdbf5?r=PG&default=identicon"},"editors":[],"body":"; Keywords :let, :when, and :while are supported, the same as \"for\"\nuser=\u003E (doseq [x (range 6)\n :when (odd? x)\n :let [y (* x x)] ]\n (println [x y]) )\n[1 1]\n[3 9]\n[5 25]\nnil\nuser=\u003E (doseq [x (range 99)\n :let [y (* x x)] \n :while (\u003C y 30)\n ]\n (println [x y]) )\n[0 0]\n[1 1]\n[2 4]\n[3 9]\n[4 16]\n[5 25]\nnil\nuser=\u003E \n","created-at":1403073333000,"updated-at":1403073333000,"_id":"542692d2c026201cdc326f93"}],"macro":true,"notes":null,"arglists":["seq-exprs & body"],"doc":"Repeatedly executes body (presumably for side-effects) with\n bindings and filtering as provided by \"for\". Does not retain\n the head of the sequence. Returns nil.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/doseq"},{"added":"1.6","ns":"clojure.core","name":"unsigned-bit-shift-right","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1412094407161,"author":{"login":"jafingerhut","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/109629?v=2"},"to-var":{"ns":"clojure.core","name":"bit-shift-right","library-url":"https://github.com/clojure/clojure"},"_id":"542ad9c7e4b0df9bb778a59f"}],"line":1382,"examples":[{"body":"user=\u003E (format \"%016x\" -1)\n\"ffffffffffffffff\"\n\n;; bit-shift-right sign extends most significant bit while right shifting.\nuser=\u003E (format \"%016x\" (bit-shift-right -1 10))\n\"ffffffffffffffff\"\n\n;; unsigned-bit-shift-right fills most significant bits of result with 0.\n;; No sign extension.\nuser=\u003E (format \"%016x\" (unsigned-bit-shift-right -1 10))\n\"003fffffffffffff\"\n","author":{"login":"jafingerhut","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/109629?v=2"},"created-at":1412094902885,"updated-at":1412094902885,"_id":"542adbb6e4b0df9bb778a5a5"}],"notes":null,"arglists":["x n"],"doc":"Bitwise shift right, without sign-extension.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/unsigned-bit-shift-right"},{"added":"1.0","ns":"clojure.core","name":"neg?","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1345518618000,"author":{"login":"cbare","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b394e97f24f3576861239e2b839703a4?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"pos?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dd6"},{"created-at":1400618884000,"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"zero?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dd7"}],"line":1268,"examples":[{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[{"login":"replore","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e7869fe1a48cb1814c657eaca6bea3eb?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (neg? -1)\ntrue\nuser=\u003E (neg? 0)\nfalse\nuser=\u003E (neg? 1)\nfalse","created-at":1279074335000,"updated-at":1332952732000,"_id":"542692c9c026201cdc326add"}],"notes":null,"arglists":["num"],"doc":"Returns true if num is less than zero, else false","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/neg_q"},{"added":"1.0","ns":"clojure.core","name":"var-set","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1331249164000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"with-local-vars","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521df8"}],"line":4359,"examples":null,"notes":null,"arglists":["x val"],"doc":"Sets the value in the var object to val. The var must be\n thread-locally bound.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/var-set"},{"added":"1.3","ns":"clojure.core","name":"unchecked-float","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":3572,"examples":null,"notes":null,"arglists":["x"],"doc":"Coerce to float. Subject to rounding.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/unchecked-float"},{"added":"1.0","ns":"clojure.core","name":"pmap","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1281948332000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"map","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e0d"},{"created-at":1336536733000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"future","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e0e"}],"line":7159,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":";; This function operates just like map. See\n;; clojure.core/map for more details.\nuser=\u003E (pmap inc [1 2 3 4 5])\n(2 3 4 5 6)","created-at":1281948454000,"updated-at":1332952345000,"_id":"542692cdc026201cdc326cf2"},{"author":{"login":"OnesimusUnbound","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fa4c391db0d2d1744cc2cd0d787dd3d?r=PG&default=identicon"},"editors":[],"body":";; create a function that simulates a long running process using Thread/sleep\n(defn long-running-job [n]\n (Thread/sleep 3000) ; wait for 3 seconds\n (+ n 10))\n\n;; used `doall` to eagerly evaluate `map`, which evaluates lazily by default\n\n;; notice that the total elapse time is almost 3 secs * 4\nuser=\u003E (time (doall (map long-running-job (range 4))))\n\"Elapsed time: 11999.235098 msecs\"\n(10 11 12 13)\n\n;; notice that the total elapse time is almost 3 secs only\nuser=\u003E (time (doall (pmap long-running-job (range 4))))\n\"Elapsed time: 3200.001117 msecs\"\n(10 11 12 13)","created-at":1313254319000,"updated-at":1313254319000,"_id":"542692cdc026201cdc326cf4"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":";; pmap is implemented using Clojure futures. See examples for 'future'\n;; for discussion of an undesirable 1-minute wait that can occur before\n;; your standalone Clojure program exits if you do not use shutdown-agents.","created-at":1336536727000,"updated-at":1336536842000,"_id":"542692d4c026201cdc327030"}],"notes":[{"updated-at":1288191025000,"body":"for insight into how pmap does stuff see this presentation: \"From Concurrency to Parallelism\", by David Edgar Liebke @ http://incanter.org/downloads/fjclj.pdf","created-at":1288191025000,"author":{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521f9f"}],"arglists":["f coll","f coll & colls"],"doc":"Like map, except f is applied in parallel. Semi-lazy in that the\n parallel computation stays ahead of the consumption, but doesn't\n realize the entire result unless required. Only useful for\n computationally intensive functions where the time of f dominates\n the coordination overhead.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/pmap"},{"added":"1.2","ns":"clojure.core","name":"error-mode","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":2246,"examples":null,"notes":null,"arglists":["a"],"doc":"Returns the error-mode of agent a. See set-error-mode!","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/error-mode"},{"added":"1.0","ns":"clojure.core","name":"num","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1342917500000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"number?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521da3"}],"line":3499,"examples":[{"author":{"login":"Miles","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bbb26d2a5e856c4fba0f72c3f7250f3f?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"Miles","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bbb26d2a5e856c4fba0f72c3f7250f3f?r=PG&default=identicon"}],"body":"user=\u003E (num 2048)\n2048\n\n\n;; Calling a Number http://download.oracle.com/javase/6/docs/api/ method:\n\nuser=\u003E (def x (num 2048))\n#'user/x\n\nuser=\u003E (.floatValue x)\n2048.0\n","created-at":1283819688000,"updated-at":1287791370000,"_id":"542692cec026201cdc326dc3"}],"notes":null,"tag":"java.lang.Number","arglists":["x"],"doc":"Coerce to Number","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/num"},{"added":"1.5","ns":"clojure.core","name":"reduced?","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":2859,"examples":null,"notes":null,"arglists":["x"],"doc":"Returns true if x is the result of a call to reduced","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/reduced_q"},{"added":"1.1","ns":"clojure.core","name":"disj!","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1329970249000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"assoc!","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e49"},{"created-at":1329970254000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"dissoc!","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e4a"}],"line":3426,"examples":[{"author":{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":";; Note how we always use the return value of disj! and conj! in these examples\n;; for all future modifications, rather than (incorrectly) ignoring the return\n;; value and continuing to modify the original transient set. See examples for\n;; assoc! and dissoc! for more discussion and examples of this.\n\nuser=\u003E (def foo (transient #{'pore-pore 'slow 'yukkuri}))\n#'user/foo\nuser=\u003E (count foo)\n3\nuser=\u003E (def foo (disj! foo 'yukkuri))\n#'user/foo\nuser=\u003E foo\n#\u003CTransientHashSet clojure.lang.PersistentHashSet$TransientHashSet@3bd840d9\u003E\nuser=\u003E (count foo)\n2\nuser=\u003E (def foo (conj! foo 'yukkuri))\n#'user/foo\nuser=\u003E foo\n#\u003CTransientHashSet clojure.lang.PersistentHashSet$TransientHashSet@3bd840d9\u003E\nuser=\u003E (count foo)\n3\nuser=\u003E (def foo (persistent! foo))\n#'user/foo\nuser=\u003E foo\n#{yukkuri slow pore-pore}\n","created-at":1307739693000,"updated-at":1329970525000,"_id":"542692cfc026201cdc326e8c"}],"notes":null,"arglists":["set","set key","set key & ks"],"doc":"disj[oin]. Returns a transient set of the same (hashed/sorted) type, that\n does not contain key(s).","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/disj!"},{"added":"1.0","ns":"clojure.core","name":"float?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":3630,"examples":[{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (float? 0)\nfalse\nuser=\u003E (float? 0.0)\ntrue","created-at":1279073915000,"updated-at":1332951058000,"_id":"542692cbc026201cdc326bc6"}],"notes":null,"arglists":["n"],"doc":"Returns true if n is a floating point number","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/float_q"},{"added":"1.0","ns":"clojure.core","name":"aset-float","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":3987,"examples":[{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[],"body":";; create an array of 10 floats and set one of the values to 3.1415\n\nuser=\u003E (def fs (float-array 10))\n#'user/fs\nuser=\u003E (vec fs)\n[0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0]\nuser=\u003E (aset-float fs 3 3.1415)\n3.1415\nuser=\u003E (vec fs)\n[0.0 0.0 0.0 3.1415 0.0 0.0 0.0 0.0 0.0 0.0]\nuser=\u003E","created-at":1313914809000,"updated-at":1313914809000,"_id":"542692c7c026201cdc3269d2"}],"notes":null,"arglists":["array idx val","array idx idx2 & idxv"],"doc":"Sets the value at the index/indices. Works on arrays of float. Returns val.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/aset-float"},{"added":"1.2","ns":"clojure.core","name":"deftype","file":"clojure/core_deftype.clj","type":"macro","column":1,"see-alsos":[{"created-at":1361948459000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"definterface","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e0b"},{"created-at":1361948592000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"defprotocol","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e0c"}],"line":424,"examples":[{"author":{"login":"Kototama","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a54a4dc204925d397ca010b9a332e74d?r=PG&default=identicon"},"editors":[{"login":"Kototama","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a54a4dc204925d397ca010b9a332e74d?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (import (java.awt.datatransfer Transferable DataFlavor)\n javax.swing.ImageIcon)\n\n;; create a Transferable Image from an array of bytes\nuser=\u003E (deftype ImageSelection [data]\n Transferable\n (getTransferDataFlavors\n [this]\n (into-array DataFlavor [DataFlavor/imageFlavor]))\n \n (isDataFlavorSupported\n [this flavor]\n (= DataFlavor/imageFlavor flavor))\n\n (getTransferData\n [this flavor]\n (when (= DataFlavor/imageFlavor flavor)\n (.getImage (ImageIcon. data)))))\n\n;; create a new image selection:\nuser=\u003E (def *selection* (ImageSelection. somedata))","created-at":1285784862000,"updated-at":1285841395000,"_id":"542692ccc026201cdc326cc9"}],"macro":true,"notes":[{"updated-at":1330691996000,"body":"There's also some undocumented support for annotations:\r\n\r\n\u003Chttps://groups.google.com/group/clojure/browse_thread/thread/d2128e1505c0c117?pli=1\u003E","created-at":1330691996000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fda"}],"arglists":["name [& fields] & opts+specs"],"doc":"(deftype name [fields*] options* specs*)\n\n Options are expressed as sequential keywords and arguments (in any order).\n\n Supported options:\n :load-ns - if true, importing the type class will cause the\n namespace in which the type was defined to be loaded.\n Defaults to false.\n\n Each spec consists of a protocol or interface name followed by zero\n or more method bodies:\n\n protocol-or-interface-or-Object\n (methodName [args*] body)*\n\n Dynamically generates compiled bytecode for class with the given\n name, in a package with the same name as the current namespace, the\n given fields, and, optionally, methods for protocols and/or\n interfaces. \n\n The class will have the (by default, immutable) fields named by\n fields, which can have type hints. Protocols/interfaces and methods\n are optional. The only methods that can be supplied are those\n declared in the protocols/interfaces. Note that method bodies are\n not closures, the local environment includes only the named fields,\n and those fields can be accessed directly. Fields can be qualified\n with the metadata :volatile-mutable true or :unsynchronized-mutable\n true, at which point (set! afield aval) will be supported in method\n bodies. Note well that mutable fields are extremely difficult to use\n correctly, and are present only to facilitate the building of higher\n level constructs, such as Clojure's reference types, in Clojure\n itself. They are for experts only - if the semantics and\n implications of :volatile-mutable or :unsynchronized-mutable are not\n immediately apparent to you, you should not be using them.\n\n Method definitions take the form:\n\n (methodname [args*] body)\n\n The argument and return types can be hinted on the arg and\n methodname symbols. If not supplied, they will be inferred, so type\n hints should be reserved for disambiguation.\n\n Methods should be supplied for all methods of the desired\n protocol(s) and interface(s). You can also define overrides for\n methods of Object. Note that a parameter must be supplied to\n correspond to the target object ('this' in Java parlance). Thus\n methods for interfaces will take one more argument than do the\n interface declarations. Note also that recur calls to the method\n head should *not* pass the target object, it will be supplied\n automatically and can not be substituted.\n\n In the method bodies, the (unqualified) name can be used to name the\n class (for calls to new, instance? etc).\n\n When AOT compiling, generates compiled bytecode for a class with the\n given name (a symbol), prepends the current ns as the package, and\n writes the .class file to the *compile-path* directory.\n\n One constructor will be defined, taking the designated fields. Note\n that the field names __meta, __extmap, __hash and __hasheq are currently\n reserved and should not be used when defining your own types.\n\n Given (deftype TypeName ...), a factory function called -\u003ETypeName\n will be defined, taking positional parameters for the fields","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/deftype"},{"added":"1.0","ns":"clojure.core","name":"bean","file":"clojure/core_proxy.clj","type":"function","column":1,"see-alsos":null,"line":403,"examples":[{"author":{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (import java.util.Date)\njava.util.Date\n\nuser=\u003E (def *now* (Date.))\n#'user/*now*\n\nuser=\u003E (bean *now*)\n{:seconds 57, :date 13, :class java.util.Date, :minutes 55, :hours 17, :year 110, :timezoneOffset -330, :month 6, :day 2, :time 1279023957492}\n","created-at":1279049231000,"updated-at":1285502039000,"_id":"542692ccc026201cdc326c70"},{"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"editors":[],"body":";; although not reference-able in Clojuredocs, org.clojure/java.data provides a useful, alternative 'from-java' function that works similarly to bean, but more customizable. See https://github.com/clojure/java.data for more info.","created-at":1348995044000,"updated-at":1348995044000,"_id":"542692d2c026201cdc326f4e"}],"notes":null,"arglists":["x"],"doc":"Takes a Java object and returns a read-only implementation of the\n map abstraction based upon its JavaBean properties.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/bean"},{"added":"1.1","ns":"clojure.core","name":"booleans","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1358052913000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"boolean-array","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c0a"}],"line":5401,"examples":[{"author":{"login":"leifp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d2f37720f063404ef83b987d2824353d?r=PG&default=identicon"},"editors":[],"body":";; for fast interop\nuser=\u003E (set! *warn-on-reflection* true)\ntrue\nuser=\u003E (defn get-a-bool [bs] (aget bs 1))\nReflection warning, NO_SOURCE_PATH:1 - call to aget can't be resolved.\n#'user/get-a-bool\nuser=\u003E (defn get-a-bool [bs] (let [bs (booleans bs)] (aget bs 1)))\n#'user/get-a-bool\n","created-at":1342528439000,"updated-at":1342528439000,"_id":"542692d2c026201cdc326f5b"}],"notes":null,"arglists":["xs"],"doc":"Casts to boolean[]","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/booleans"},{"added":"1.0","ns":"clojure.core","name":"ns-unalias","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1390616196000,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"alias","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ea7"},{"created-at":1390616206000,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"ns-aliases","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ea8"}],"line":4307,"examples":[{"author":{"login":"DavidDurand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1b0513bd8cf8bc7123ab7b4e9f006786?r=PG&default=identicon"},"editors":[],"body":";; You are having a problem loading a redefined namespace:\nuser=\u003E (load \"src/clj/com/tizra/layout_expander.clj\")\n#\u003CIllegalStateException java.lang.IllegalStateException: Alias xml already exists in namespace com.tizra.layout-expander, aliasing com.tizra.xml-match\u003E\n\n;; ns-unalias to the rescue!\nuser=\u003E (ns-unalias (find-ns 'com.tizra.layout-expander) 'xml)\nnil\n\nuser=\u003E (load \"src/clj/com/tizra/layout_expander.clj\")\n#'com.tizra.layout-expander/junk\n","created-at":1326025800000,"updated-at":1326025800000,"_id":"542692d4c026201cdc327020"}],"notes":null,"arglists":["ns sym"],"doc":"Removes the alias for the symbol from the namespace.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/ns-unalias"},{"added":"1.0","ns":"clojure.core","name":"when-let","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1293436133000,"author":{"login":"0x89","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/56bc4acd59315ed4dc1cb99c3be71102?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"if-let","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e2c"},{"created-at":1315004448000,"author":{"login":"srid","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bd3a68d670372cd09876c26270a4299a?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"when","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e2d"},{"created-at":1323280128000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"when-not","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e2e"},{"created-at":1334293387000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"if","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e2f"},{"created-at":1405367841000,"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"when-first","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e30"}],"line":1878,"examples":[{"author":{"login":"kotarak","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5db30f607f0b5fa70d690311aa3bfd3b?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"Confusion","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ca054e9c7aecbfac1d99af1fd0a6d72c?r=PG&default=identicon"}],"body":";; Very useful when working with sequences. Capturing the return value \n;; of `seq` brings a performance gain in subsequent `first`/`rest`/`next`\n;; calls. Also the block is guarded by `nil` punning.\n\n(defn drop-one\n [coll]\n (when-let [s (seq coll)]\n (rest s)))\n\nuser=\u003E (drop-one [1 2 3])\n(2 3)\nuser=\u003E (drop-one [])\nnil\n","created-at":1281553976000,"updated-at":1342493536000,"_id":"542692cbc026201cdc326c01"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[],"body":";; See examples for \"if\" explaining Clojure's idea of logical true\n;; and logical false.","created-at":1334293395000,"updated-at":1334293395000,"_id":"542692d6c026201cdc3270b6"}],"macro":true,"notes":[{"updated-at":1299054268000,"body":"The difference between when-let and if-let is that when-let doesn't have an else clause and and also accepts multiple forms so you don't need to use a (do...).","created-at":1299054268000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fb4"},{"updated-at":1393879475000,"body":"The word \"bindings\" seems not to be correct here. In fact `when-let` only accepts **one** binding and not multiple ones.\r\nSo \"bindings\" might be confusing, at least it was for me.","created-at":1393879360000,"author":{"login":"n2o","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/73a59429cbc559fd77e9ec50fd99006b?r=PG&default=identicon"},"_id":"542692edf6e94c697052201f"},{"updated-at":1405477326000,"body":"Agreed. It ought to be \"binding\" for clarity.","created-at":1405477326000,"author":{"login":"Dave Y.","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/10d4977e847588cb4b461de4eb9d1646?r=PG&default=identicon"},"_id":"542692edf6e94c697052202c"}],"arglists":["bindings & body"],"doc":"bindings =\u003E binding-form test\n\n When test is true, evaluates body with binding-form bound to the value of test","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/when-let"},{"added":"1.0","ns":"clojure.core","name":"int-array","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1342917413000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ints","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d57"},{"created-at":1349125778000,"author":{"login":"Ljos","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/45b996a79abca465acaf6c0f10b0437?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"aget","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d58"},{"created-at":1349125782000,"author":{"login":"Ljos","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/45b996a79abca465acaf6c0f10b0437?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"aset","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d59"},{"created-at":1349125888000,"author":{"login":"Ljos","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/45b996a79abca465acaf6c0f10b0437?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"aset-int","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d5a"}],"line":5385,"examples":[{"author":{"login":"apgwoz","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d543a7491b7b47ec7c3e8f259a75d2dd?r=PG&default=identicon"},"editors":[{"login":"apgwoz","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d543a7491b7b47ec7c3e8f259a75d2dd?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; if you have a sequence, perhaps lazy, int-array will figure out the size\nuser=\u003E (aget (int-array [1 2 3]) 0)\n1\nuser=\u003E (int-array [1 2 3])\n#<int[] [i@263c8db9]>\n\n;; if you need a certain size, with a constant initial value\nuser=\u003E (aget (int-array 5 1) 4)\n1\nuser=\u003E (alength (int-array 5))\n5\n\n;; finally, you can specify a size + a sequence, which will initialize the array \n;; by taking size from the sequence\nuser=\u003E (alength (int-array 5 (range 10)))\n5\n;; which is equivalent to\nuser=\u003E (alength (int-array (take 5 (range 10)))\n5\n","created-at":1284747822000,"updated-at":1285486950000,"_id":"542692c9c026201cdc326afa"}],"notes":null,"arglists":["size-or-seq","size init-val-or-seq"],"doc":"Creates an array of ints","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/int-array"},{"added":"1.0","ns":"clojure.core","name":"set?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1293674593000,"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"set","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d8f"}],"line":4125,"examples":[{"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"editors":[],"body":"user\u003E (set? #{1 2 3})\ntrue\n\nuser\u003E (set? [1 2 3])\nfalse\n\nuser\u003E (set? {:a 1 :b 2})\nfalse","created-at":1293674587000,"updated-at":1293674587000,"_id":"542692cec026201cdc326dfa"}],"notes":null,"arglists":["x"],"doc":"Returns true if x implements IPersistentSet","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/set_q"},{"added":"1.0","ns":"clojure.core","name":"inc'","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":917,"examples":null,"notes":null,"arglists":["x"],"doc":"Returns a number one greater than num. Supports arbitrary precision.\n See also: inc","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/inc'"},{"added":"1.7","ns":"clojure.core","name":"cat","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":7811,"examples":null,"notes":null,"arglists":["rf"],"doc":"A transducer which concatenates the contents of each input, which must be a\n collection, into the reduction.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/cat"},{"added":"1.9","ns":"clojure.core","name":"StackTraceElement-\u003Evec","file":"clojure/core_print.clj","type":"function","column":1,"see-alsos":null,"line":467,"examples":null,"notes":null,"arglists":["o"],"doc":"Constructs a data representation for a StackTraceElement: [class method file line]","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/StackTraceElement-\u003Evec"},{"ns":"clojure.core","name":"*suppress-read*","type":"var","see-alsos":null,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core/*suppress-read*"},{"added":"1.0","ns":"clojure.core","name":"flush","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":3731,"examples":null,"notes":null,"arglists":[""],"doc":"Flushes the output stream that is the current value of\n *out*","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/flush"},{"added":"1.0","ns":"clojure.core","name":"take-while","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1301365974000,"author":{"login":"pauldoo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5cb916d3c8abc9f45a093209e72489fb?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"drop-while","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c3f"},{"created-at":1347077874000,"author":{"login":"dansalmo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e33ee460f5f61bc5ba9b598934766215?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"split-with","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c40"}],"line":2905,"examples":[{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},{"login":"devijvers","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/81018e4231ac1ce8b7a9e6d377092656?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"Airwoz","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/47391748e84575258520e85e3725d144?r=PG&default=identicon"}],"body":";; Calculate the sum of all numbers under 1000:\nuser=\u003E (reduce + (take-while (partial \u003E 1000) (iterate inc 0)))\n499500","created-at":1279591693000,"updated-at":1385275768000,"_id":"542692cdc026201cdc326d03"},{"author":{"login":"patazj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d790f5851d80da498e475ece4487e92?r=PG&default=identicon"},"editors":[{"login":"patazj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d790f5851d80da498e475ece4487e92?r=PG&default=identicon"},{"login":"patazj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d790f5851d80da498e475ece4487e92?r=PG&default=identicon"},{"login":"Matt","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/af7cad0e010feb68f651cb61c54424b4?r=PG&default=identicon"}],"body":"user=\u003E (take-while neg? [-2 -1 0 1 2 3])\n(-2 -1)\n\nuser=\u003E (take-while neg? [-2 -1 0 -1 -2 3])\n(-2 -1)\n\nuser=\u003E (take-while neg? [ 0 1 2 3])\n()\n\nuser=\u003E (take-while neg? [])\n()\n\nuser=\u003E (take-while neg? nil)\n()","created-at":1321607184000,"updated-at":1338786064000,"_id":"542692d5c026201cdc3270a2"}],"notes":null,"arglists":["pred","pred coll"],"doc":"Returns a lazy sequence of successive items from coll while\n (pred item) returns logical true. pred must be free of side-effects.\n Returns a transducer when no collection is provided.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/take-while"},{"added":"1.0","ns":"clojure.core","name":"vary-meta","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1301486152000,"author":{"login":"ninjudd","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7ced25585a7556e9b9b975c1f9e136e3?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"with-meta","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d19"},{"created-at":1375213046000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"alter-meta!","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d1a"}],"line":677,"examples":[{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (meta (vary-meta 'foo assoc :a 1))\n{:a 1}\n","created-at":1280776393000,"updated-at":1285495771000,"_id":"542692c8c026201cdc326a68"},{"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"editors":[],"body":";; continuing from the previous with-meta example\nuser=\u003E (def wm (with-meta [1 2 3] {:my \"meta\"}))\n#'user/wm\n\nuser=\u003E wm\n[1 2 3]\n\nuser=\u003E (meta wm)\n{:my \"meta\"}\n\nuser=\u003E (def new-wm (vary-meta wm assoc :your \"new meta\"))\n#'user/new-wm\n\nuser=\u003E new-wm\n[1 2 3]\n\nuser=\u003E (meta new-wm)\n{:my \"meta\", :your \"new meta\"}\n\n","created-at":1359718168000,"updated-at":1359718168000,"_id":"542692d5c026201cdc3270b3"}],"notes":null,"arglists":["obj f & args"],"doc":"Returns an object of the same type and value as obj, with\n (apply f (meta obj) args) as its metadata.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/vary-meta"},{"added":"1.0","ns":"clojure.core","name":"\u003C=","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":1057,"examples":[{"author":{"login":"mattdw","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ee24aacb65359196b0a1bad050f9a62f?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (\u003C= 1 2)\ntrue\nuser=\u003E (\u003C= 2 2)\ntrue\nuser=\u003E (\u003C= 3 2)\nfalse\nuser=\u003E (\u003C= 2 3 4 5 6)\ntrue","created-at":1280321906000,"updated-at":1332950755000,"_id":"542692cdc026201cdc326cd9"}],"notes":null,"arglists":["x","x y","x y & more"],"doc":"Returns non-nil if nums are in monotonically non-decreasing order,\n otherwise false.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/\u003C="},{"added":"1.0","ns":"clojure.core","name":"alter","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1326053288000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ref","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cb7"},{"created-at":1350716275000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"commute","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cb8"}],"line":2460,"examples":[{"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":";; alter is a way to change the value of a reference.\n\n;; Here we're defining a ref named 'names' and setting its value to\n;; an empty vector.\nuser=\u003E (def names (ref []))\n#'user/names\n\n;; A function to add a name to the vector (notice the meat's wrapped\n;; in a dosync\nuser=\u003E (defn add-name [name]\n (dosync\n (alter names conj name)))\n#'user/add-name\n\nuser=\u003E (add-name \"zack\")\n[\"zack\"]\n\nuser=\u003E (add-name \"shelley\")\n[\"zack\" \"shelley\"]\n\n;; Notice that the var 'names' points to the reference that we created\nuser=\u003E (println names)\n#\u003CRef@658ba380: [zack shelley]\u003E\n\n;; To get the actual value of the ref, you use the '@' symbol, or deref\nuser=\u003E (println @names)\n[zack shelley]\n\nuser=\u003E (println (deref names))\n[zack shelley]","created-at":1279456650000,"updated-at":1332952016000,"_id":"542692c8c026201cdc326a3c"}],"notes":[{"updated-at":1325053153000,"body":"I was fooling around with how exactly ref works with maps. Since the example here uses a vector, I thought maybe some of you might want to see a short example using a map.\r\n\r\nIn an aggregator I'm working on, I want to keep a record of how many sources and how many articles I've aggregated. Instead of using an atom for each, I'll reference a map called \"counts.\" Here's a simple little function that increments and returns the new value of the counter stored in the map:\r\n\r\n\u003Cpre\u003E (def counts (ref {:articles 0 :sources 0}))\r\n(defn inc-ref [ref type]\r\n\"increment a map value with key type stored in ref\"\r\n\t(dosync\r\n\t (alter ref assoc type (inc (type @ref)))\r\n\t (type @ref)))\r\nuser> (inc-ref counts :sources)\r\n=>1\r\nuser> counts\r\n=>{:articles 0, :sources 1}\r\n\u003C/pre\u003E\r\n\r\nand if you wanted to be able to add counters dynamically (one of the advantages of using a map in this context) you could redefine the function employ an optional argument, which if present instructs the function to create a new key-value pair using the name and initial value provided:\r\n\r\n\u003Cpre\u003E(defn inc-ref [ref type & [init-value]]\r\n (if init-value\r\n (dosync\r\n (alter ref assoc type init-value)\r\n (type @ref))\r\n (dosync\r\n (alter ref assoc type (inc (name @ref)))\r\n (type @ref))))\r\n\r\nuser> (inc-ref counts :articles)\r\n=>1\r\nuser> (inc-ref counts :magazines 1)\r\n=>1\r\nuser> (:magazines @counts)\r\n=>1\u003C/pre\u003E","created-at":1325048179000,"author":{"login":"borg","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/91d340132e883c02020ccd56946b2b91?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fd4"},{"updated-at":1349979324000,"body":"In the previous example at row 07 has a reference to 'name @ref':\r\n \u003Cpre\u003E(alter ref assoc type (inc (name @ref)))\u003C/pre\u003E\r\nmaybe is incorrect and the correct mode is: \r\n\u003Cpre\u003E (alter ref assoc type (inc (type @ref)))\u003C/pre\u003E","created-at":1349979324000,"author":{"login":"grayzone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/261286ad984a83e1b0c5e0d7695d58fc?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fec"}],"arglists":["ref fun & args"],"doc":"Must be called in a transaction. Sets the in-transaction-value of\n ref to:\n\n (apply fun in-transaction-value-of-ref args)\n\n and returns the in-transaction-value of ref.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/alter"},{"added":"1.0","ns":"clojure.core","name":"-'","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":1033,"examples":null,"notes":null,"arglists":["x","x y","x y & more"],"doc":"If no ys are supplied, returns the negation of x, else subtracts\n the ys from x and returns the result. Supports arbitrary precision.\n See also: -","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/-'"},{"added":"1.6","ns":"clojure.core","name":"if-some","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":null,"line":1893,"examples":null,"macro":true,"notes":null,"arglists":["bindings then","bindings then else & oldform"],"doc":"bindings =\u003E binding-form test\n\n If test is not nil, evaluates then with binding-form bound to the\n value of test, if not, yields else","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/if-some"},{"added":"1.1","ns":"clojure.core","name":"conj!","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1286870227000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"transient","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d6f"},{"created-at":1329969779000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"assoc!","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d70"},{"created-at":1329969851000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"dissoc!","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d71"}],"line":3384,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":";; As seen on http://clojure.org/transients\n;; array is initially made transient, modified then\n;; finally made persistent.\n\n;; Note: This example correctly always uses the return value of conj! for\n;; future modifications, not the original value of v. See assoc! examples\n;; for some discussion of why this is important.\n\n(defn vrange2 [n]\n (loop [i 0 v (transient [])]\n (if (\u003C i n)\n (recur (inc i) (conj! v i))\n (persistent! v))))\n\nuser=\u003E (vrange2 10)\n[0 1 2 3 4 5 6 7 8 9]","created-at":1286870264000,"updated-at":1329969909000,"_id":"542692cac026201cdc326b43"}],"notes":null,"arglists":["","coll","coll x"],"doc":"Adds x to the transient collection, and return coll. The 'addition'\n may happen at different 'places' depending on the concrete type.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/conj!"},{"added":"1.0","ns":"clojure.core","name":"repeatedly","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1286264111000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"repeat","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c8e"},{"created-at":1289359620000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"iterate","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c8f"},{"created-at":1289359625000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"lazy-seq","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c90"},{"created-at":1295239829000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"dotimes","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c91"},{"created-at":1295239907000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"doall","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c92"},{"created-at":1343151093000,"author":{"login":"john.r.woodward","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/22b6fbc4a386291e45b1cb4449377086?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"rand-int","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c93"},{"created-at":1345605379000,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"constantly","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c94"}],"line":5196,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"citizen428","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b3881a28fe402dd2d1de44717486cae8?r=PG&default=identicon"},{"login":"citizen428","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b3881a28fe402dd2d1de44717486cae8?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},{"login":"nyashh","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2254461eab79d5d84a021414e8e36dba?r=PG&default=identicon"},{"login":"john.r.woodward","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/22b6fbc4a386291e45b1cb4449377086?r=PG&default=identicon"},{"login":"john.r.woodward","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/22b6fbc4a386291e45b1cb4449377086?r=PG&default=identicon"},{"login":"tomas","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c0c2f195479ae4a71cb6484679f6f49?r=PG&default=identicon"}],"body":";these two functions are equivalent \n\nuser=\u003E (take 5 (repeatedly #(rand-int 11)))\n(6 6 3 9 8)\n\nuser=\u003E (repeatedly 5 #(rand-int 11))\n(1 8 6 9 6)\n\n;compare with repeat\nuser=\u003E (repeat 5 (rand-int 100))\n(94 94 94 94 94)","created-at":1279093287000,"updated-at":1403223187000,"_id":"542692cfc026201cdc326e2f"},{"author":{"login":"Jeff Rose","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/567898c496278341be69087507d5ed24?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"philos99","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1de5617efb013ca7c9cf8e5646818ffa?r=PG&default=identicon"}],"body":"(defn counter [] \n (let [tick (atom 0)]\n #(swap! tick inc)))\n\n(def tick (counter))\n\nuser=\u003E (take 10 (repeatedly tick))\n(1 2 3 4 5 6 7 8 9 10)","created-at":1283550417000,"updated-at":1317741407000,"_id":"542692cfc026201cdc326e38"}],"notes":[{"updated-at":1289359893000,"body":"if the function you want to repeat doesn't have side effects and has an argument, 'iterate' may be what you are looking for.","created-at":1289359893000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fa1"}],"arglists":["f","n f"],"doc":"Takes a function of no args, presumably with side effects, and\n returns an infinite (or length n if supplied) lazy sequence of calls\n to it","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/repeatedly"},{"added":"1.0","ns":"clojure.core","name":"zipmap","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1325197673000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"interleave","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e62"}],"line":6660,"examples":[{"author":{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (zipmap [:a :b :c :d :e] [1 2 3 4 5])\n{:e 5, :d 4, :c 3, :b 2, :a 1}\n","created-at":1279388151000,"updated-at":1285500115000,"_id":"542692c7c026201cdc3269a8"},{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[],"body":";; 4 is not included in the result\nuser=\u003E (zipmap [:a :b :c] [1 2 3 4])\n{:c 3, :b 2, :a 1}\n\n","created-at":1335331821000,"updated-at":1335331821000,"_id":"542692d6c026201cdc3270cb"}],"notes":null,"arglists":["keys vals"],"doc":"Returns a map with the keys mapped to the corresponding vals.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/zipmap"},{"added":"1.9","ns":"clojure.core","name":"reset-vals!","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":2400,"examples":null,"notes":null,"arglists":["atom newval"],"doc":"Sets the value of atom to newval. Returns [old new], the value of the\n atom before and after the reset.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/reset-vals!"},{"added":"1.0","ns":"clojure.core","name":"alter-var-root","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1322088086000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"with-redefs","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f28"},{"created-at":1322088098000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"with-redefs-fn","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f29"},{"created-at":1360641932000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"intern","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f2a"},{"created-at":1374167327000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"var","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f2b"}],"line":5558,"examples":[{"author":{"login":"fogus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5aa24eee4238e1e964210ed447e8dc91?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"(defn sqr [n] \n \"Squares a number\"\n (* n n))\n\nuser=\u003E (sqr 5)\n25\n\nuser=\u003E (alter-var-root \n (var sqr) ; var to alter\n (fn [f] ; fn to apply to the var's value\n #(do (println \"Squaring\" %) ; returns a new fn wrapping old fn\n (f %))))\n\nuser=\u003E (sqr 5)\nSquaring 5\n25\n","created-at":1283913245000,"updated-at":1285487972000,"_id":"542692cfc026201cdc326e70"}],"notes":null,"arglists":["v f & args"],"doc":"Atomically alters the root binding of var v by applying f to its\n current value plus any args","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/alter-var-root"},{"added":"1.0","ns":"clojure.core","name":"biginteger","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":3659,"examples":[{"author":{"login":"linxiangyu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2c7492645426ece4ae86fde83d61bd03?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (def x (biginteger 19931029))\n#'user/x\nuser=\u003E (class x)\njava.math.BigInteger\n\n\n\n","created-at":1370558225000,"updated-at":1370558225000,"_id":"542692d2c026201cdc326f53"}],"notes":null,"tag":"java.math.BigInteger","arglists":["x"],"doc":"Coerce to BigInteger","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/biginteger"},{"added":"1.0","ns":"clojure.core","name":"remove","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1282310768000,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.core","name":"filter","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cee"}],"line":2843,"examples":[{"author":{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (remove pos? [1 -2 2 -1 3 7 0])\n(-2 -1 0)\n\nuser=\u003E (remove #(zero? (mod % 3)) (range 1 21))\n(1 2 4 5 7 8 10 11 13 14 16 17 19 20)","created-at":1281548721000,"updated-at":1332951186000,"_id":"542692cfc026201cdc326e3c"}],"notes":null,"arglists":["pred","pred coll"],"doc":"Returns a lazy sequence of the items in coll for which\n (pred item) returns logical false. pred must be free of side-effects.\n Returns a transducer when no collection is provided.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/remove"},{"added":"1.2","ns":"clojure.core","name":"*","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1323065497000,"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"*'","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ca8"}],"line":1010,"examples":[{"author":{"login":"samaaron","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ee3512261f38df2541b9adca77f025cb?r=PG&default=identicon"},"editors":[{"login":"OnesimusUnbound","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fa4c391db0d2d1744cc2cd0d787dd3d?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"jmglov","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/67e9a6f766dc4b30bd5e9ff3e77c1777?r=PG&default=identicon"},{"login":"rafmagana","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/40bd727b22d74930f292b63d45a71b07?r=PG&default=identicon"}],"body":"user=\u003E (* 6)\n6\n\nuser=\u003E (* 2 3)\n6\n\nuser=\u003E (* 2 3 4)\n24\n\nuser=\u003E (* 0.5 200)\n100.0\n\nuser=\u003E (* 1234567890 9876543210)\nArithmeticException integer overflow","created-at":1278738436000,"updated-at":1406076381000,"_id":"542692c8c026201cdc326a45"}],"notes":null,"arglists":["","x","x y","x y & more"],"doc":"Returns the product of nums. (*) returns 1. Does not auto-promote\n longs, will throw on overflow. See also: *'","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/*"},{"added":"1.0","ns":"clojure.core","name":"re-pattern","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1289146513000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"re-find","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b2f"},{"created-at":1324450178000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.string","name":"replace","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b30"},{"created-at":1324450182000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.string","name":"replace-first","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b31"}],"line":4892,"examples":[{"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"NielsK","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/11ab6518d419df03c4883af80b5697ee?r=PG&default=identicon"}],"body":"user=\u003E (re-pattern \"\\\\d+\")\n#\"\\d+\"\n\nuser=\u003E (re-find (re-pattern \"\\\\d+\") \"abc123def\") \n\"123\"\n\n;; If you want to construct a regex pattern dynamically at run time,\n;; then you need to use re-pattern to convert a string to a pattern\n;; that can be used for matching. But if your pattern is one you\n;; write into the source code, it is more convenient to use the\n;; #\"pattern\" syntax. The previous example can be written as follows.\nuser=\u003E (re-find #\"\\d+\" \"abc123def\") \n\"123\"\n\n;; Below are two examples that are equivalent in the patterns they\n;; use, but the #\"pattern\" syntax helps significantly, because it lets\n;; us avoid the requirement to escape every \\ character with another \\\n;; character. See the example with embedded comments below for more\n;; detail on what the pattern matches.\nuser=\u003E (re-find #\"\\\\\\d+\\s+\\S+\" \"\\\\ it sh0uld match in \\\\5 here somewhere.\")\n\"\\\\5 here\"\n\nuser=\u003E (re-find (re-pattern \"\\\\\\\\\\\\d+\\\\s+\\\\S+\")\n \"\\\\ it sh0uld match in \\\\5 here somewhere.\")\n\"\\\\5 here\"\n\n;; If you want to embed (ignored) whitespace and comments from #\n;; characters until end-of-line in your regex patterns, start the\n;; pattern with (?x)\nuser=\u003E (re-find #\"(?x) # allow embedded whitespace and comments\n \\\\ # backslash\n \\d+ # one or more digits\n \\s+ # whitespace\n \\S+ # non-whitespace\"\n \"\\\\ it sh0uld match in \\\\5 here somewhere.\")\n\"\\\\5 here\"\n\n;; Other pattern flags like Java's DOTALL, MULTILINE and UNICODE_CASE\n;; pattern matching modes, can be set by combining these embedded flags\n\n;; (?d) Unix lines (only match \\newline)\n;; (?i) Case-insensitive\n;; (?u) Unicode-aware Case\n;; (?m) Multiline\n;; (?s) Dot matches all (including newline)\n;; (?x) Ignore Whitespace and comments\n\nuser=\u003E (re-seq #\"(?ix) test #Case insensitive and comments allowed\"\n \"Testing,\\n testing,\\n 1 2 3\")\n(\"Test\" \"test\")\n","created-at":1280547138000,"updated-at":1365007458000,"_id":"542692c6c026201cdc3268c7"}],"notes":null,"tag":"java.util.regex.Pattern","arglists":["s"],"doc":"Returns an instance of java.util.regex.Pattern, for use, e.g. in\n re-matcher.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/re-pattern"},{"added":"1.0","ns":"clojure.core","name":"min","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1371841114000,"author":{"login":"adereth","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5ad11b4e208a6cdb3bd45fe01dea59b7?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"max","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f10"},{"created-at":1371841126000,"author":{"login":"adereth","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5ad11b4e208a6cdb3bd45fe01dea59b7?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"min-key","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f11"}],"line":1127,"examples":[{"author":{"login":"MrHus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4fa262299223e58030e9062d97224547?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (min 1 2 3 4 5) \n1\nuser=\u003E (min 5 4 3 2 1)\n1\nuser=\u003E (min 100)\n100","created-at":1279417619000,"updated-at":1332951489000,"_id":"542692cfc026201cdc326e7a"},{"author":{"login":"jmglov","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/67e9a6f766dc4b30bd5e9ff3e77c1777?r=PG&default=identicon"},"editors":[],"body":";; If elements are already in a sequence, use apply\nuser=\u003E (apply min [1 2 3 4 3])\n1\nuser=\u003E (apply min '(4 3 5 6 2))\n2","created-at":1392661837000,"updated-at":1392661837000,"_id":"542692d4c026201cdc327011"}],"notes":null,"arglists":["x","x y","x y & more"],"doc":"Returns the least of the nums.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/min"},{"added":"1.1","ns":"clojure.core","name":"pop!","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1329970267000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"assoc!","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dcf"},{"created-at":1329970271000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"dissoc!","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dd0"}],"line":3418,"examples":[{"author":{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":";; Note how we always use the return value of pop! in these examples\n;; for all future modifications, rather than (incorrectly) ignoring the return\n;; value and continuing to modify the original transient set. See examples for\n;; assoc! and dissoc! for more discussion and examples of this.\n\nuser=\u003E (def foo (transient [1 2 3]))\n#'user/foo\nuser=\u003E (count foo)\n3\nuser=\u003E (def foo (pop! foo))\n#'user/foo\nuser=\u003E foo\n#\u003CTransientVector clojure.lang.PersistentVector$TransientVector@1638fff7\u003E\nuser=\u003E (count foo)\n2\nuser=\u003E (def foo (pop! foo))\n#'user/foo\nuser=\u003E (count foo)\n1\nuser=\u003E (def foo (persistent! foo))\n#'user/foo\nuser=\u003E (count foo)\n1\nuser=\u003E foo\n[1]\n","created-at":1307739212000,"updated-at":1329970478000,"_id":"542692c7c026201cdc3269ce"}],"notes":null,"arglists":["coll"],"doc":"Removes the last item from a transient vector. If\n the collection is empty, throws an exception. Returns coll","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/pop!"},{"ns":"clojure.core","name":"chunk-append","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":697,"examples":null,"notes":null,"arglists":["b x"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core/chunk-append"},{"added":"1.0","ns":"clojure.core","name":"prn-str","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1315392416000,"author":{"login":"srid","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bd3a68d670372cd09876c26270a4299a?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"prn","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521aca"},{"created-at":1412284928324,"author":{"login":"phreed","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/211644?v=2"},"to-var":{"ns":"clojure.edn","name":"read-string","library-url":"https://github.com/clojure/clojure"},"_id":"542dc200e4b05f4d257a299a"}],"line":4794,"examples":[{"author":{"login":"Miles","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bbb26d2a5e856c4fba0f72c3f7250f3f?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"mdemare","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7c45f63f61e478233f0c2ad3006b178c?r=PG&default=identicon"},{"login":"Miles","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bbb26d2a5e856c4fba0f72c3f7250f3f?r=PG&default=identicon"},{"login":"haplo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/890d46f8c0e24dd6fb8546095b1144e?r=PG&default=identicon"}],"body":"user=\u003E (def x \"Hello!\\nMy name is George.\\n\")\n#'user/x\n\nuser=\u003E (prn-str x)\n\"Hello!\\nMy name is George.\\n\\n\"\nnil\n","created-at":1284257994000,"updated-at":1318573811000,"_id":"542692cac026201cdc326b1d"}],"notes":null,"tag":"java.lang.String","arglists":["& xs"],"doc":"prn to a string, returning it","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/prn-str"},{"added":"1.0","ns":"clojure.core","name":"with-precision","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":null,"line":5139,"examples":[{"author":{"login":"Miles","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bbb26d2a5e856c4fba0f72c3f7250f3f?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"Miles","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bbb26d2a5e856c4fba0f72c3f7250f3f?r=PG&default=identicon"},{"login":"wdkrnls","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/6d08a2f792f289b95fe1d982d4133d71?r=PG&default=identicon"}],"body":";; The \"M\" suffix denotes a BigDecimal instance\n;; http://download.oracle.com/javase/6/docs/api/java/math/BigDecimal.html\n\nuser=\u003E (with-precision 10 (/ 1M 6))\n0.1666666667M\n\nuser=\u003E (.floatValue 0.1666666667M)\n0.16666667\n","created-at":1283812216000,"updated-at":1310865949000,"_id":"542692cbc026201cdc326bb1"}],"macro":true,"notes":null,"arglists":["precision & exprs"],"doc":"Sets the precision and rounding mode to be used for BigDecimal operations.\n\n Usage: (with-precision 10 (/ 1M 3))\n or: (with-precision 10 :rounding HALF_DOWN (/ 1M 3))\n\n The rounding mode is one of CEILING, FLOOR, HALF_UP, HALF_DOWN,\n HALF_EVEN, UP, DOWN and UNNECESSARY; it defaults to HALF_UP.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/with-precision"},{"added":"1.0","ns":"clojure.core","name":"format","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1330170781000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"printf","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dbc"},{"created-at":1330170789000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.pprint","name":"cl-format","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dbd"},{"created-at":1330170796000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.pprint","name":"print-table","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dbe"}],"line":5791,"examples":[{"author":{"login":"Jacolyte","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1703a0c3ed358b787f4b1bf3b2799472?r=PG&default=identicon"},"editors":[{"login":"Jacolyte","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1703a0c3ed358b787f4b1bf3b2799472?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"philos99","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1de5617efb013ca7c9cf8e5646818ffa?r=PG&default=identicon"}],"body":";; See http://download.oracle.com/javase/1.5.0/docs/api/java/util/Formatter.html\n;; for formatting options.\nuser=\u003E (format \"Hello there, %s\" \"bob\")\n\"Hello there, bob\"\n","created-at":1279854390000,"updated-at":1317218923000,"_id":"542692c6c026201cdc3268ef"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"thethomaseffect","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b4330b8e3ed048b2aa3b50183c42e600?r=PG&default=identicon"}],"body":"user=\u003E (format \"%5d\" 3)\n\" 3\"\n\nuser=\u003E (format \"Pad with leading zeros %07d\" 5432)\n\"Pad with leading zeros 0005432\"\n\nuser=\u003E (format \"Left justified :%-7d:\" 5432)\n\"Left justified :5432 :\"\n\nuser=\u003E (format \"Locale-specific group separators %,12d\" 1234567)\n\"Locale-specific group separators 1,234,567\"\n\nuser=\u003E (format \"decimal %d octal %o hex %x upper-case hex %X\" 63 63 63 63)\n\"decimal 63 octal 77 hex 3f upper-case hex 3F\"\n\nuser=\u003E (format \"%2$d %1$s\" \"Positional arguments\" 23)\n\"23 Positional arguments\"\n\n;; ====== Clojure format/printf and large integers =====\n\n;; This big number doesn't fit in a Long. It is a\n;; clojure.lang.BigInt, which format cannot handle directly.\nuser=\u003E (format \"%5d\" 12345678901234567890)\nIllegalFormatConversionException d != clojure.lang.BigInt java.util.Formatter$FormatSpecifier.failConversion (Formatter.java:3999)\n\n;; You can convert it to a java.math.BigInteger, which format does handle.\nuser=\u003E (format \"%5d\" (biginteger 12345678901234567890))\n\"12345678901234567890\"\n\n;; If you do this very often, you might want to use something like\n;; format-plus to avoid sprinkling your code with calls to biginteger.\n(defn coerce-unformattable-types [args]\n (map (fn [x]\n (cond (instance? clojure.lang.BigInt x) (biginteger x)\n (instance? clojure.lang.Ratio x) (double x)\n :else x))\n args))\n\n(defn format-plus [fmt & args]\n (apply format fmt (coerce-unformattable-types args)))\n\n;; Now this works:\nuser=\u003E (format-plus \"%5d\" 12345678901234567890)\n\"12345678901234567890\"","created-at":1331440228000,"updated-at":1389568458000,"_id":"542692d3c026201cdc326fab"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":";; ==== Clojure format/printf and floating-point formats ====\nuser=\u003E (format \"%.3f\" 2.0)\n\"2.000\"\n\n;; format doesn't handle integers or ratios with %e, %f, %g, or %a\nuser=\u003E (format \"%.3f\" 2)\nIllegalFormatConversionException f != java.lang.Long java.util.Formatter$FormatSpecifier.failConversion (Formatter.java:3999)\n\n;; In general, if you want to use floating-point formats %e, %f, %g,\n;; or %a with format or printf, and you don't know whether the values\n;; you want to format are floats or doubles, you should convert them:\nuser=\u003E (format \"%.3f\" (double 2))\n\"2.000\"\n\nuser=\u003E (format \"%.3f\" (double (/ 5 2)))\n\"2.500\"\n\n;; One could make a function that parses the format string to look for\n;; %f and other floating-point formats and automatically coerces the\n;; corresponding arguments to doubles, but such a function probably\n;; wouldn't fit into a short example. You could also consider using\n;; cl-format which does handle these kinds of things for you. The main\n;; disadvantage to doing so is that you have to learn a different syntax\n;; for format specifiers.","created-at":1331440712000,"updated-at":1332477536000,"_id":"542692d3c026201cdc326fb0"}],"notes":null,"arglists":["fmt & args"],"doc":"Formats a string using java.lang.String.format, see java.util.Formatter for format\n string syntax","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/format"},{"added":"1.0","ns":"clojure.core","name":"reversible?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":6334,"examples":[{"author":{"login":"replore","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e7869fe1a48cb1814c657eaca6bea3eb?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (reversible? [])\ntrue\nuser=\u003E (reversible? '())\nfalse\nuser=\u003E (reversible? #{})\nfalse","created-at":1321359686000,"updated-at":1332950321000,"_id":"542692d5c026201cdc327076"}],"notes":null,"arglists":["coll"],"doc":"Returns true if coll implements Reversible","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/reversible_q"},{"added":"1.0","ns":"clojure.core","name":"shutdown-agents","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1285923562000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"send","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ae5"},{"created-at":1285923568000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"send-off","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ae6"},{"created-at":1285923576000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"agent","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ae7"},{"created-at":1285923589000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"agent-error","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ae8"}],"line":2271,"examples":[{"author":{"login":"taylor.sando","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c127297f5548f7275ded1428aa5518bb?r=PG&default=identicon"},"editors":[],"body":";; Creating an agent\nuser\u003E (def a (agent 1))\n#'user/a\n\n;; Create a function that can handle an agent\n\nuser\u003E (defn agent-action [a]\n\t33)\n#'user/agent-action\n\n;; The agent will become 33\nuser\u003E (send-off a agent-action)\n#\u003CAgent@dde4f2: 33\u003E\n\nuser\u003E @a\n33\n;; Create another agent before shutdown\nuser\u003E (def c (agent 3))\n#'user/c\n\n;; Shutdown agents is called\nuser\u003E (shutdown-agents)\nnil\n\n;; Attempt to turn c into 33\nuser\u003E (send c agent-action)\n#\u003CAgent@b162fa: 3\u003E\n\n;; The result is that it is still the same value it was initialized with\nuser\u003E @c\n3\n\n;; Agent created after shutdown\nuser\u003E (def d (agent 4))\n#'user/d\n\n;; Try sending it\nuser\u003E (send d agent-action)\n#\u003CAgent@356519: 4\u003E\n\n;; Same thing, there are no threads to process the agents\nuser\u003E @d\n4","created-at":1349607696000,"updated-at":1349607696000,"_id":"542692d5c026201cdc327084"},{"author":{"login":"taylor.sando","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c127297f5548f7275ded1428aa5518bb?r=PG&default=identicon"},"editors":[],"body":";; Create the agent that we will be using\nuser=\u003E (def a (agent 0))\n#'user/a\n\n;; Dereference the agent to show the value is 0\nuser=\u003E @a\n0\n\n;; Create a function that can increment the agent\n;; This will continually update the value of the agent\nuser=\u003E (defn agent-inc [a]\n (send-off *agent* agent-inc)\n (inc a))\n#'user/agent-inc\n\n;; Send the agent to the agent-inc function\n;; The value is 188 because by the time the repl has sent off the\n;; agent to the function, the function has already been called recursively\nuser=\u003E (send a agent-inc)\n#\u003CAgent@6b850d: 188\u003E\n\n;; Dereference of the value a second or so later\nuser=\u003E @a\n716889\n\n;; Another dereference in another couple of seconds\nuser=\u003E @a\n1455264\n\n;; Shutdown the threads for the agents\nuser=\u003E (shutdown-agents)\nnil\n\n;; Dereference the agent to see what value it is\nuser=\u003E @a\n3522353\n\n;; Dereference the agent again in a few seconds\n;; It's the same value, because the agent pool of threads are no longer\n;; active\nuser=\u003E @a\n3522353\n","created-at":1349608162000,"updated-at":1349608162000,"_id":"542692d5c026201cdc327085"}],"notes":null,"arglists":[""],"doc":"Initiates a shutdown of the thread pools that back the agent\n system. Running actions will complete, but no new actions will be\n accepted","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/shutdown-agents"},{"added":"1.0","ns":"clojure.core","name":"conj","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1297212938000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"cons","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d76"},{"created-at":1398537407000,"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"into","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d77"},{"created-at":1400493822000,"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"peek","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d78"},{"created-at":1400493828000,"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"pop","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d79"}],"line":75,"examples":[{"author":{"login":"MrHus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4fa262299223e58030e9062d97224547?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"Steve","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/454ce0be068cbbf25ee685af20dc7cd6?r=PG&default=identicon"},{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},{"login":"Wilfred","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1f86c0bc40235a9edf351a16b859aabd?r=PG&default=identicon"},{"login":"ElieLabeca","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/724e1112a2be4d5af767c0cf152d087e?r=PG&default=identicon"},{"login":"ElieLabeca","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/724e1112a2be4d5af767c0cf152d087e?r=PG&default=identicon"},{"login":"s_prakash_joy","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7704115a8be45640094d5d9fc6f4e22a?r=PG&default=identicon"}],"body":"user=\u003E (conj [1 2 3] 4)\n[1 2 3 4]\n\nuser=\u003E (conj '(1 2 3) 4)\n(4 1 2 3)\n\nuser=\u003E (conj [\"a\" \"b\" \"c\"] \"d\")\n[\"a\" \"b\" \"c\" \"d\"]\n\nuser=\u003E (conj [1 2] 3 4) \n[1 2 3 4]\n\nuser=\u003E (conj [[1 2] [3 4]] [5 6]) \n[[1 2] [3 4] [5 6]]\n\n;; Maps only take vectors of length exactly 2\nuser=\u003E (conj {1 2, 3 4} [5 6])\n{5 6, 1 2, 3 4}\n\nuser=\u003E (conj {:firstname \"John\" :lastname \"Doe\"} {:age 25 :nationality \"Chinese\"})\n{:nationality \"Chinese\", :age 25, :firstname \"John\", :lastname \"Doe\"}\n\n;; conj on a set\nuser=\u003E (conj #{1 3 4} 2)\n#{1 2 3 4}\n\n","created-at":1279417029000,"updated-at":1365052968000,"_id":"542692c9c026201cdc326abc"},{"author":{"login":"john.r.woodward","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/22b6fbc4a386291e45b1cb4449377086?r=PG&default=identicon"},"editors":[{"login":"john.r.woodward","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/22b6fbc4a386291e45b1cb4449377086?r=PG&default=identicon"},{"login":"Thumbnail","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/db68e51797a2382e185b42ce6534b7a4?r=PG&default=identicon"}],"body":";conjoin shows similar behaviour to cons\n(conj [\"a\" \"b\" \"c\"] [\"a\" \"b\" \"c\"] )\nuser=\u003E [\"a\" \"b\" \"c\" [\"a\" \"b\" \"c\"]]","created-at":1342724544000,"updated-at":1391629998000,"_id":"542692d2c026201cdc326f6d"},{"author":{"login":"jamesqiu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bc1268deaa7f2e78fe2b5ea76e6481d8?r=PG&default=identicon"},"editors":[],"body":"; conj nil with x or xs\nuser=\u003E (conj nil 3)\n(3)\nuser=\u003E (conj nil 3 4)\n(4 3)","created-at":1349714643000,"updated-at":1349714643000,"_id":"542692d2c026201cdc326f70"},{"author":{"login":"Alan Thompson","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5b677647e3c6fb2bc89fa2f481461b11?r=PG&default=identicon"},"editors":[],"body":"; maps and sets are treated differently\nuser=\u003E (conj {1 2} {3 4})\n{3 4, 1 2} ; the contents of {3 4} are added to {1 2}\n\nuser=\u003E (conj #{1 2} #{3})\n#{1 2 #{3}} ; the whole set #{3} is added to #{1 2}\n\nuser=\u003E (clojure.set/union #{1 2} #{3})\n#{1 2 3} ; must use (clojure.set/union) to merge sets, not conj\n","created-at":1392346414000,"updated-at":1392346414000,"_id":"542692d2c026201cdc326f71"}],"notes":null,"arglists":["","coll","coll x","coll x & xs"],"doc":"conj[oin]. Returns a new collection with the xs\n 'added'. (conj nil item) returns (item).\n (conj coll) returns coll. (conj) returns [].\n The 'addition' may happen at different 'places' depending\n on the concrete type.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/conj"},{"added":"1.2","ns":"clojure.core","name":"bound?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1328397785000,"author":{"login":"steveminer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d28543d134185d12d4006a74738d233e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"thread-bound?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521af8"}],"line":5565,"examples":[{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"steveminer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d28543d134185d12d4006a74738d233e?r=PG&default=identicon"}],"body":"user=\u003E (def foobar)\n#'user/foobar\nuser=\u003E (bound? #'foobar)\nfalse\nuser=\u003E (def boing 10)\n#'user/boing\nuser=\u003E (bound? #'boing)\ntrue\nuser=\u003E (defn plus3 [n] (+ 3 n))\n#'user/plus3\nuser=\u003E (bound? #'plus3)\ntrue\n","created-at":1279073551000,"updated-at":1318467872000,"_id":"542692cdc026201cdc326ce1"}],"notes":null,"arglists":["& vars"],"doc":"Returns true if all of the vars provided as arguments have any bound value, root or thread-local.\n Implies that deref'ing the provided vars will succeed. Returns true if no vars are provided.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/bound_q"},{"added":"1.7","ns":"clojure.core","name":"transduce","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":7012,"examples":null,"notes":null,"arglists":["xform f coll","xform f init coll"],"doc":"reduce with a transformation of f (xf). If init is not\n supplied, (f) will be called to produce it. f should be a reducing\n step function that accepts both 1 and 2 arguments, if it accepts\n only 2 you can add the arity-1 with 'completing'. Returns the result\n of applying (the transformed) xf to init and the first item in coll,\n then applying xf to that result and the 2nd item, etc. If coll\n contains no items, returns init and f is not called. Note that\n certain transforms may inject or skip items.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/transduce"},{"added":"1.0","ns":"clojure.core","name":"lazy-seq","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1318395998000,"author":{"login":"haplo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/890d46f8c0e24dd6fb8546095b1144e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"lazy-cat","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ed7"},{"created-at":1322679999000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"realized?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ed8"},{"created-at":1322680082000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"doall","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ed9"},{"created-at":1370143899000,"author":{"login":"Mark Addleman","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/768de71b6c873394290733acf422b4d5?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"iterate","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521eda"}],"line":685,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"Stathis Sideris","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/299a3fab7a1a2d6644455dedae9fce0a?r=PG&default=identicon"}],"body":";; The following defines a lazy-seq of all positive numbers. Note that \n;; the lazy-seq allows us to make a recursive call in a safe way because\n;; the call does not happen immediately but instead creates a closure.\n\nuser=\u003E (defn positive-numbers \n\t([] (positive-numbers 1))\n\t([n] (cons n (lazy-seq (positive-numbers (inc n))))))\n#'user/positive-numbers\n\nuser=\u003E (take 5 (positive-numbers))\n(1 2 3 4 5)\n\n","created-at":1281346189000,"updated-at":1346877126000,"_id":"542692cec026201cdc326ddd"},{"author":{"login":"jakubholynet","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/32b26dbbf1f84656393a57a292c73728?r=PG&default=identicon"},"editors":[{"login":"jakubholynet","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/32b26dbbf1f84656393a57a292c73728?r=PG&default=identicon"},{"login":"jakubholynet","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/32b26dbbf1f84656393a57a292c73728?r=PG&default=identicon"},{"login":"redraiment","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/33087654dbc710e81f51fda5f8241f28?r=PG&default=identicon"},{"login":"Stathis Sideris","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/299a3fab7a1a2d6644455dedae9fce0a?r=PG&default=identicon"}],"body":";; A lazy-seq of Fibonacci numbers (fn = fn-1 + fn-2)\n;; The producer function takes exactly two parameters\n;; (because we need the last 2 elements to produce a new one)\nuser=\u003E (defn fib [a b] (cons a (lazy-seq (fib b (+ b a)))))\n\nuser=\u003E (take 5 (fib 1 1))\n(1 1 2 3 5)","created-at":1322121310000,"updated-at":1346877170000,"_id":"542692d3c026201cdc326feb"},{"author":{"login":"jakubholynet","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/32b26dbbf1f84656393a57a292c73728?r=PG&default=identicon"},"editors":[],"body":";; It might be easier to think about the producer function as a function\n;; that, given element n, produces element n+1 via a recursive call to \n;; itself, wrapped with lazy-seq to delay its execution\n;; We might also provide no-argument version of the function that calls \n;; itself for the first element(s) of the sequence being generated.\n;; =\u003E variant of fibonaci with a no-arg version and using cons first:\n(defn sum-last-2 \n ([] (sum-last-2 1 2)) \n ([n m] (cons n (lazy-seq (sum-last-2 m (+ n m))))))\n\nuser=\u003E (take 6 (sum-last-2))\n(1 2 3 5 8 13)","created-at":1330300424000,"updated-at":1330300424000,"_id":"542692d3c026201cdc326ff0"},{"author":{"login":"esumitra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d3df4ff6342ed6fba898021bf2d19a6d?r=PG&default=identicon"},"editors":[{"login":"emdeesee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b60d7f482b9f88cb3a673f370ea15c9c?r=PG&default=identicon"}],"body":";; An example combining lazy sequences with higher order functions\n;; Generate prime numbers using trial division.\n;; Note that the starting set of sieved numbers should be\n;; the set of integers starting with 2 i.e., (iterate inc 2) \n(defn sieve [s]\n (cons (first s)\n (lazy-seq (sieve (filter #(not= 0 (mod % (first s)))\n (rest s))))))\n\nuser=\u003E (take 20 (sieve (iterate inc 2)))\n(2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71)\n","created-at":1354916731000,"updated-at":1358553134000,"_id":"542692d3c026201cdc326ff1"}],"macro":true,"notes":null,"arglists":["& body"],"doc":"Takes a body of expressions that returns an ISeq or nil, and yields\n a Seqable object that will invoke the body only the first time seq\n is called, and will cache the result and return it on all subsequent\n seq calls. See also - realized?","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/lazy-seq"},{"added":"1.0","ns":"clojure.core","name":"*print-length*","file":"clojure/core_print.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":16,"examples":[{"author":{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; Oops! Don't this!!!\nuser=\u003E (iterate inc 0)\n;; Frantically doing C-c C-c :-P\n; Evaluation aborted.\n\nuser=\u003E (set! *print-length* 10)\n10\n\n;; Now it's perfectly fine. Yay!\nuser=\u003E (iterate inc 0)\n(0 1 2 3 4 5 6 7 8 9 ...)\n\n","created-at":1279053974000,"updated-at":1285501961000,"_id":"542692cac026201cdc326b12"}],"notes":null,"arglists":[],"doc":"*print-length* controls how many items of each collection the\n printer will print. If it is bound to logical false, there is no\n limit. Otherwise, it must be bound to an integer indicating the maximum\n number of items of each collection to print. If a collection contains\n more items, the printer will print items up to the limit followed by\n '...' to represent the remaining items. The root binding is nil\n indicating no limit.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/*print-length*"},{"added":"1.0","ns":"clojure.core","name":"*file*","type":"var","see-alsos":null,"examples":null,"notes":[{"updated-at":1324600617000,"body":"Does this actually work? I couldn't get it to print anything but NO_SOURCE_PATH. (And no, this wasn't in the REPL.)","created-at":1324600599000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fd3"},{"updated-at":1349216667000,"body":"If you're having trouble getting this feature to work as advertised, check out [this StackOverflow Question](http://stackoverflow.com/questions/12692698/file-variable-not-working/12693068).","created-at":1349216667000,"author":{"login":"Jeff Terrell","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/658b2643cf2a8192286b5bb1ecb62cf8?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fe8"}],"arglists":[],"doc":"The path of the file being evaluated, as a String.\n\n When there is no file, e.g. in the REPL, the value is not defined.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/*file*"},{"added":"1.0","ns":"clojure.core","name":"compare-and-set!","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1350642558000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"atom","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b1e"},{"created-at":1360265895000,"author":{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"reset!","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b1f"},{"created-at":1360265902000,"author":{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"swap!","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b20"}],"line":2385,"examples":[{"author":{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"},"editors":[{"login":"franks42","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b3ee701dd6c481e5d310467ddfe62c48?r=PG&default=identicon"}],"body":"user=\u003E (def a (atom 0))\n#'user/a\nuser=\u003E (compare-and-set! a 10 20)\nfalse\nuser=\u003E @a\n0\nuser=\u003E (compare-and-set! a 0 10)\ntrue\nuser=\u003E @a\n10\n","created-at":1308629522000,"updated-at":1353813491000,"_id":"542692cfc026201cdc326e27"}],"notes":null,"arglists":["atom oldval newval"],"doc":"Atomically sets the value of atom to newval if and only if the\n current value of the atom is identical to oldval. Returns true if\n set happened, else false","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/compare-and-set!"},{"ns":"clojure.core","name":"*use-context-classloader*","type":"var","see-alsos":null,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core/*use-context-classloader*"},{"ns":"clojure.core","name":"await1","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":3309,"examples":null,"notes":null,"arglists":["a"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core/await1"},{"added":"1.0","ns":"clojure.core","name":"let","special-form":true,"file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1290671337000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"letfn","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b09"},{"created-at":1399434293000,"author":{"login":"Chort409","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/73da2cf9145cfb9c900b31436ee435a6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"if-let","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ba0"}],"line":4523,"examples":[{"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":";; let is a Clojure special form, a fundamental building block of the language.\n;;\n;; In addition to parameters passed to functions, let provides a way to create\n;; lexical bindings of data structures to symbols. The binding, and therefore \n;; the ability to resolve the binding, is available only within the lexical \n;; context of the let. \n;; \n;; let uses pairs in a vector for each binding you'd like to make and the value \n;; of the let is the value of the last expression to be evaluated. let also \n;; allows for destructuring which is a way to bind symbols to only part of a \n;; collection.\n\n;; A basic use for a let:\nuser=\u003E (let [x 1] \n x)\n1\n\n;; Note that the binding for the symbol y won't exist outside of the let:\nuser=\u003E (let [y 1] \n y)\n1\nuser=\u003E (prn y)\njava.lang.Exception: Unable to resolve symbol: y in this context (NO_SOURCE_FILE:7)\n\n;; Another valid use of let:\nuser=\u003E (let [a 1 b 2] \n (+ a b))\n3\n\n;; The forms in the vector can be more complex (this example also uses\n;; the thread macro):\nuser=\u003E (let [c (+ 1 2)\n [d e] [5 6]] \n (-\u003E (+ d e) (- c)))\n8\n\n;; The bindings for let need not match up (note the result is a numeric\n;; type called a ratio):\nuser=\u003E (let [[g h] [1 2 3]] \n (/ g h))\n1/2\n\n;; From http://clojure-examples.appspot.com/clojure.core/let with permission.","created-at":1278720629000,"updated-at":1331709972000,"_id":"542692c7c026201cdc3269bb"},{"author":{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (let [a (take 5 (range))\n {:keys [b c d] :or {d 10 b 20 c 30}} {:c 50 :d 100}\n [e f g & h] [\"a\" \"b\" \"c\" \"d\" \"e\"]\n _ (println \"I was here!\")\n foo 12\n bar (+ foo 100)]\n [a b c d e f g h foo bar])\nI was here!\n[(0 1 2 3 4) 20 50 100 \"a\" \"b\" \"c\" (\"d\" \"e\") 12 112]\n","created-at":1279162869000,"updated-at":1285500534000,"_id":"542692c7c026201cdc3269c2"},{"author":{"login":"johnfn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffffd204ecbbae82a04f5b574d76746b?r=PG&default=identicon"},"editors":[],"body":"; :as example \n\nuser=\u003E (let [[x y :as my-point] [5 3]]\n (println x y)\n (println my-point))\n\n5 3\n[5 3]\n\n; :as names the group you just destructured.\n\n; equivalent to (and better than)\n\nuser=\u003E (let [[x y] [5 3]\n my-point [x y]]\n ;...","created-at":1312965326000,"updated-at":1312965326000,"_id":"542692c7c026201cdc3269c4"},{"author":{"login":"leifp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d2f37720f063404ef83b987d2824353d?r=PG&default=identicon"},"editors":[],"body":";;; map destructuring, all features\nuser=\u003E\n(let [\n ;;Binding Map\n {:keys [k1 k2] ;; bind vals with keyword keys\n :strs [s1 s2] ;; bind vals with string keys\n :syms [sym1 sym2] ;; bind vals with symbol keys\n :or {k2 :default-kw, ;; default values\n s2 :default-s, \n sym2 :default-sym} \n :as m} ;; bind the entire map to `m`\n ;;Data\n {:k1 :keyword1, :k2 :keyword2, ;; keyword keys\n \"s1\" :string1, \"s2\" :string2, ;; string keys\n 'sym1 :symbol1, ;; symbol keys\n ;; 'sym2 :symbol2 ;; `sym2` will get default value\n }] \n [k1 k2 s1 s2 sym1 sym2 m]) ;; return value\n\n[:keyword1, :keyword2, \n :string1, :string2,\n :symbol1, :default-sym, ;; key didn't exist, so got the default\n {'sym1 :symbol1, :k1 :keyword1, :k2 :keyword2, \n \"s1\" :string1, \"s2\" :string2}]\n\n;; remember that vector and map destructuring can also be used with \n;; other macros that bind variables, e.g. `for` and `doseq`","created-at":1335261849000,"updated-at":1335261849000,"_id":"542692d3c026201cdc326ff3"},{"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"editors":[],"body":";;; no value of a key\nuser\u003E (let [{:keys [a b] :as m} (:x {})]\n [a b m])\n[nil nil nil]\n\n;;; same as above\nuser\u003E (let [{:keys [a b] :as m} nil]\n [a b m])\n[nil nil nil]\n\n;;; similar case on Vector\nuser\u003E (let [[a b :as v] nil]\n [a b v])\n[nil nil nil]\n","created-at":1399634796000,"updated-at":1399634796000,"_id":"542692d3c026201cdc326ff4"}],"macro":true,"notes":[{"updated-at":1297072373000,"body":"Nota Bene: `let` in Clojure is like `let*` in Scheme -- each init-expr has access to the preceding binding forms. (There is also a `let*`, but it is more or less `let` without destructuring, and in fact is the underlying implementation.)","created-at":1297072373000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fb2"}],"arglists":["bindings & body"],"doc":"binding =\u003E binding-form init-expr\n binding-form =\u003E name, or destructuring-form\n destructuring-form =\u003E map-destructure-form, or seq-destructure-form\n\n Evaluates the exprs in a lexical context in which the symbols in\n the binding-forms are bound to their respective init-exprs or parts\n therein.\n\n See https://clojure.org/reference/special_forms#binding-forms for\n more information about destructuring.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/let","forms":["(let [bindings*] exprs*)"]},{"added":"1.0","ns":"clojure.core","name":"ref-set","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1284616929000,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.core","name":"ref","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d91"}],"line":2472,"examples":[{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (def foo (ref {}))\n#'user/foo\n\nuser=\u003E (dosync\n (ref-set foo {:foo \"bar\"}))\n{:foo \"bar\"}\n\nuser=\u003E @foo\n{:foo \"bar\"}\n","created-at":1280777271000,"updated-at":1285495563000,"_id":"542692c9c026201cdc326acb"}],"notes":null,"arglists":["ref val"],"doc":"Must be called in a transaction. Sets the value of ref.\n Returns val.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/ref-set"},{"added":"1.1","ns":"clojure.core","name":"pop-thread-bindings","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1374313672000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"push-thread-bindings","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521eff"},{"created-at":1374313678000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"binding","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f00"}],"line":1948,"examples":null,"notes":null,"arglists":[""],"doc":"Pop one set of bindings pushed with push-binding before. It is an error to\n pop bindings without pushing before.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/pop-thread-bindings"},{"added":"1.0","ns":"clojure.core","name":"interleave","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1293096421000,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.core","name":"interpose","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ed3"},{"created-at":1325197345000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"zipmap","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ed4"}],"line":4335,"examples":[{"author":{"login":"cdorrat","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5dedcb7069d39421760f6d255def10c3?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; This example takes a list of keys and a separate list of values and \n;; inserts them into a map.\nuser=\u003E (apply assoc {} \n (interleave [:fruit :color :temp] \n [\"grape\" \"red\" \"hot\"]))\n\n{:temp \"hot\", :color \"red\", :fruit \"grape\"}\n","created-at":1278756097000,"updated-at":1285502553000,"_id":"542692ccc026201cdc326c48"},{"author":{"login":"kotarak","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5db30f607f0b5fa70d690311aa3bfd3b?r=PG&default=identicon"},"editors":[{"login":"kotarak","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5db30f607f0b5fa70d690311aa3bfd3b?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; Simple example:\nuser=\u003E (interleave [:a :b :c] [1 2 3])\n(:a 1 :b 2 :c 3)","created-at":1279026371000,"updated-at":1285502563000,"_id":"542692ccc026201cdc326c4c"},{"author":{"login":"kotarak","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5db30f607f0b5fa70d690311aa3bfd3b?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; The shortest input stops interleave:\n\nuser=\u003E (interleave [:a :b] (iterate inc 1))\n(:a 1 :b 2)","created-at":1279026486000,"updated-at":1285502572000,"_id":"542692ccc026201cdc326c4f"},{"author":{"login":"octopusgrabbus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fd31b8bcea99fa7b0711fbc424587774?r=PG&default=identicon"},"editors":[],"body":"(def s1 [[:000-00-0000 \"TYPE 1\" \"JACKSON\" \"FRED\"]\n [:000-00-0001 \"TYPE 2\" \"SIMPSON\" \"HOMER\"]\n [:000-00-0002 \"TYPE 4\" \"SMITH\" \"SUSAN\"]])\n\n(interleave (map #(nth % 0 nil) s1) (map #(nth % 1 nil) s1))","created-at":1334887108000,"updated-at":1334887108000,"_id":"542692d3c026201cdc326fd1"},{"author":{"login":"octopusgrabbus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fd31b8bcea99fa7b0711fbc424587774?r=PG&default=identicon"},"editors":[],"body":"(def s1 [[:000-00-0000 \"TYPE 1\" \"JACKSON\" \"FRED\"]\n [:000-00-0001 \"TYPE 2\" \"SIMPSON\" \"HOMER\"]\n [:000-00-0002 \"TYPE 4\" \"SMITH\" \"SUSAN\"]])\n\n(def cols [0 2 3])\n\n(defn f1 \n [s1 col] \n (map #(get-in s1 [% col] nil) (range (count s1))))\n\n(apply interleave (map (partial f1 s1) cols))\n(:000-00-0000 \"JACKSON\" \"FRED\" :000-00-0001 \"SIMPSON\" \"HOMER\" :000-00-0002 \"SMITH\" \"SUSAN\")","created-at":1334887172000,"updated-at":1334887172000,"_id":"542692d3c026201cdc326fd2"}],"notes":null,"arglists":["","c1","c1 c2","c1 c2 & colls"],"doc":"Returns a lazy seq of the first item in each coll, then the second etc.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/interleave"},{"added":"1.0","ns":"clojure.core","name":"printf","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1329894578000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"format","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e35"},{"created-at":1330170804000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.pprint","name":"cl-format","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e36"}],"line":5799,"examples":[{"author":{"login":"lambder","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1c0c20072f52de3a6335cae183b865f6?r=PG&default=identicon"},"editors":[],"body":"(printf \"1 + 2 is %s\\n\" 3)","created-at":1299610618000,"updated-at":1299610618000,"_id":"542692ccc026201cdc326cad"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":";; Click the link to clojure.core/format under See also for\n;; more extensive examples. printf and format take the same\n;; arguments -- the difference is that format returns a formatted\n;; string, whereas printf sends the formatted string to *out*.","created-at":1331440764000,"updated-at":1332477712000,"_id":"542692d4c026201cdc327038"}],"notes":null,"arglists":["fmt & args"],"doc":"Prints formatted output, as per format","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/printf"},{"added":"1.0","ns":"clojure.core","name":"map?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1411815243526,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.core","name":"hash-map","library-url":"https://github.com/clojure/clojure"},"_id":"5426974be4b0d1509f919f73"}],"line":169,"examples":[{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (map? {:a 1 :b 2 :c 3})\ntrue\nuser=\u003E (map? '(1 2 3))\nfalse","created-at":1279074290000,"updated-at":1332951014000,"_id":"542692cbc026201cdc326bdf"}],"notes":null,"arglists":["x"],"doc":"Return true if x implements IPersistentMap","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/map_q"},{"added":"1.0","ns":"clojure.core","name":"-\u003E","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1289746069000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"-\u003E\u003E","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c48"},{"created-at":1412262619860,"author":{"login":"phreed","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/211644?v=2"},"to-var":{"ns":"clojure.core","name":"as-\u003E","library-url":"https://github.com/clojure/clojure"},"_id":"542d6adbe4b05f4d257a298a"}],"line":1694,"examples":[{"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"uvtc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/34f159f89cbd1d9beac0276f5a7af552?r=PG&default=identicon"},{"login":"uvtc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/34f159f89cbd1d9beac0276f5a7af552?r=PG&default=identicon"},{"login":"uvtc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/34f159f89cbd1d9beac0276f5a7af552?r=PG&default=identicon"},{"login":"amithgeorge","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1fabe200e8b19ec248fa8285cd6b493b?r=PG&default=identicon"}],"body":";; Use of `-\u003E` (the \"thread-first\" macro) can help make code\n;; more readable by removing nesting. It can be especially\n;; useful when using host methods:\n\n;; Arguably a bit cumbersome to read:\nuser=\u003E (first (.split (.replace (.toUpperCase \"a b c d\")\n \"A\"\n \"X\")\n \" \"))\n\"X\"\n\n;; Perhaps easier to read:\nuser=\u003E (-\u003E \"a b c d\" \n .toUpperCase \n (.replace \"A\" \"X\") \n (.split \" \") \n first)\n\"X\"\n\n;; It can also be useful for pulling values out of deeply-nested\n;; data structures:\nuser=\u003E (def person \n {:name \"Mark Volkmann\"\n :address {:street \"644 Glen Summit\"\n :city \"St. Charles\"\n :state \"Missouri\"\n :zip 63304}\n :employer {:name \"Object Computing, Inc.\"\n :address {:street \"12140 Woodcrest Dr.\"\n :city \"Creve Coeur\"\n :state \"Missouri\"\n :zip 63141}}})\n \nuser=\u003E (-\u003E person :employer :address :city)\n\"Creve Coeur\"\n\n;; same as above, but with more nesting\nuser=\u003E (:city (:address (:employer person)))\n\"Creve Coeur\"\n\n;; Note that this operator (along with -\u003E\u003E) has at times been\n;; referred to as a 'thrush' operator.\n\n;; From http://clojure-examples.appspot.com/clojure.core/-%3E\n","created-at":1278953347000,"updated-at":1411693797000,"_id":"542692ccc026201cdc326c53"},{"author":{"login":"na_ka_na","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/38aaeb9ed42ddefd5aa63f8b9c4b84a4?r=PG&default=identicon"},"editors":[],"body":";; Your own REPL! (Read Eval Print Loop)\n\n;; We would need a little helper macro for that\n;; It does what its name says - loops forever\nuser=\u003E (defmacro loop-forever [& body] `(loop [] ~@body (recur)))\n\n;; Your own REPL\nuser=\u003E (loop-forever (println (eval (read)))) \n(+ 1 2)\n3\n\n;; If you read the above code left to right (outside in) it reads LPER.\n;; Inside out it reads REPL alright.\n\n;; Sometimes it might be easier to read code outside in, just like a sequence of steps:\n;; 1. Read, 2. Eval, 3. Print, 4. Loop\n;; Here's how -\u003E helps you:\n\nuser=\u003E (-\u003E (read) (eval) (println) (loop-forever)) \n(+ 1 2)\n3\n\n;; Does that read easier for you? If it does, -\u003E is your friend!\n\n;; To see what Clojure did behind the scenes with your -\u003E expression:\nuser=\u003E (require 'clojure.walk)\nnil\nuser=\u003E (clojure.walk/macroexpand-all '(-\u003E (read) (eval) (println) (loop-forever)))\n(loop* [] (println (eval (read))) (recur))\n\n;; You can even use -\u003E's cousin -\u003E\u003E to setup your own REPL:\nuser=\u003E (-\u003E\u003E (read) (eval) (println) (while true))\n(+ 1 2)\n3\n\n;; Can you see why we can't use -\u003E to write the above?\n\n","created-at":1294071196000,"updated-at":1294071196000,"_id":"542692ccc026201cdc326c5a"},{"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"editors":[{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"}],"body":"user=\u003E (def c 5)\nuser=\u003E (-\u003E c (+ 3) (/ 2) (- 1)) \n3\n\n;; and if you are curious why\nuser=\u003E (use 'clojure.walk)\nuser=\u003E (macroexpand-all '(-\u003E c (+ 3) (/ 2) (- 1)))\n(- (/ (+ c 3) 2) 1)\n","created-at":1339249204000,"updated-at":1339250710000,"_id":"542692d1c026201cdc326f3c"}],"macro":true,"notes":[{"updated-at":1280208863000,"body":"See also \u003Ca href=\"http://clojuredocs.org/v/1660\"\u003E->>\u003C/a\u003E which is similar but threads the first expr as the \u003Cb\u003Elast\u003C/b\u003E argument of the forms.","created-at":1280208863000,"author":{"login":"steveminer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d28543d134185d12d4006a74738d233e?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521f8e"},{"updated-at":1374299741000,"body":"I have a [short blog](http://wangjinquan.me/show/Clojure%20线性(箭头)�作符) on this, in case you are still confused on it and understand Chinese.","created-at":1374299714000,"author":{"login":"John Wang","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d66c259a1fa85832e41fb9b90c7e613c?r=PG&default=identicon"},"_id":"542692edf6e94c6970522008"}],"arglists":["x & forms"],"doc":"Threads the expr through the forms. Inserts x as the\n second item in the first form, making a list of it if it is not a\n list already. If there are more forms, inserts the first form as the\n second item in second form, etc.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/-\u003E"},{"added":"1.0","ns":"clojure.core","name":"defstruct","file":"clojure/core.clj","static":true,"type":"macro","column":1,"see-alsos":[{"created-at":1312838555000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"struct","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521a87"},{"created-at":1312849643000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"create-struct","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521a88"},{"created-at":1335411176000,"author":{"login":"steveminer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d28543d134185d12d4006a74738d233e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"defrecord","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521a89"}],"line":4071,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (defstruct person :name :age :height)\n#'user/person\n\nuser=\u003E (struct person \"george\" 22 115)\n{:name \"george\", :age 22, :height 115}","created-at":1280748955000,"updated-at":1285495885000,"_id":"542692c7c026201cdc3269d6"}],"macro":true,"notes":[{"updated-at":1335411165000,"body":"Structs are obsolete. Use records instead. See `defrecord`.","created-at":1335411165000,"author":{"login":"steveminer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d28543d134185d12d4006a74738d233e?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fe0"},{"updated-at":1391537723000,"body":"Are structs obsolete ? Or will become obsolete ? The docs for 'defrecord' have 'Alpha - Subject To Change' ?","created-at":1391537723000,"author":{"login":"monojohnny","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/79d11fd92782ff24d9ae806b72b73d2f?r=PG&default=identicon"},"_id":"542692edf6e94c697052201c"},{"updated-at":1392247001000,"body":"The doc string for defrecord has been changed in Clojure 1.6 to remove the 'alpha' designation, along with many other Clojure functions: https://github.com/clojure/clojure/commit/93d13d0c0671130b329863570080c72799563ac7","created-at":1392247001000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"_id":"542692edf6e94c697052201d"}],"arglists":["name & keys"],"doc":"Same as (def name (create-struct keys...))","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/defstruct"},{"added":"1.0","ns":"clojure.core","name":"*err*","type":"var","see-alsos":null,"examples":null,"notes":null,"arglists":[],"doc":"A java.io.Writer object representing standard error for print operations.\n\n Defaults to System/err, wrapped in a PrintWriter","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/*err*"},{"added":"1.0","ns":"clojure.core","name":"get","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1324306493000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"map-indexed","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bb1"},{"created-at":1359887523000,"author":{"login":"Dmitry Kakurin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/85b70be5da433a6adf5112e7140848da?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"get-in","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bb2"},{"created-at":1360286957000,"author":{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"find","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bb3"}],"line":1508,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (get [1 2 3] 1)\n2\nuser=\u003E (get [1 2 3] 5)\nnil\nuser=\u003E (get {:a 1 :b 2} :b)\n2\nuser=\u003E (get {:a 1 :b 2} :z \"missing\")\n\"missing\"\n\n","created-at":1280321427000,"updated-at":1285496788000,"_id":"542692cdc026201cdc326cd7"},{"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"editors":[],"body":";; to get an index of the element of a vector, use .indexOf\nuser=\u003E (def v [\"one\" \"two\" \"three\" \"two\"])\n#'user/v\n\nuser=\u003E (.indexOf v \"two\")\n1\n\nuser=\u003E (.indexOf v \"foo\")\n-1\n","created-at":1324306658000,"updated-at":1324306658000,"_id":"542692d3c026201cdc326fbd"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (get (System/getenv) \"SHELL\")\n\"/bin/bash\"\n\nuser=\u003E (get (System/getenv) \"PATH\")\n\"/usr/local/bin:/sbin:/usr/sbin:/usr/bin:/bin\"","created-at":1324314703000,"updated-at":1324314703000,"_id":"542692d3c026201cdc326fbe"},{"author":{"login":"rafmagana","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/40bd727b22d74930f292b63d45a71b07?r=PG&default=identicon"},"editors":[],"body":";; 'get' is not the only option\nuser=\u003E (def my-map {:a 1 :b 2 :c 3})\n\n;; maps act like functions\nuser=\u003E (my-map :a)\n1\n\n;; even keys act like functions\nuser=\u003E (:b my-map)\n2","created-at":1340441156000,"updated-at":1340441156000,"_id":"542692d3c026201cdc326fbf"},{"author":{"login":"cympfh","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7ad064788bb989f0c9ae552257355d6?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (get '(a b c) 1)\nnil\n\n;; use nth\nuser=\u003E (nth '(a b c) 1)\nb","created-at":1394404668000,"updated-at":1394404668000,"_id":"542692d3c026201cdc326fc0"}],"notes":null,"arglists":["map key","map key not-found"],"doc":"Returns the value mapped to key, not-found or nil if key not present\n in associative collection, set, string, array, or ILookup instance.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/get"},{"added":"1.0","ns":"clojure.core","name":"doto","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":null,"line":3878,"examples":[{"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"editors":[{"login":"ozzloy","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c546d3f104228c483309c760926e6e3?r=PG&default=identicon"}],"body":";; Note that even though println returns nil, doto still returns the HashMap object\nuser\u003E (doto (java.util.HashMap.)\n (.put \"a\" 1)\n (.put \"b\" 2)\n (println))\n#\u003CHashMap {b=2, a=1}\u003E\n{\"b\" 2, \"a\" 1}\n","created-at":1293673034000,"updated-at":1377844021000,"_id":"542692c9c026201cdc326ae6"},{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"}],"body":";; quick demonstration of using a Collections function on the resulting ArrayList\n\nuser=\u003E (def al (doto (java.util.ArrayList.) (.add 11) (.add 3)(.add 7)))\n#'user/al\nuser=\u003E al\n#\u003CArrayList [11, 3, 7]\u003E\nuser=\u003E (java.util.Collections/sort al)\nnil\nuser=\u003E al\n#\u003CArrayList [3, 7, 11]\u003E\nuser=\u003E","created-at":1313965605000,"updated-at":1313965619000,"_id":"542692c9c026201cdc326ae8"},{"author":{"login":"jimpil","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c3cf214ed0c5f0bca153b1c1177575d6?r=PG&default=identicon"},"editors":[{"login":"Ljos","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/45b996a79abca465acaf6c0f10b0437?r=PG&default=identicon"}],"body":";; careful when calling 'dotimes' from within a 'doto' statement\r\nuser=\u003E (doto (java.util.ArrayList.)\r\n (.add -2)\r\n (.add -1)\r\n (dotimes [i 3] (.add i)))\r\njava.lang.IllegalArgumentException: dotimes requires a vector for its binding (NO_SOURCE_FILE:1)\r\n; what has happened is that (java.util.ArrayList.) has secretly become the first argument to 'dotimes' and thus the exception informs us that it can't find the binding vector required for 'dotimes' to expand. You can cure this behaviour by simply using 'do' instead of 'doto' or by wrapping the call to 'dotimes' in a function. e.g:\r\n\r\n;using 'let' with implicit 'do' instead of 'doto'\r\nuser=\u003E (let [al (java.util.ArrayList.)]\r\n (.add al -2)\r\n (.add al -1)\r\n (dotimes [i 3] (.add al i))\r\n al);return the ArrayList\r\n#\u003CArrayList [-2, -1, 0, 1, 2]\u003E ;exactly what we intended\r\n\r\n;wrapping 'dotimes' in a function literal\r\nuser=\u003E(doto (java.util.ArrayList.)\r\n (.add -2)\r\n (.add -1)\r\n (#(dotimes [i 3] (.add % i))))\r\n#\u003CArrayList [-2, -1, 0, 1, 2]\u003E ;exactly what we intended again\r\n","created-at":1339783113000,"updated-at":1351625582000,"_id":"542692d2c026201cdc326f98"}],"macro":true,"notes":null,"arglists":["x & forms"],"doc":"Evaluates x then calls all of the methods and functions with the\n value of x supplied at the front of the given arguments. The forms\n are evaluated in order. Returns x.\n\n (doto (new java.util.HashMap) (.put \"a\" 1) (.put \"b\" 2))","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/doto"},{"added":"1.0","ns":"clojure.core","name":"identity","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1365638085000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"nil?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e76"}],"line":1465,"examples":[{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (identity 4)\n4","created-at":1279071803000,"updated-at":1332950516000,"_id":"542692ccc026201cdc326c9a"},{"author":{"login":"cschreiner","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/93bff5e102f3d5bcc426e28e06c3c503?r=PG&default=identicon"},"editors":[{"login":"cschreiner","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/93bff5e102f3d5bcc426e28e06c3c503?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (filter identity [1 2 3 nil 4 false true 1234])\n(1 2 3 4 true 1234)","created-at":1279209894000,"updated-at":1332950531000,"_id":"542692ccc026201cdc326c9c"},{"author":{"login":"cschreiner","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/93bff5e102f3d5bcc426e28e06c3c503?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (map #(%1 %2) (cycle [inc identity]) [1 2 3 4 5 6 7 8 9 10])\n(2 2 4 4 6 6 8 8 10 10)\n","created-at":1279209982000,"updated-at":1285500217000,"_id":"542692ccc026201cdc326c9f"},{"author":{"login":"cschreiner","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/93bff5e102f3d5bcc426e28e06c3c503?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (partition-by identity (sort \"abcdaabccc\"))\n((\\a \\a \\a) (\\b \\b) (\\c \\c \\c \\c) (\\d))\n","created-at":1280212301000,"updated-at":1285501489000,"_id":"542692ccc026201cdc326ca1"},{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (map first (partition-by identity [1 1 2 3 3 1 1 5 5]))\n(1 2 3 1 5)","created-at":1310849421000,"updated-at":1310849421000,"_id":"542692ccc026201cdc326ca3"},{"author":{"login":"OnesimusUnbound","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fa4c391db0d2d1744cc2cd0d787dd3d?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (group-by identity \"abracadabra\")\n{\\a [\\a \\a \\a \\a \\a], \\b [\\b \\b], \\r [\\r \\r], \\c [\\c], \\d [\\d]}","created-at":1312216209000,"updated-at":1312216209000,"_id":"542692ccc026201cdc326ca4"}],"notes":[{"updated-at":1280212784000,"body":"I don't quite see the usefulness of this :P","created-at":1280212784000,"author":{"login":"Jacolyte","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1703a0c3ed358b787f4b1bf3b2799472?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521f91"},{"updated-at":1313418353000,"body":"It's useful for example with -> macro when we eventually want to return its argument (in this case: state)\r\n\r\n\r\n\r\n(defn example[state]\r\n (-\u003E state\r\n update-function-1\r\n update-function-2\r\n identity))","created-at":1313418233000,"author":{"login":"dturczanski","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/22c58e86fe0fa676e1fcbe71c1dba1bf?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fc5"},{"updated-at":1316077178000,"body":"Here is another good example:\r\n\u003Cpre\u003E(some identity ((juxt :foo :bar) {:bar :b}))\u003C/pre\u003E\r\nequivalent to \r\n\u003Cpre\u003E (let [map {:bar b}] (or (:foo map) (:bar map)))","created-at":1316077178000,"author":{"login":"lancepantz","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9fbd3eb69f978b77c1bd66436971cdb2?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fcb"}],"arglists":["x"],"doc":"Returns its argument.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/identity"},{"added":"1.0","ns":"clojure.core","name":"into","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1399644560000,"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"conj","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c52"}],"line":7029,"examples":[{"author":{"login":"Miki","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/52338b3d753f00bb7724f2d2ca060a4?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"cloojure","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1ad3de25d00d953de6e8c82f554cdbf5?r=PG&default=identicon"}],"body":"; Maps can be constructed from a sequence of 2-vectors or a sequence \n; of maps\nuser=\u003E (into (sorted-map) [ [:a 1] [:c 3] [:b 2] ] )\n{:a 1, :b 2, :c 3}\nuser=\u003E (into (sorted-map) [ {:a 1} {:c 3} {:b 2} ] )\n{:a 1, :b 2, :c 3}\n\n; When maps are the input source, they convert into an unordered sequence \n; of key-value pairs, encoded as 2-vectors\nuser=\u003E (into [] {1 2, 3 4})\n[[1 2] [3 4]]\n","created-at":1278846273000,"updated-at":1404822264000,"_id":"542692cbc026201cdc326bac"},{"author":{"login":"cran1988","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/6261b9b7e6263f013dfb1330a43a501?r=PG&default=identicon"},"editors":[{"login":"cloojure","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1ad3de25d00d953de6e8c82f554cdbf5?r=PG&default=identicon"}],"body":"; Items are conj'ed one at a time, which puts them at the head of \n; the destination list\nuser=\u003E (into () '(1 2 3))\n(3 2 1)\n","created-at":1310276614000,"updated-at":1404822425000,"_id":"542692cbc026201cdc326baf"},{"author":{"login":"octopusgrabbus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fd31b8bcea99fa7b0711fbc424587774?r=PG&default=identicon"},"editors":[],"body":"(defn test-key-inclusion-cols\n \"return all values in column1 that arent' in column2\"\n [column1 column2]\n (filter (complement (into #{} column2)) column1))\n","created-at":1334632023000,"updated-at":1334632023000,"_id":"542692d3c026201cdc326fd8"},{"author":{"login":"cloojure","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1ad3de25d00d953de6e8c82f554cdbf5?r=PG&default=identicon"},"editors":[],"body":"; Change from one type of map to another\nuser=\u003E (into (sorted-map) {:b 2 :c 3 :a 1})\n{:a 1, :b 2, :c 3}","created-at":1399534625000,"updated-at":1399534625000,"_id":"542692d3c026201cdc326fd9"}],"notes":null,"arglists":["","to","to from","to xform from"],"doc":"Returns a new coll consisting of to with all of the items of\n from conjoined. A transducer may be supplied.\n (into x) returns x. (into) returns [].","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/into"},{"added":"1.0","ns":"clojure.core","name":"areduce","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1342853655000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"amap","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ec7"}],"line":5318,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; This should be about as quick as summing up a array of floats in java.\n\nuser=\u003E (defn asum [#^floats xs]\n (areduce xs i ret (float 0)\n (+ ret (aget xs i))))\n\nuser=\u003E (asum (float-array [1 2 3]))\n6.0\n","created-at":1281617241000,"updated-at":1285494730000,"_id":"542692cec026201cdc326df8"}],"macro":true,"notes":null,"arglists":["a idx ret init expr"],"doc":"Reduces an expression across an array a, using an index named idx,\n and return value named ret, initialized to init, setting ret to the \n evaluation of expr at each step, returning ret.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/areduce"},{"added":"1.0","ns":"clojure.core","name":"long","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1342917169000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"int","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b73"},{"created-at":1342917368000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"longs","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b74"},{"created-at":1342917373000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"long-array","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b75"}],"line":3506,"examples":[{"author":{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"rand0m86","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/aa88f28de4d9335e744f8d10d5ebf8a6?r=PG&default=identicon"},{"login":"rand0m86","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/aa88f28de4d9335e744f8d10d5ebf8a6?r=PG&default=identicon"}],"body":"v.1.3.0\nuser=\u003E (let [num (* 1234567890 21)] [num (int num) (long num)])\n[25925925690 156121914 25925925690]\n\nv.1.6.0\nuser=\u003E (let [num (* 1234567890 21)] [num (int num) (long num)])\nIllegalArgumentException Value out of range for int: 25925925690","created-at":1281031682000,"updated-at":1406257844000,"_id":"542692c7c026201cdc326992"},{"author":{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"rand0m86","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/aa88f28de4d9335e744f8d10d5ebf8a6?r=PG&default=identicon"},{"login":"rand0m86","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/aa88f28de4d9335e744f8d10d5ebf8a6?r=PG&default=identicon"}],"body":"v.1.3.0\nuser=\u003E (= 21 (long 21))\ntrue \n\n;; but\nuser=\u003E (.equals 21 (long 21))\nfalse \n\n;; and thus\nuser=\u003E (get {21 :twenty-one} (long 21))\nnil \n\nv.1.6.0\nuser=\u003E (= 21 (long 21))\ntrue \n\nuser=\u003E (.equals 21 (long 21))\ntrue\n\nuser=\u003E (.equals 21.0 (long 21))\nfalse\n\nuser=\u003E (.equals (long 21.0) (long 21)) \ntrue","created-at":1281031694000,"updated-at":1406257882000,"_id":"542692c7c026201cdc326996"}],"notes":[{"updated-at":1394070050000,"body":"the second example is no longer true.","created-at":1394070050000,"author":{"login":"clojureking","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/92625b8a6be91bb8c688d0d07b4e2a32?r=PG&default=identicon"},"_id":"542692edf6e94c6970522020"}],"arglists":["x"],"doc":"Coerce to long","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/long"},{"added":"1.0","ns":"clojure.core","name":"double","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":3518,"examples":[{"author":{"login":"Miles","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bbb26d2a5e856c4fba0f72c3f7250f3f?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (double 1)\n1.0","created-at":1283814485000,"updated-at":1332952958000,"_id":"542692cec026201cdc326ddb"}],"notes":null,"arglists":["x"],"doc":"Coerce to double","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/double"},{"added":"1.7","ns":"clojure.core","name":"volatile?","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":2565,"examples":null,"notes":null,"arglists":["x"],"doc":"Returns true if x is a volatile.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/volatile_q"},{"added":"1.11","ns":"clojure.core","name":"update-vals","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":8132,"examples":null,"notes":null,"arglists":["m f"],"doc":"m f =\u003E {k (f v) ...}\n\n Given a map m and a function f of 1-argument, returns a new map where the keys of m\n are mapped to result of applying f to the corresponding values of m.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/update-vals"},{"added":"1.0","ns":"clojure.core","name":"definline","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":null,"line":5282,"examples":null,"macro":true,"notes":[{"updated-at":1354753534000,"body":"Note that, as for macros, the arguments to definline are potentially subject to double evaluation if they are used more than once in the body. For example:\r\n\r\n\u003Cpre\u003E\r\nuser=\u003E (definline bad-sqr [x] `(* ~x ~x))\r\n#'user/bad-sqr\r\nuser=\u003E (bad-sqr (do (println \"x\") 5))\r\nx\r\nx\r\n25\r\n\u003C/pre\u003E\r\n\r\n","created-at":1354753534000,"author":{"login":"glchapman","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a5176d5d971ba68c15f4afe376aeaf18?r=PG&default=identicon"},"_id":"542692edf6e94c6970521ff8"},{"updated-at":1385846788000,"body":"Any non-like-a-function behaviour should be avoided, because otherwise function will behave differently depending on whether it's inlined or not:\r\n\r\n user=\u003E (definline bad-if [cond then] `(if ~cond ~then))\r\n #'user/bad-if\r\n user=\u003E (bad-if nil (do (prn :side-effect) :not-returned))\r\n nil\r\n user=\u003E (let [bad-if bad-if] (bad-if nil (do (prn :side-effect) :not-returned)))\r\n :side-effect\r\n nil\r\n","created-at":1385846788000,"author":{"login":"Alexey Tarasevich","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/43e0398b89022d32b43de4c968069312?r=PG&default=identicon"},"_id":"542692edf6e94c6970522013"}],"arglists":["name & decl"],"doc":"Experimental - like defmacro, except defines a named function whose\n body is the expansion, calls to which may be expanded inline as if\n it were a macro. Cannot be used with variadic (&) args.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/definline"},{"added":"1.0","ns":"clojure.core","name":"nfirst","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1343067247000,"author":{"login":"john.r.woodward","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/22b6fbc4a386291e45b1cb4449377086?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"next","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521eb5"}],"line":107,"examples":[{"author":{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},"editors":[{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (nfirst [])\nnil \n\nuser=\u003E (nfirst ['(a b c) '(b a c) '(c b a) '(a c b)])\n(b c)\n\nuser=\u003E (nfirst {:a 1, :b 2, :c 3, :d 4})\n(1)\n\nuser=\u003E (nfirst #{1 2 3})\njava.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Integer (NO_SOURCE_FILE:0)","created-at":1281033567000,"updated-at":1332950990000,"_id":"542692cec026201cdc326d83"}],"notes":null,"arglists":["x"],"doc":"Same as (next (first x))","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/nfirst"},{"added":"1.0","ns":"clojure.core","name":"meta","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1302719092000,"author":{"login":"dnaumov","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/361cb3cfa29928ddff4c49cbb5ad0cbd?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"with-meta","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ec0"},{"created-at":1302719254000,"author":{"login":"dnaumov","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/361cb3cfa29928ddff4c49cbb5ad0cbd?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"*print-meta*","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ec1"}],"line":204,"examples":[{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (meta #'first)\n{:ns #<Namespace clojure.core>, :name first, :file \"clojure/core.clj\", :line 39, :arglists ([coll]), :doc \"Returns the first item in the collection. Calls seq on its\\n argument. If coll is nil, returns nil.\"}\n","created-at":1280777073000,"updated-at":1285495617000,"_id":"542692cfc026201cdc326e8f"}],"notes":null,"arglists":["obj"],"doc":"Returns the metadata of obj, returns nil if there is no metadata.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/meta"},{"ns":"clojure.core","name":"find-protocol-impl","file":"clojure/core_deftype.clj","type":"function","column":1,"see-alsos":null,"line":537,"examples":null,"notes":null,"arglists":["protocol x"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core/find-protocol-impl"},{"added":"1.0","ns":"clojure.core","name":"bit-and-not","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":1334,"examples":[{"author":{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (bit-and-not 2r1100 2r1001) ; (and X (not Y))\n4\n;; 4 = 2r0100","created-at":1280339735000,"updated-at":1332952979000,"_id":"542692cfc026201cdc326e25"}],"notes":null,"arglists":["x y","x y & more"],"doc":"Bitwise and with complement","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/bit-and-not"},{"added":"1.5","ns":"clojure.core","name":"*default-data-reader-fn*","file":"clojure/core.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":8025,"examples":null,"notes":null,"arglists":[],"doc":"When no data reader is found for a tag and *default-data-reader-fn*\n is non-nil, it will be called with two arguments,\n the tag and the value. If *default-data-reader-fn* is nil (the\n default), an exception will be thrown for the unknown tag.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/*default-data-reader-fn*"},{"added":"1.0","ns":"clojure.core","name":"var?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1289214474000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"def","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dc9"},{"created-at":1289214479000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"var","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dca"},{"created-at":1362015178000,"author":{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"var-get","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dcc"},{"created-at":1362015184000,"author":{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"var-set","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dcd"},{"created-at":1362015190000,"author":{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"with-local-vars","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dce"}],"line":5028,"examples":[{"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"editors":[],"body":"(def my-symbol)\n(var? #'my-symbol)\n=\u003E true\n\n(var? (var my-symbol))\n=\u003E true\n\n(var? (def my-symbol2))\n=\u003E true","created-at":1289214469000,"updated-at":1289214469000,"_id":"542692cac026201cdc326b63"},{"author":{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},"editors":[],"body":"=\u003E *clojure-version*\n{:major 1, :minor 5, :incremental 0, :qualifier \"RC17\"}\n=\u003E var?\n#\u003Ccore$var_QMARK_ clojure.core$var_QMARK_@669251cc\u003E\n=\u003E (var?)\n;ArityException Wrong number of args (0) passed to: core$var-QMARK- clojure.lang.AFn.throwArity (AFn.java:437)\n=\u003E (var? 1)\nfalse\n=\u003E (var? defn)\n;CompilerException java.lang.RuntimeException: Can't take value of a macro: #'clojure.core/defn, compiling:(NO_SOURCE_PATH:1:1) \n=\u003E (var? #'defn)\ntrue\n=\u003E (var? #'defn 1 2 3 4)\n;ArityException Wrong number of args (5) passed to: core$var-QMARK- clojure.lang.AFn.throwArity (AFn.java:437)\n=\u003E (var? (var defn))\ntrue\n=\u003E (var? apply)\nfalse\n=\u003E (var? #'apply)\ntrue\n","created-at":1362015139000,"updated-at":1362015139000,"_id":"542692d5c026201cdc3270b2"}],"notes":null,"arglists":["v"],"doc":"Returns true if v is of type clojure.lang.Var","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/var_q"},{"ns":"clojure.core","name":"method-sig","file":"clojure/core_proxy.clj","type":"function","column":1,"see-alsos":null,"line":20,"examples":null,"notes":null,"arglists":["meth"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core/method-sig"},{"added":"1.0","ns":"clojure.core","name":"unchecked-add-int","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":1205,"examples":null,"notes":null,"arglists":["x y"],"doc":"Returns the sum of x and y, both int.\n Note - uses a primitive operator subject to overflow.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/unchecked-add-int"},{"ns":"clojure.core","name":"unquote-splicing","file":"clojure/core.clj","type":"var","column":1,"see-alsos":[{"created-at":1319195960000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unquote","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d37"}],"line":14,"examples":[{"author":{"login":"huahaiy","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/889685?v=2"},"editors":[],"body":"user=\u003E (let [x `(2 3)] \n `(1 ~x))\n(1 (2 3))\n\nuser=\u003E (let [x `(2 3)] \n `(1 ~@x)) \n(1 2 3)\n","created-at":1305077817000,"updated-at":1305077817000,"_id":"542692c8c026201cdc326a73"},{"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"editors":[],"body":"user=\u003E `(1 2 ~(list 3 4))\n\n(1 2 (3 4))\n\nuser=\u003E `(1 2 ~@(list 3 4))\n\n(1 2 3 4)\n\n; borrowed from StackOverflow: \n; http://stackoverflow.com/questions/4571042/can-someone-explain-clojures-unquote-splice-in-simple-terms","created-at":1319196585000,"updated-at":1319196585000,"_id":"542692d5c026201cdc3270b0"}],"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core/unquote-splicing"},{"added":"1.6","ns":"clojure.core","name":"hash-ordered-coll","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":5239,"examples":null,"notes":null,"arglists":["coll"],"doc":"Returns the hash code, consistent with =, for an external ordered\n collection implementing Iterable.\n See http://clojure.org/data_structures#hash for full algorithms.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/hash-ordered-coll"},{"added":"1.1","ns":"clojure.core","name":"future","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1332389737000,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"future-cancel","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c95"},{"created-at":1336536261000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"shutdown-agents","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c96"},{"created-at":1349259124000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"promise","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c97"},{"created-at":1349558136000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"realized?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c98"},{"created-at":1291441344000,"author":{"login":"pauldoo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5cb916d3c8abc9f45a093209e72489fb?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"delay","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e73"},{"created-at":1291473035000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"future?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e74"},{"created-at":1300437104000,"author":{"login":"ninjudd","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7ced25585a7556e9b9b975c1f9e136e3?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"future-call","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e75"}],"line":7137,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"azkesz","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/467196a4f2498080c9740a81fcbde855?r=PG&default=identicon"},{"login":"azkesz","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/467196a4f2498080c9740a81fcbde855?r=PG&default=identicon"},{"login":"azkesz","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/467196a4f2498080c9740a81fcbde855?r=PG&default=identicon"},{"login":"yayitswei","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/179c73a6ff978b738c014abeb1ead0f9?r=PG&default=identicon"},{"login":"luke","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ac463e1534de6c3a7bbe42365286cd?r=PG&default=identicon"}],"body":";; A future's calculation is started here and it runs in another thread\nuser=\u003E (def f (future (Thread/sleep 10000) (println \"done\") 100))\n#'user/f\n;;if you wait 10 seconds before dereferencing it you'll see \"done\"\n\n;; When you dereference it you will block until the result is available.\nuser=\u003E @f\ndone\n100\n\n;; Dereferencing again will return the already calculated value.\n=\u003E @f\n100\n","created-at":1281077331000,"updated-at":1346904770000,"_id":"542692c9c026201cdc326a74"},{"author":{"login":"OnesimusUnbound","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fa4c391db0d2d1744cc2cd0d787dd3d?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"yayitswei","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/179c73a6ff978b738c014abeb1ead0f9?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":";; save the example in a script (e.g. test-future.clj) then run it in the console\n;;\n;; \u003E clojure test-future.clj\n\n(println \"[Main] calculate the answer to life the universe and everything\")\n\n;; Used Thread/sleep to simulate long running process\n(def what-is-the-answer-to-life (future \n (println \"[Future] started computation\")\n (Thread/sleep 3000) ;; running for 3 seconds\n (println \"[Future] completed computation\")\n 42))\n \n(println \"[Main] created future\")\n\n(Thread/sleep 1000)\n(println \"[Main] do other things while waiting for the answer\")\n(println \"[Main] get the answer\")\n(println \"[Main] the result\" @what-is-the-answer-to-life)\n(shutdown-agents)\n\n\n;; You may get something like this\n;;\n;; [Main] calculate the answer to life the universe and everything\n;; [Future] started computation\n;; [Main] created future\n;; [Main] do other things while waiting for the answer\n;; [Main] get the answer\n;; [Future] completed computation\n;; [Main] the result 42\n\n\n;; Note: If you leave out the call to (shutdown-agents), the program\n;; will on most (all?) OS/JVM combinations \"hang\" for 1 minute before\n;; the process exits. It is waiting for a thread created by the\n;; future call to be shut down. shutdown-agents will shut them down\n;; immediately, or (System/exit \u003Cexit-status\u003E) will exit immediately\n;; without waiting for them to shut down.\n\n;; This wait occurs even if you use futures indirectly through some other Clojure\n;; functions that use them internally, such as pmap or clojure.java.shell/sh\n\n;; http://dev.clojure.org/jira/browse/CLJ-124 is a ticket opened against Clojure,\n;; as this 1-minute wait is not considered desirable behavior.","created-at":1312375403000,"updated-at":1408837058000,"_id":"542692c9c026201cdc326a7b"}],"macro":true,"notes":null,"arglists":["& body"],"doc":"Takes a body of expressions and yields a future object that will\n invoke the body in another thread, and will cache the result and\n return it on all subsequent calls to deref/@. If the computation has\n not yet finished, calls to deref/@ will block, unless the variant of\n deref with timeout is used. See also - realized?.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/future"},{"added":"1.0","ns":"clojure.core","name":"reset-meta!","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":2433,"examples":null,"notes":null,"arglists":["iref metadata-map"],"doc":"Atomically resets the metadata for a namespace/var/ref/agent/atom","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/reset-meta!"},{"added":"1.0","ns":"clojure.core","name":"cycle","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1360759662000,"author":{"login":"rahulpilani","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3c3585fc1c6bf074ed5f268c9ebcb2f?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"lazy-seq","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ea1"}],"line":3002,"examples":[{"author":{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"MrHus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4fa262299223e58030e9062d97224547?r=PG&default=identicon"}],"body":"user=\u003E (take 5 (cycle [\"a\" \"b\"]))\n(\"a\" \"b\" \"a\" \"b\" \"a\")\n\nuser=\u003E (take 10 (cycle (range 0 3)))\n(0 1 2 0 1 2 0 1 2 0)\n\n","created-at":1279160241000,"updated-at":1305843374000,"_id":"542692ccc026201cdc326c30"}],"notes":null,"arglists":["coll"],"doc":"Returns a lazy (infinite!) sequence of repetitions of the items in coll.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/cycle"},{"added":"1.0","ns":"clojure.core","name":"fn","special-form":true,"file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1360339005000,"author":{"login":"ViljamiPeltola","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1535c08820796d57a212a46a6bdd4cca?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"defn","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c77"}],"line":4560,"examples":[{"author":{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},"editors":[{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},{"login":"jumblerg","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f9e06cdf33ea6f2958a8b6430d9fe22?r=PG&default=identicon"},{"login":"jumblerg","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f9e06cdf33ea6f2958a8b6430d9fe22?r=PG&default=identicon"}],"body":";; simple anonymous function passed to (map )\nuser=\u003E (map (fn [x] (* x x)) (range 1 10))\n(1 4 9 16 25 36 49 64 81) \n\n;; anonymous function with a name. not so anonymous now is it?\n;; this is useful in stack traces\n(fn add [a b] (+ a b))\n\n;; anonymous function with two params, the second is destructured\nuser=\u003E (reduce (fn [m [k v]] (assoc m v k)) {} {:b 2 :a 1 :c 3})\n{2 :b, 1 :a, 3 :c} \n\n;; define and instantly call an anonymous function\nuser=\u003E ((fn [a b c] (+ a b c)) 2 4 6)\n12\n\n;; define and instantly call an anonymous variadic function \n;; \"nums\" is a list here\nuser=\u003E ((fn [& nums] (/ (apply + nums) (count nums))) 1 2 3 4)\n5/2 \n\n;; define and instantly call an anonymous mixed function\n;; \"nums\" is a list, while \"int\" is a number\nuser=\u003E ((fn [int & nums] (+ int (/ (apply + nums) (count nums)))) 10 1 2 3 4)\n25/2 \n\n;; define and instantly call an anonymous overloaded function \n;; even though it is quite pointless\nuser=\u003E ((fn ([a] (inc a)) ([a b] (+ a b))) 3)\n4\n\n","created-at":1280346731000,"updated-at":1410072276000,"_id":"542692c7c026201cdc326977"},{"author":{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; the shortcut form for (fn ) is #( )\n;; where parameters are referred by their index with the prefix %\n\n;; the equivalent of \nuser=\u003E ((fn [a b c] (+ a b c)) 2 4 6)\n12\n\n;; is\nuser=\u003E (#(+ %1 %2 %3) 2 4 6)\n12\n","created-at":1284093085000,"updated-at":1285487263000,"_id":"542692c7c026201cdc326983"}],"macro":true,"notes":[{"updated-at":1396626727000,"body":"The signature is wrong. It should be (quoting from [clojure.org][1])\r\n\r\n`(fn name? [params* ] exprs*)`\r\n\r\n`(fn name? ([params* ] exprs*)+)`\r\n\r\n\r\n [1]: http://clojure.org/special_forms#fn","created-at":1396626504000,"author":{"login":"Thumbnail","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/db68e51797a2382e185b42ce6534b7a4?r=PG&default=identicon"},"_id":"542692edf6e94c6970522023"}],"arglists":["& sigs"],"doc":"params =\u003E positional-params*, or positional-params* & rest-param\n positional-param =\u003E binding-form\n rest-param =\u003E binding-form\n binding-form =\u003E name, or destructuring-form\n\n Defines a function.\n\n See https://clojure.org/reference/special_forms#fn for more information","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/fn","forms":["(fn name? [params*] exprs*)","(fn name? ([params*] exprs*) +)"]},{"added":"1.0","ns":"clojure.core","name":"seque","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":5450,"examples":[{"author":{"login":"Chouser","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7a0192050ed6488670acfd3f59405c10?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (let [start (System/nanoTime)\n q (seque\n (iterate\n #(do (Thread/sleep 400) (inc %))\n 0))]\n (println \"sleep five seconds...\")\n (Thread/sleep 5000)\n (doseq [i (take 20 q)]\n (println (int (/ (- (System/nanoTime) start) 1e7))\n \":\" i)))\n\n\n;; The iterate form returns a lazy seq that delays nearly a half-second \n;; before returning each subsequent item. Here seque starts a thread \n;; generating the lazy seq.\n\n;; The body of the let allows the seque thread to get ahead by five seconds\n;; before it begins consuming the seq using doseq. The doseq prints a \n;; timestamp and the value from the seq when it becomes available. The\n;; first 11 or so are available almost instantly, until the consuming \n;; doseq catches up with the producing iterate, at which point the consumer\n;; blocks for 400ms before each item can be printed.\n\n;;sleep five seconds...\n500 : 0\n500 : 1\n500 : 2\n500 : 3\n500 : 4\n500 : 5\n500 : 6\n500 : 7\n500 : 8\n500 : 9\n500 : 10\n500 : 11\n520 : 12\n560 : 13\n600 : 14\n640 : 15\n680 : 16\n720 : 17\n760 : 18\n800 : 19\n\n","created-at":1283038869000,"updated-at":1285494350000,"_id":"542692c9c026201cdc326ad1"}],"notes":null,"arglists":["s","n-or-q s"],"doc":"Creates a queued seq on another (presumably lazy) seq s. The queued\n seq will produce a concrete seq in the background, and can get up to\n n items ahead of the consumer. n-or-q can be an integer n buffer\n size, or an instance of java.util.concurrent BlockingQueue. Note\n that reading from a seque can block if the reader gets ahead of the\n producer.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/seque"},{"added":"1.0","ns":"clojure.core","name":"empty?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1350338539000,"author":{"login":"dansalmo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e33ee460f5f61bc5ba9b598934766215?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"seq","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ba1"}],"line":6324,"examples":[{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[],"body":"\u003Cpre\u003Euser=\u003E (empty? ())\r\ntrue\r\nuser=\u003E (empty? '(1))\r\nfalse\u003C/pre\u003E","created-at":1279073789000,"updated-at":1279073789000,"_id":"542692cac026201cdc326b85"},{"author":{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"dansalmo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e33ee460f5f61bc5ba9b598934766215?r=PG&default=identicon"}],"body":"user=\u003E (every? empty? [\"\" [] () '() {} #{} nil])\ntrue\n\n;example of recommended idiom for testing if not empty\nuser=\u003E (every? seq [\"1\" [1] '(1) {:1 1} #{1}])\ntrue","created-at":1279386965000,"updated-at":1350271972000,"_id":"542692cac026201cdc326b86"},{"author":{"login":"Jacolyte","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1703a0c3ed358b787f4b1bf3b2799472?r=PG&default=identicon"},"editors":[],"body":"\u003Cpre\u003E\r\nuser=\u003E (drop-while empty? [\"\" [] \"foobar\"])\r\n(\"foobar\")\r\n\u003C/pre\u003E","created-at":1280205236000,"updated-at":1280205236000,"_id":"542692cac026201cdc326b89"},{"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (empty? nil)\ntrue","created-at":1401128995000,"updated-at":1401128995000,"_id":"542692d2c026201cdc326f9c"}],"notes":[{"updated-at":1402523411000,"body":"Some explanation of why (seq x) is preferable over (not (empty? x)) would be good. Because it's far less readable. When I come across (not (empty? x)) in some code, I immediately understand the author's intention. Not so much with (seq x).","created-at":1402523411000,"author":{"login":"cap10morgan","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ccd26ba29b49316b38a46f0aa0e96893?r=PG&default=identicon"},"_id":"542692edf6e94c6970522029"},{"updated-at":1405724559000,"body":"I think this is an efficiency thing. If you expand the source you can see that empty? is equivalent to (not (seq coll)) so (not (empty? coll)) would macroexpand to (not (not (seq coll)) ","created-at":1405724559000,"author":{"login":"phreed","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3a0c739cf289be18be932dc3022e6fd3?r=PG&default=identicon"},"_id":"542692edf6e94c697052202d"}],"arglists":["coll"],"doc":"Returns true if coll has no items. To check the emptiness of a seq,\n please use the idiom (seq x) rather than (not (empty? x))","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/empty_q"},{"added":"1.0","ns":"clojure.core","name":"short","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1342917689000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"int","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f21"},{"created-at":1342917692000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"byte","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f22"},{"created-at":1342917699000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"shorts","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f23"},{"created-at":1342917703000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"short-array","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f24"}],"line":3524,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (class (short 1))\njava.lang.Short","created-at":1281948540000,"updated-at":1332952892000,"_id":"542692c7c026201cdc3269a1"}],"notes":null,"arglists":["x"],"doc":"Coerce to short","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/short"},{"added":"1.2","ns":"clojure.core","name":"definterface","file":"clojure/core_deftype.clj","type":"macro","column":1,"see-alsos":null,"line":20,"examples":[{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":";; Part of a definterface from a Clojure program for the n-body problem\n;; at the Computer Language Benchmarks Game web site.\n;; For the rest of the program using it, see:\n;; http://github.com/jafingerhut/clojure-benchmarks/blob/master/nbody/nbody.clj-14.clj\n\n;; Currently Clojure does not permit type hints of arrays, e.g. ^ints as\n;; argument types or return types in a definterface. This may be enhanced\n;; later.\n\n(definterface IBody\n (^String name []) ;; return type String, no arguments\n (^double mass []) ;; return type double\n (^double x [])\n (clone [] \"returns copy of self\") ; return type defaults to ^Object\n ;; 3 arguments of type double. A deftype that implements this interface\n ;; must implement the method p! The definterface must use:\n ;; _BANG_ for ! in Clojure method name\n ;; _PLUS_ for +\n ;; _ for -\n (p_BANG_ [^double x ^double y ^double z] \"set pos.\")\n ;; After name demangling, this must be implemented by Clojure method named v+!\n (v_PLUS__BANG_ [^double vx ^double vy ^double vz] \"add to velocity\"))\n","created-at":1298555484000,"updated-at":1298556086000,"_id":"542692cdc026201cdc326d3c"}],"macro":true,"notes":null,"arglists":["name & sigs"],"doc":"Creates a new Java interface with the given name and method sigs.\n The method return types and parameter types may be specified with type hints,\n defaulting to Object if omitted.\n\n (definterface MyInterface\n (^int method1 [x])\n (^Bar method2 [^Baz b ^Quux q]))","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/definterface"},{"added":"1.10","ns":"clojure.core","name":"add-tap","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":8106,"examples":null,"notes":null,"arglists":["f"],"doc":"adds f, a fn of one argument, to the tap set. This function will be called with anything sent via tap\u003E.\n This function may (briefly) block (e.g. for streams), and will never impede calls to tap\u003E,\n but blocking indefinitely may cause tap values to be dropped.\n Remember f in order to remove-tap","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/add-tap"},{"added":"1.4","ns":"clojure.core","name":"filterv","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":7068,"examples":null,"notes":null,"arglists":["pred coll"],"doc":"Returns a vector of the items in coll for which\n (pred item) returns logical true. pred must be free of side-effects.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/filterv"},{"added":"1.0","ns":"clojure.core","name":"hash","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1369891154000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"get","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521aa5"}],"line":5218,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (hash \"a\")\n97\nuser=\u003E (.hashCode \"a\") ; notice it is the same hash as java.lang.String.hashCode()\n97\nuser=\u003E (hash [1 2 3])\n30817\nuser=\u003E (hash [1 2 3 4])\n955331","created-at":1280319931000,"updated-at":1332952629000,"_id":"542692cbc026201cdc326bc4"}],"notes":null,"arglists":["x"],"doc":"Returns the hash code of its argument. Note this is the hash code\n consistent with =, and thus is different than .hashCode for Integer,\n Short, Byte and Clojure collections.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/hash"},{"added":"1.0","ns":"clojure.core","name":"quot","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1305751242000,"author":{"login":"Kototama","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a54a4dc204925d397ca010b9a332e74d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"rem","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b7e"},{"created-at":1305751245000,"author":{"login":"Kototama","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a54a4dc204925d397ca010b9a332e74d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"mod","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b7f"}],"line":1275,"examples":[{"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":";; (quot m n) is the value of m/n, rounded towards 0 to the nearest integer.\n;; m, n need not be integers.\n\nuser=\u003E (quot 10 3)\n3\n\nuser=\u003E (quot 11 3)\n3\n\nuser=\u003E (quot 12 3)\n4\n\nuser=\u003E (quot -5.9 3)\n-1.0\n\nuser=\u003E (quot 10 -3)\n-3\n\nuser=\u003E (quot 15 0)\nArithmeticException / by zero clojure.lang.Numbers.quotient (Numbers.java:1764)\n","created-at":1279992131000,"updated-at":1331649955000,"_id":"542692cbc026201cdc326bec"},{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"}],"body":";; note that the \"/\" function and the quot function are not equivalent\n\nuser=\u003E (= (/ 4 2) (quot 4 2))\ntrue\n\nuser=\u003E (= (/ 3 2) (quot 3 2))\nfalse\n","created-at":1316301245000,"updated-at":1316301327000,"_id":"542692cbc026201cdc326bf0"}],"notes":null,"arglists":["num div"],"doc":"quot[ient] of dividing numerator by denominator.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/quot"},{"added":"1.0","ns":"clojure.core","name":"ns-aliases","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1374148394000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"alias","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b61"}],"line":4300,"examples":null,"notes":null,"arglists":["ns"],"doc":"Returns a map of the aliases for the namespace.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/ns-aliases"},{"added":"1.0","ns":"clojure.core","name":"read","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1313054766000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"read-string","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f56"},{"created-at":1352963657000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"*read-eval*","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f57"}],"line":3767,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (read)\n( + 1 1 ) ; \u003C= User types this\n(+ 1 1)\nuser=\u003E (eval (read))\n(+ 1 1) ; \u003C= User types this\n2\n","created-at":1286263972000,"updated-at":1286263972000,"_id":"542692c8c026201cdc326a15"},{"author":{"login":"Chris Riddoch","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c908fbef70e8540f700a6b362cf57e9e?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":";; WARNING: You SHOULD NOT use clojure.core/read or\n;; clojure.core/read-string to read data from untrusted sources. They\n;; were designed only for reading Clojure code and data from trusted\n;; sources (e.g. files that you know you wrote yourself, and no one\n;; else has permission to modify them).\n\n;; Instead, either:\n\n;; (1) Use another data serialization format such as JSON, XML,\n;; etc. and a library for reading them that you trust not to have\n;; vulnerabilities, or\n\n;; (2) if you want a serialization format that can be read safely and\n;; looks like Clojure data structures, use edn\n;; (https://github.com/edn-format/edn). For Clojure 1.3 and later,\n;; the tools.reader contrib library provides an edn reader\n;; (http://github.com/clojure/tools.reader). There is also\n;; clojure.edn/read and clojure.edn/read-string provided in Clojure\n;; 1.5.\n\n;; You definitely should not use clojure.core/read or read-string if\n;; *read-eval* has its default value of true, because an attacker\n;; could cause your application to execute arbitrary code while it is\n;; reading. Example:\n\nuser=\u003E (read-string \"#=(clojure.java.shell/sh \\\"echo\\\" \\\"hi\\\")\")\n{:exit 0, :out \"hi\\n\", :err \"\"}\n\n;; It is straightforward to modify the example above into more\n;; destructive ones that remove all of your files, copy them to\n;; someone else's computer over the Internet, install Trojans, etc.\n\n;; Even if you do bind *read-eval* to false first, like so:\n\n(defn read-string-unsafely [s]\n (binding [*read-eval* false]\n (read-string s)))\n\n;; you may hope you are safe reading untrusted data that way, but in\n;; Clojure 1.4 and earlier, an attacker can send data that causes your\n;; system to execute arbitrary Java constructors. Most of these are\n;; benign, but it only takes one to ruin your application's day.\n;; Examples that should scare you:\n\n;; This causes a socket to be opened, as long as the JVM sandboxing\n;; allows it.\n(read-string-unsafely \"#java.net.Socket[\\\"www.google.com\\\" 80]\")\n\n;; This causes precious-file.txt to be created if it doesn't exist, or\n;; if it does exist, its contents will be erased (given appropriate\n;; JVM sandboxing permissions, and underlying OS file permissions).\n(read-string-unsafely \"#java.io.FileWriter[\\\"precious-file.txt\\\"]\")\n\n;; The particular issue of executing arbitrary Java constructors used\n;; in the examples above no longer works in Clojure 1.5 when\n;; *read-eval* is false. Even so, you SHOULD NEVER USE\n;; clojure.core/read or clojure.core/read-string for reading untrusted\n;; data. Use an edn reader or a different data serialization format.\n\n;; Why should I do this, you may ask, if Clojure 1.5 closes the Java\n;; constructor hole? Because clojure.core/read and read-string are\n;; designed to be able to do dangerous things, and they are not\n;; documented nor promised to be safe from unwanted side effects. If\n;; you use them for reading untrusted data, and a dangerous side\n;; effect is found in the future, you will be told that you are using\n;; the wrong tool for the job. clojure.edn/read and read-string, and\n;; the tools.reader.edn library, are documented to be safe from\n;; unwanted side effects, and if any bug is found in this area it\n;; should get quick attention and corrected.\n\n;; If you understand all of the above, and want to use read or\n;; read-string to read data from a _trusted_ source, continue on\n;; below.\n\n;; read wants its reader arg (or *in*) to be a java.io.PushbackReader.\n;; with-open closes r after the with-open body is done. *read-eval*\n;; specifies whether to allow #=() forms when reading, and evaluate\n;; them as a side effect while reading.\n\n(defn read-from-file-with-trusted-contents [filename]\n (with-open [r (java.io.PushbackReader.\n (clojure.java.io/reader filename))]\n (binding [*read-eval* false]\n (read r))))\n\nuser=\u003E (spit \"testfile.txt\" \"{:a 1 :b 2 :c 3}\")\nnil\nuser=\u003E (read-from-file-with-trusted-contents \"testfile.txt\")\n{:a 1, :b 2, :c 3}\n","created-at":1325831086000,"updated-at":1364783739000,"_id":"542692d5c026201cdc327056"}],"notes":[{"updated-at":1286264042000,"body":"This function is for reading clojure objects not a general input function.","created-at":1286264042000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521f98"}],"arglists":["","stream","stream eof-error? eof-value","stream eof-error? eof-value recursive?","opts stream"],"doc":"Reads the next object from stream, which must be an instance of\n java.io.PushbackReader or some derivee. stream defaults to the\n current value of *in*.\n\n Opts is a persistent map with valid keys:\n :read-cond - :allow to process reader conditionals, or\n :preserve to keep all branches\n :features - persistent set of feature keywords for reader conditionals\n :eof - on eof, return value unless :eofthrow, then throw.\n if not specified, will throw\n\n Note that read can execute code (controlled by *read-eval*),\n and as such should be used only with trusted sources.\n\n For data structure interop use clojure.edn/read","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/read"},{"added":"1.3","ns":"clojure.core","name":"unchecked-double","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":3578,"examples":null,"notes":null,"arglists":["x"],"doc":"Coerce to double. Subject to rounding.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/unchecked-double"},{"added":"1.0","ns":"clojure.core","name":"key","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1318592856000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"keys","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f60"}],"line":1582,"examples":[{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (map key {:a 1 :b 2})\n(:a :b)\n","created-at":1280777907000,"updated-at":1285495486000,"_id":"542692cac026201cdc326b66"}],"notes":null,"arglists":["e"],"doc":"Returns the key of the map entry.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/key"},{"added":"1.0","ns":"clojure.core","name":"longs","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1342917385000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"long-array","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f53"}],"line":5436,"examples":null,"notes":null,"arglists":["xs"],"doc":"Casts to long[]","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/longs"},{"added":"1.0","ns":"clojure.core","name":"not=","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1412341716329,"author":{"login":"verma","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/242524?v=2"},"to-var":{"ns":"clojure.core","name":"=","library-url":"https://github.com/clojure/clojure"},"_id":"542e9fd4e4b05f4d257a29a0"},{"created-at":1412341728824,"author":{"login":"verma","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/242524?v=2"},"to-var":{"ns":"clojure.core","name":"not","library-url":"https://github.com/clojure/clojure"},"_id":"542e9fe0e4b05f4d257a29a1"}],"line":821,"examples":[{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (not= 1 1)\nfalse\n\nuser=\u003E (not= 1 2)\ntrue\n\nuser=\u003E (not= true true)\nfalse\n\nuser=\u003E (not= true false)\ntrue\n\nuser=\u003E (not= true true true true)\nfalse\n\nuser=\u003E (not= true true false true)\ntrue\n","created-at":1280778104000,"updated-at":1285495471000,"_id":"542692c6c026201cdc32690f"}],"notes":null,"tag":"java.lang.Boolean","arglists":["x","x y","x y & more"],"doc":"Same as (not (= obj1 obj2))","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/not="},{"added":"1.0","ns":"clojure.core","name":"string?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":162,"examples":[{"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (string? \\a)\nfalse\n\nuser=\u003E (string? \"abc\")\ntrue\n\nuser=\u003E (string? 1)\nfalse\n\nuser=\u003E (string? [\"a\" \"b\" \"c\"])\nfalse","created-at":1280546643000,"updated-at":1332950938000,"_id":"542692c7c026201cdc326945"}],"notes":null,"arglists":["x"],"doc":"Return true if x is a String","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/string_q"},{"added":"1.9","ns":"clojure.core","name":"uri?","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":8083,"examples":null,"notes":null,"arglists":["x"],"doc":"Return true if x is a java.net.URI","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/uri_q"},{"added":"1.0","ns":"clojure.core","name":"aset-double","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1349125867000,"author":{"login":"Ljos","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/45b996a79abca465acaf6c0f10b0437?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"double-array","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521abb"}],"line":3992,"examples":[{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[],"body":";; create an array of 10 doubles and set one of the elements to 3.1415\n\nuser=\u003E (def ds (double-array 10))\n#'user/ds\nuser=\u003E (vec ds)\n[0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0]\nuser=\u003E (aset-double ds 3 3.1415)\n3.1415\nuser=\u003E (vec ds)\n[0.0 0.0 0.0 3.1415 0.0 0.0 0.0 0.0 0.0 0.0]\nuser=\u003E","created-at":1313914664000,"updated-at":1313914664000,"_id":"542692ccc026201cdc326c88"}],"notes":null,"arglists":["array idx val","array idx idx2 & idxv"],"doc":"Sets the value at the index/indices. Works on arrays of double. Returns val.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/aset-double"},{"added":"1.0","ns":"clojure.core","name":"unchecked-multiply-int","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":1233,"examples":null,"notes":null,"arglists":["x y"],"doc":"Returns the product of x and y, both int.\n Note - uses a primitive operator subject to overflow.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/unchecked-multiply-int"},{"ns":"clojure.core","name":"chunk-rest","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":706,"examples":null,"notes":null,"tag":"clojure.lang.ISeq","arglists":["s"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core/chunk-rest"},{"added":"1.0","ns":"clojure.core","name":"pcalls","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1299212798000,"author":{"login":"weakreference","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/86146f8bd5207b97701c0f16f0017334?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"pvalues","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521be6"},{"created-at":1336537809000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"future","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521be7"}],"line":7184,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (pcalls function-1 function-2 ...)\n\n(result1 result2 ...)","created-at":1281093054000,"updated-at":1332951378000,"_id":"542692cdc026201cdc326ccf"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[],"body":";; pcalls is implemented using Clojure futures. See examples for 'future'\n;; for discussion of an undesirable 1-minute wait that can occur before\n;; your standalone Clojure program exits if you do not use shutdown-agents.","created-at":1336537804000,"updated-at":1336537804000,"_id":"542692d4c026201cdc32702e"}],"notes":null,"arglists":["& fns"],"doc":"Executes the no-arg fns in parallel, returning a lazy sequence of\n their values","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/pcalls"},{"ns":"clojure.core","name":"*allow-unresolved-vars*","type":"var","see-alsos":null,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core/*allow-unresolved-vars*"},{"added":"1.2","ns":"clojure.core","name":"remove-all-methods","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1337585106000,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"remove-method","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c88"},{"created-at":1341270438000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"prefers","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c89"},{"created-at":1341270443000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"methods","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c8a"},{"created-at":1341270446000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"get-method","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c8b"},{"created-at":1341270452000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"defmulti","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c8c"},{"created-at":1341270455000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"defmethod","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c8d"}],"line":1806,"examples":[{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[],"body":";; example showing use of multi-methods before and after remove-all-methods\n;; after removing all the methods, both circle and line tos functions throw\n;; exceptions\n\nuser=\u003E (defmulti tos :Ob)\nnil\nuser=\u003E (defn line [p1 p2] {:Ob :line :p1 p1 :p2 p2})\n#'user/line\nuser=\u003E (defn circle [cent rad] {:Ob :circle :cent cent :rad rad})\n#'user/circle\nuser=\u003E (defmethod tos :line [l] (str \"Line:\" (l :p1) (l :p2)))\n#\u003CMultiFn clojure.lang.MultiFn@73aecc3a\u003E\nuser=\u003E (defmethod tos :circle [c] (str \"Circle:\" (c :cent) (c :rad)))\n#\u003CMultiFn clojure.lang.MultiFn@73aecc3a\u003E\nuser=\u003E (println (tos (circle [2 3] 3.3)))\nCircle:[2 3]3.3\nnil\nuser=\u003E (println (tos (line [1 1][0 0])))\nLine:[1 1][0 0]\nnil\nuser=\u003E (remove-all-methods tos)\n#\u003CMultiFn clojure.lang.MultiFn@73aecc3a\u003E\nuser=\u003E (println (tos (circle [2 3] 3.3)))\njava.lang.IllegalArgumentException: No method in multimethod 'tos' for dispatch\nvalue: :circle (NO_SOURCE_FILE:0)\nuser=\u003E (println (tos (line [1 1][0 0])))\njava.lang.IllegalArgumentException: No method in multimethod 'tos' for dispatch\nvalue: :line (NO_SOURCE_FILE:0)\nuser=\u003E","created-at":1313920017000,"updated-at":1313920017000,"_id":"542692ccc026201cdc326c6b"}],"notes":null,"arglists":["multifn"],"doc":"Removes all of the methods of multimethod.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/remove-all-methods"},{"added":"1.0","ns":"clojure.core","name":"ns-resolve","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1289661007000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"resolve","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b3d"}],"line":4385,"examples":[{"author":{"login":"jamesqiu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bc1268deaa7f2e78fe2b5ea76e6481d8?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (defn f [n] (* n n n))\n#'user/f\nuser=\u003E ((ns-resolve *ns* (symbol \"f\")) 10)\n1000","created-at":1328007015000,"updated-at":1328007015000,"_id":"542692d4c026201cdc32701e"},{"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"editors":[],"body":";; See also http://clojure.org/namespaces for information on namespaces in Clojure and how to inspect and manipulate them","created-at":1348479408000,"updated-at":1348479408000,"_id":"542692d4c026201cdc32701f"}],"notes":[{"updated-at":1332557686000,"body":"The appropriate value for the \u003Ccode\u003Eenv\u003C/code\u003E arg is what you get from the implicit \u003Ccode\u003E&env\u003C/code\u003E arg available to a macro.","created-at":1332557686000,"author":{"login":"steveminer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d28543d134185d12d4006a74738d233e?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fdb"}],"arglists":["ns sym","ns env sym"],"doc":"Returns the var or Class to which a symbol will be resolved in the\n namespace (unless found in the environment), else nil. Note that\n if the symbol is fully qualified, the var/Class to which it resolves\n need not be present in the namespace.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/ns-resolve"},{"added":"1.5","ns":"clojure.core","name":"as-\u003E","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1411997691800,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"-\u003E","library-url":"https://github.com/clojure/clojure"},"_id":"54295ffbe4b09282a148f1ed"},{"created-at":1411997716841,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"-\u003E\u003E","library-url":"https://github.com/clojure/clojure"},"_id":"54296014e4b09282a148f1ee"},{"created-at":1411997732554,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"cond-\u003E","library-url":"https://github.com/clojure/clojure"},"_id":"54296024e4b09282a148f1ef"},{"created-at":1411997750265,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"cond-\u003E\u003E","library-url":"https://github.com/clojure/clojure"},"_id":"54296036e4b09282a148f1f1"},{"created-at":1411997759234,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"some-\u003E","library-url":"https://github.com/clojure/clojure"},"_id":"5429603fe4b09282a148f1f2"},{"created-at":1411997771032,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"some-\u003E\u003E","library-url":"https://github.com/clojure/clojure"},"_id":"5429604be4b09282a148f1f3"}],"line":7764,"examples":[{"body":"(def owners [{:owner \"Jimmy\"\n :pets (ref [{:name \"Rex\"\n :type :dog}\n {:name \"Sniffles\"\n :type :hamster}])} \n {:owner \"Jacky\" \n :pets (ref [{:name \"Spot\" \n :type :mink}\n {:name \"Puff\" \n :type :magic-dragon}])}])\n\n;; This example is contrived as there are other more \n;; terse ways of expressing the idea. It demonstrates\n;; several of the ways to extract items from a collection.\n;; Notice how the collection can be used in function or \n;; parameter position.\n(as-\u003E owners $ (nth $ 0) (:pets $) (deref $) ($ 1) ($ :type))\n;;=\u003E :hamster","author":{"login":"phreed","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/211644?v=2"},"created-at":1412263021928,"updated-at":1412263021928,"_id":"542d6c6de4b05f4d257a298b"}],"macro":true,"notes":null,"arglists":["expr name & forms"],"doc":"Binds name to expr, evaluates the first form in the lexical context\n of that binding, then binds name to that result, repeating for each\n successive form, returning the result of the last form.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/as-\u003E"},{"added":"1.0","ns":"clojure.core","name":"aset-boolean","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":3982,"examples":[{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[],"body":";; create an array of 10 booleans and set one value to true\n;; using aset-boolean\n\nuser=\u003E (def bs (boolean-array 10))\n#'user/bs\nuser=\u003E (vec bs)\n[false false false false false false false false false false]\nuser=\u003E (aset-boolean bs 2 true)\ntrue\nuser=\u003E (vec bs)\n[false false true false false false false false false false]\nuser=\u003E","created-at":1313914167000,"updated-at":1313914167000,"_id":"542692ccc026201cdc326c67"}],"notes":null,"arglists":["array idx val","array idx idx2 & idxv"],"doc":"Sets the value at the index/indices. Works on arrays of boolean. Returns val.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/aset-boolean"},{"added":"1.0","ns":"clojure.core","name":"trampoline","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1289618007000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"loop","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521df6"},{"created-at":1289618015000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"recur","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521df7"}],"line":6370,"examples":[{"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user\u003E (defn foo [x]\n (if (\u003C x 0)\n (println \"done\")\n #(foo (do (println :x x) (dec x)))))\n#'user/foo\n\n;; trampoline will keep calling the function for as long as \"foo\" returns a\n;; function.\n\nuser\u003E (trampoline foo 10)\n:x 10\n:x 9\n:x 8\n:x 7\n:x 6\n:x 5\n:x 4\n:x 3\n:x 2\n:x 1\n:x 0\ndone\nnil","created-at":1293675043000,"updated-at":1411839378527,"_id":"542692cfc026201cdc326e3b"}],"notes":[{"updated-at":1291742621000,"body":"A tutorial on how to use trampoline is available here: \r\n\r\nhttp://pramode.net/clojure/2010/05/08/clojure-trampoline/\r\n\r\nand here:\r\n\r\nhttp://jakemccrary.com/blog/2010/12/06/trampolining-through-mutual-recursion.html","created-at":1286956413000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521f9a"}],"arglists":["f","f & args"],"doc":"trampoline can be used to convert algorithms requiring mutual\n recursion without stack consumption. Calls f with supplied args, if\n any. If f returns a fn, calls that fn with no arguments, and\n continues to repeat, until the return value is not a fn, then\n returns that non-fn value. Note that if you want to return a fn as a\n final value, you must wrap it in some data structure and unpack it\n after trampoline returns.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/trampoline"},{"added":"1.9","ns":"clojure.core","name":"double?","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":1440,"examples":null,"notes":null,"arglists":["x"],"doc":"Return true if x is a Double","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/double_q"},{"added":"1.0","ns":"clojure.core","name":"when-not","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1302596050000,"author":{"login":"Havvy","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e799a79441c7543be48562403411cd13?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"when","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d1b"},{"created-at":1323280013000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"when-let","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d1c"},{"created-at":1334293346000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"if","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d1d"}],"line":501,"examples":[{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (map\n #(when-not (= %2 %3) [%1 %2 %3])\n (iterate inc 0)\n [:a :b :c]\n [:a :a :a])\n\n(nil [1 :b :a] [2 :c :a])\n","created-at":1280776138000,"updated-at":1285495812000,"_id":"542692c8c026201cdc326a4a"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[],"body":";; See examples for \"if\" explaining Clojure's idea of logical true\n;; and logical false.","created-at":1334293370000,"updated-at":1334293370000,"_id":"542692d6c026201cdc3270b7"}],"macro":true,"notes":null,"arglists":["test & body"],"doc":"Evaluates test. If logical false, evaluates body in an implicit do.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/when-not"},{"added":"1.0","ns":"clojure.core","name":"*1","file":"clojure/core.clj","type":"var","column":1,"see-alsos":[{"created-at":1302912238000,"author":{"login":"hoornet","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5834f829a9def19620d4014c46642172?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"*2","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b4a"},{"created-at":1302912243000,"author":{"login":"hoornet","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5834f829a9def19620d4014c46642172?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"*3","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b4b"}],"dynamic":true,"line":6345,"examples":[{"author":{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E \"Hello!\"\n\"Hello!\"\n\nuser=\u003E *1\n\"Hello!\"\n","created-at":1279047952000,"updated-at":1285502142000,"_id":"542692cac026201cdc326b1a"}],"notes":null,"arglists":[],"doc":"bound in a repl thread to the most recent value printed","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/*1"},{"added":"1.0","ns":"clojure.core","name":"vec","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1291951288000,"author":{"login":"alimoeeny","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e8dd06976ead4082d2181f3807117e1?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"vector","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521adb"},{"created-at":1291951295000,"author":{"login":"alimoeeny","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e8dd06976ead4082d2181f3807117e1?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"vector?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521adc"},{"created-at":1291951303000,"author":{"login":"alimoeeny","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e8dd06976ead4082d2181f3807117e1?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"vector-of","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521add"}],"line":369,"examples":[{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[{"login":"Dmitry Kakurin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/85b70be5da433a6adf5112e7140848da?r=PG&default=identicon"}],"body":"user=\u003E (vec '(1 2 3))\n[1 2 3]\n\nuser=\u003E (vec [1 2 3])\n[1 2 3]\n\nuser=\u003E (vec '())\n[]\n\nuser=\u003E (vec nil)\n[]","created-at":1279075384000,"updated-at":1306817951000,"_id":"542692c9c026201cdc326a97"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[],"body":";; Warning. If the arg is a Java array, then the returned vector will alias it,\n;; and modifying the array will thus modify the vector. To avoid this, do\n;; not modify the array after the vec call. One way to guarantee this is to\n;; make a copy of the array, call vec on the new array, and then lose all\n;; references to the copy so it cannot be accessed in any way.\n\nuser=\u003E (def a (to-array (repeat 4 0)))\n#'user/a\nuser=\u003E (seq a)\n(0 0 0 0)\nuser=\u003E (def v (vec a))\n#'user/v\nuser=\u003E v\n[0 0 0 0]\n\n;; Now change a, and v changes, too, since they share state.\nuser=\u003E (aset a 2 -5)\n-5\nuser=\u003E v\n[0 0 -5 0]\n\n;; One way to avoid this\nuser=\u003E (def v (vec (aclone a)))\n#'user/v\nuser=\u003E v\n[0 0 -5 0]\nuser=\u003E (aset a 2 -20)\n-20\nuser=\u003E v\n[0 0 -5 0]\n","created-at":1334463665000,"updated-at":1334463665000,"_id":"542692d5c026201cdc3270b4"}],"notes":null,"arglists":["coll"],"doc":"Creates a new vector containing the contents of coll. Java arrays\n will be aliased and should not be modified.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/vec"},{"added":"1.0","ns":"clojure.core","name":"*print-meta*","type":"var","see-alsos":[{"created-at":1351128584000,"author":{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"pr","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e5d"}],"examples":[{"author":{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},"editors":[{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"}],"body":"user=\u003E (binding [*print-meta* true] \n (pr (var defmacro)) )\n;;^{:macro true, :ns #\u003CNamespace clojure.core\u003E, :name defmacro, :arglists ^{:line 424, :column 15} ([name doc-string? attr-map? [params*] body] [name doc-string? attr-map? ^{:line 425, :column 46} ([params*] body) + attr-map?]), :column 1, :added \"1.0\", :doc \"Like defn, but the resulting function name is declared as a\\n macro and will be used as a macro by the compiler when it is\\n called.\", :line 419, :file \"clojure/core.clj\"} #'clojure.core/defmacro\nnil\n","created-at":1351126556000,"updated-at":1351126806000,"_id":"542692d1c026201cdc326f37"}],"notes":[{"updated-at":1351128651000,"body":"\"printing an object\" means via **pr** not print or println","created-at":1351128651000,"author":{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},"_id":"542692edf6e94c6970521ff1"}],"arglists":[],"doc":"If set to logical true, when printing an object, its metadata will also\n be printed in a form that can be read back by the reader.\n\n Defaults to false.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/*print-meta*"},{"added":"1.0","ns":"clojure.core","name":"when","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1323279976000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"when-not","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521aed"},{"created-at":1323279997000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"when-let","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521aee"},{"created-at":1334293253000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"if","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521aef"}],"line":495,"examples":[{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[{"login":"philos99","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1de5617efb013ca7c9cf8e5646818ffa?r=PG&default=identicon"},{"login":"frangio","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/646001f0ba2b7df47a16c0a1d5b62225?r=PG&default=identicon"}],"body":"user=\u003E (when (= 1 1) true)\ntrue\n\nuser=\u003E (when (not= 1 1) true)\nnil","created-at":1279071998000,"updated-at":1325845615000,"_id":"542692cec026201cdc326df2"},{"author":{"login":"OnesimusUnbound","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fa4c391db0d2d1744cc2cd0d787dd3d?r=PG&default=identicon"},"editors":[{"login":"philos99","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1de5617efb013ca7c9cf8e5646818ffa?r=PG&default=identicon"},{"login":"ElieLabeca","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/724e1112a2be4d5af767c0cf152d087e?r=PG&default=identicon"}],"body":"user=\u003E (def has-value (when true\n (println \"Hello World\")\n \"Returned Value\"))\nHello World\n#'user/has-value\n\nuser=\u003E has-value\n\"Returned Value\"\n\n","created-at":1311798084000,"updated-at":1331756178000,"_id":"542692cec026201cdc326df5"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[],"body":";; See examples for \"if\" explaining Clojure's idea of logical true\n;; and logical false.","created-at":1334293296000,"updated-at":1334293296000,"_id":"542692d6c026201cdc3270b5"}],"macro":true,"notes":null,"arglists":["test & body"],"doc":"Evaluates test. If logical true, evaluates body in an implicit do.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/when"},{"added":"1.0","ns":"clojure.core","name":"int","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1333595304000,"author":{"login":"Ljos","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/45b996a79abca465acaf6c0f10b0437?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"char","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d49"},{"created-at":1342917185000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"long","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d4a"},{"created-at":1342917243000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"integer?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d4b"},{"created-at":1342917294000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ints","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d4c"},{"created-at":1342917326000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"int-array","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d4d"},{"created-at":1342917681000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"short","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d4e"}],"line":884,"examples":[{"author":{"login":"Jacolyte","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1703a0c3ed358b787f4b1bf3b2799472?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"Dmitry Kakurin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/85b70be5da433a6adf5112e7140848da?r=PG&default=identicon"},{"login":"Dmitry Kakurin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/85b70be5da433a6adf5112e7140848da?r=PG&default=identicon"},{"login":"Ljos","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/45b996a79abca465acaf6c0f10b0437?r=PG&default=identicon"}],"body":"user=\u003E (int 1)\r\n1\r\n\r\nuser=\u003E (int 1M)\r\n1\r\n\r\nuser=\u003E (int 1.2)\r\n1\r\n\r\nuser=\u003E (int \\1)\r\n49\r\n\r\nuser=\u003E (int \\a)\r\n97\r\n\r\nuser=\u003E (int \"1\")\r\njava.lang.ClassCastException: ...\r\n","created-at":1280208450000,"updated-at":1333595282000,"_id":"542692cec026201cdc326d78"}],"notes":null,"arglists":["x"],"doc":"Coerce to int","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/int"},{"added":"1.8","ns":"clojure.core","name":"map-entry?","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":1492,"examples":null,"notes":null,"arglists":["x"],"doc":"Return true if x is a map entry","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/map-entry_q"},{"added":"1.0","ns":"clojure.core","name":"ns-refers","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1288055172000,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.core","name":"ns-map","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521a82"}],"line":4280,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[],"body":"user\u003E (ns-refers 'clojure.main)\n{sorted-map #'clojure.core/sorted-map, read-line #'clojure.core/read-line, re-pattern #'clojure.core/re-pattern, keyword? #'clojure.core/keyword?, val #'clojure.core/val, chunked-seq? #'clojure.core/chunked-seq?, *compile-path* #'clojure.core/*compile-path*, ...chop...}","created-at":1288075058000,"updated-at":1288075058000,"_id":"542692c9c026201cdc326af9"}],"notes":null,"arglists":["ns"],"doc":"Returns a map of the refer mappings for the namespace.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/ns-refers"},{"added":"1.0","ns":"clojure.core","name":"rand","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1292321223000,"author":{"login":"alimoeeny","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e8dd06976ead4082d2181f3807117e1?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"rand-int","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f6a"},{"created-at":1311342603000,"author":{"login":"Havvy","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e799a79441c7543be48562403411cd13?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"rand-nth","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f6b"}],"line":4964,"examples":[{"author":{"login":"devijvers","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/81018e4231ac1ce8b7a9e6d377092656?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; Test `rand` never returns `n`:\nuser=\u003E (some (partial \u003C= 10) (take 100000 (repeatedly (fn [] (int (rand 10))))))\nnil\n","created-at":1279658909000,"updated-at":1285497610000,"_id":"542692c8c026201cdc326a0f"},{"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"editors":[],"body":"user=\u003E (rand)\n0.17469201779243182\n\nuser=\u003E (rand 100)\n49.542391492950834","created-at":1286329327000,"updated-at":1286329327000,"_id":"542692c8c026201cdc326a11"}],"notes":null,"arglists":["","n"],"doc":"Returns a random floating point number between 0 (inclusive) and\n n (default 1) (exclusive).","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/rand"},{"added":"1.0","ns":"clojure.core","name":"second","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1295238626000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"first","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b2a"},{"created-at":1303125643000,"author":{"login":"Havvy","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e799a79441c7543be48562403411cd13?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"nth","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b2b"},{"created-at":1374512098000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"fnext","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b2c"},{"created-at":1374512133000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"next","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b2d"}],"line":93,"examples":[{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[{"login":"MrHus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4fa262299223e58030e9062d97224547?r=PG&default=identicon"},{"login":"MrHus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4fa262299223e58030e9062d97224547?r=PG&default=identicon"}],"body":"user=\u003E (second '(:alpha :bravo :charlie))\n:bravo\n\nuser=\u003E (second [1 2 3])\n2\n\nuser=\u003E (second {:a 1 :b 2 :c 3})\n[:b 2]\n\nuser=\u003E (second #{1 2 3})\n2\n","created-at":1279071308000,"updated-at":1305843566000,"_id":"542692c7c026201cdc326949"}],"notes":null,"arglists":["x"],"doc":"Same as (first (next x))","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/second"},{"added":"1.2","ns":"clojure.core","name":"vector-of","file":"clojure/gvec.clj","type":"function","column":1,"see-alsos":[{"created-at":1291951396000,"author":{"login":"alimoeeny","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e8dd06976ead4082d2181f3807117e1?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"vec","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c44"},{"created-at":1291951401000,"author":{"login":"alimoeeny","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e8dd06976ead4082d2181f3807117e1?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"vector","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c45"},{"created-at":1291951406000,"author":{"login":"alimoeeny","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e8dd06976ead4082d2181f3807117e1?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"vector?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c46"}],"line":523,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[],"body":"\u003Cpre\u003E\r\nuser=\u003E (conj (vector-of :int) 1 2 3)\r\n[1 2 3] ; \u003C-- note, these are unboxes internally\r\n\r\nuser=\u003E (type (conj (vector-of :int) 1 2 3))\r\nclojure.core.Vec\r\n\u003C/pre\u003E","created-at":1284711309000,"updated-at":1284711309000,"_id":"542692c6c026201cdc3268d1"}],"notes":null,"arglists":["t","t & elements"],"doc":"Creates a new vector of a single primitive type t, where t is one\n of :int :long :float :double :byte :short :char or :boolean. The\n resulting vector complies with the interface of vectors in general,\n but stores the values unboxed internally.\n\n Optionally takes one or more elements to populate the vector.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/vector-of"},{"ns":"clojure.core","name":"hash-combine","file":"clojure/core_deftype.clj","type":"function","column":1,"see-alsos":null,"line":128,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; Calculates the hashes for x and y and produces a new hash that represents\n;; the combination of the two.\n\nuser=\u003E (hash-combine 100 \"a\")\n-1640524969\n","created-at":1280320404000,"updated-at":1285496804000,"_id":"542692cdc026201cdc326d1e"}],"notes":null,"arglists":["x y"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core/hash-combine"},{"added":"1.0","ns":"clojure.core","name":"\u003E","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1291975136000,"author":{"login":"alimoeeny","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e8dd06976ead4082d2181f3807117e1?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"=","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c4f"},{"created-at":1291975141000,"author":{"login":"alimoeeny","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e8dd06976ead4082d2181f3807117e1?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"not=","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c50"},{"created-at":1291975147000,"author":{"login":"alimoeeny","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e8dd06976ead4082d2181f3807117e1?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"\u003C","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c51"}],"line":1072,"examples":[{"author":{"login":"mattdw","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ee24aacb65359196b0a1bad050f9a62f?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"Iceland_jack","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c889e0a95a3bb07f90ab28ad442f1127?r=PG&default=identicon"}],"body":"user=\u003E (\u003E 1 2)\nfalse\nuser=\u003E (\u003E 2 1)\ntrue\nuser=\u003E (\u003E 2 2)\nfalse\nuser=\u003E (\u003E 6 5 4 3 2)\ntrue\nuser=\u003E (sort \u003E (vals {:foo 5, :bar 2, :baz 10}))\n(10 5 2)","created-at":1280322039000,"updated-at":1340813399000,"_id":"542692ccc026201cdc326c96"}],"notes":null,"arglists":["x","x y","x y & more"],"doc":"Returns non-nil if nums are in monotonically decreasing order,\n otherwise false.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/\u003E"},{"added":"1.0","ns":"clojure.core","name":"replace","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1281451180000,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.walk","name":"prewalk-replace","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dc2"},{"created-at":1281451198000,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.walk","name":"postwalk-replace","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dc3"},{"created-at":1385849073000,"author":{"login":"Alexey Tarasevich","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/43e0398b89022d32b43de4c968069312?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"map","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dc4"}],"line":5111,"examples":[{"author":{"login":"jneira","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2c8ecc24181d171df85a26458b9cd5f?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"Iceland_jack","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c889e0a95a3bb07f90ab28ad442f1127?r=PG&default=identicon"},{"login":"Iceland_jack","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c889e0a95a3bb07f90ab28ad442f1127?r=PG&default=identicon"}],"body":"user=\u003E (replace [:zeroth :first :second :third :fourth] [0 2 4 0])\n[:zeroth :second :fourth :zeroth]\n\nuser=\u003E (replace [10 9 8 7 6] [0 2 4])\n[10 8 6]","created-at":1280289240000,"updated-at":1338968515000,"_id":"542692cbc026201cdc326bca"},{"author":{"login":"huahaiy","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/889685?v=2"},"editors":[{"login":"Iceland_jack","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c889e0a95a3bb07f90ab28ad442f1127?r=PG&default=identicon"}],"body":"user=\u003E (replace '{0 ZERO, 1 ONE, 2 TWO} '(This is the code — 0 1 2 0))\n(This is the code — ZERO ONE TWO ZERO)\n\nuser=\u003E (replace {2 :two, 4 :four} [4 2 3 4 5 6 2])\n[:four :two 3 :four 5 6 :two]\n","created-at":1305078367000,"updated-at":1338968551000,"_id":"542692cbc026201cdc326bce"},{"author":{"login":"Alexey Tarasevich","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/43e0398b89022d32b43de4c968069312?r=PG&default=identicon"},"editors":[],"body":"; Behaves somewhat similar to map, but notice the differences\nuser=\u003E (map [:zeroth :first :second :third :fourth] [0 2 4 0])\n(:zeroth :second :fourth :zeroth)\n\n; 1. replace returns a vector, while map returns a seq\n; 2. replace keeps unmatched values, while map replace with nil\nuser=\u003E (map {} [0])\n(nil)\nuser=\u003E (map [] [0])\nIndexOutOfBoundsException clojure.lang.PersistentVector.arrayFor (PersistentVector.java:107)\n","created-at":1385849488000,"updated-at":1385849488000,"_id":"542692d5c026201cdc327071"}],"notes":[{"updated-at":1280289719000,"body":"The behaviour for vectors was a little strange for me. I'd say replace \"selects\" from \"smap\" the indexes which are in \"coll\"","created-at":1280289719000,"author":{"login":"jneira","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2c8ecc24181d171df85a26458b9cd5f?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521f92"}],"arglists":["smap","smap coll"],"doc":"Given a map of replacement pairs and a vector/collection, returns a\n vector/seq with any elements = a key in smap replaced with the\n corresponding val in smap. Returns a transducer when no collection\n is provided.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/replace"},{"added":"1.9","ns":"clojure.core","name":"int?","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":1414,"examples":null,"notes":null,"arglists":["x"],"doc":"Return true if x is a fixed precision integer","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/int_q"},{"added":"1.0","ns":"clojure.core","name":"associative?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":6300,"examples":[{"author":{"login":"Clinton","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e460563f35b0b25d8671d6ef83f54ce?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (associative? [1 2 3]) ; vector\ntrue\nuser=\u003E (associative? '(1 2 3)) ; list\nfalse\nuser=\u003E (associative? {:a 1 :b 2}) ; map\ntrue\nuser=\u003E (associative? #{:a :b :c}) ; set\nfalse\nuser=\u003E (associative? \"fred\") ; string\nfalse\n","created-at":1327061297000,"updated-at":1327061297000,"_id":"542692d2c026201cdc326f4d"}],"notes":null,"arglists":["coll"],"doc":"Returns true if coll implements Associative","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/associative_q"},{"added":"1.3","ns":"clojure.core","name":"unchecked-int","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":3560,"examples":null,"notes":null,"arglists":["x"],"doc":"Coerce to int. Subject to rounding or truncation.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/unchecked-int"},{"added":"1.2","ns":"clojure.core","name":"set-error-handler!","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1287220602000,"author":{"login":"hugoduncan","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/80fa2a15219b987664e4d6f5c78b4c27?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"agent","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c1e"},{"created-at":1287220615000,"author":{"login":"hugoduncan","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/80fa2a15219b987664e4d6f5c78b4c27?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"agent-error","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c1f"},{"created-at":1329375224000,"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"restart-agent","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c20"}],"line":2211,"examples":[{"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"editors":[{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"}],"body":"(def bond (agent 7))\n\n(defn err-handler-fn [ag ex]\n (println \"evil error occured: \" ex \" and we still have value \" @ag))\n\n(set-error-handler! bond err-handler-fn)\n\n;;division by zero:\n\n(send bond (fn [x] (/ x 0)))\n=\u003Eevil error occured: #\u003CArithmeticException java.lang.ArithmeticException: \n=\u003EDivide by zero\u003E and we still have value 7\n\n(send bond inc)\n=\u003EFAILURE ;;Agent is failed, needs restart, but keeps the last OK value\n\n@bond\n=\u003E7\n\n(restart-agent bond 7) ;; or replace 7 with @ag\n\n(send bond inc)\n=\u003E#\u003CAgent@88d00c6: 7\u003E ;;because of async update\n\n@bond\n=\u003E8\n","created-at":1329375108000,"updated-at":1329375308000,"_id":"542692d5c026201cdc32707d"}],"notes":null,"arglists":["a handler-fn"],"doc":"Sets the error-handler of agent a to handler-fn. If an action\n being run by the agent throws an exception or doesn't pass the\n validator fn, handler-fn will be called with two arguments: the\n agent and the exception.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/set-error-handler!"},{"ns":"clojure.core","name":"inst-ms*","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["inst"],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.core/inst-ms*"},{"added":"1.0","ns":"clojure.core","name":"keyword?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":570,"examples":[{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[],"body":"\u003Cpre\u003Euser=\u003E (keyword? x)\r\nfalse\r\nuser=\u003E (keyword? :x)\r\ntrue\r\nuser=\u003E (keyword? true)\r\nfalse\u003C/pre\u003E","created-at":1279074168000,"updated-at":1279074168000,"_id":"542692c6c026201cdc3268cc"}],"notes":null,"arglists":["x"],"doc":"Return true if x is a Keyword","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/keyword_q"},{"added":"1.0","ns":"clojure.core","name":"force","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1342465196000,"author":{"login":"sergey","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fbf950615302e00a14bceec914af32ca?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"delay","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d92"}],"line":763,"examples":[{"author":{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"},"editors":[{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"},{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"}],"body":";; an example for delay using an event-queue\nuser\u003E (import [java.util.concurrent PriorityBlockingQueue])\njava.util.concurrent.PriorityBlockingQueue\nuser\u003E (defn create-event-element [delayed-event tme]\n (struct event delayed-event tme))\n#'user/create-event-element\nuser\u003E (defn comp-queue [e1 e2]\n (if (\u003C (:time e1) (:time e2))\n true false))\n#'user/comp-queue\nuser\u003E (defn update [n]\n\t(reset! c n))\n#'user/update\nuser\u003E (defn create-event-queue [comp-queue size]\n (new PriorityBlockingQueue size (comp comp-queue)))\n#'user/create-event-queue\nuser\u003E (def queue (create-event-queue comp-queue 10))\n#'user/queue\nuser\u003E (def elements (take 10 (repeatedly \n\t\t\t (fn[](create-event-element \n\t\t\t\t (delay (update (rand-int 20)))\n\t\t\t\t (rand))))))\n#'user/elements\nuser\u003E (def c (atom 0))\n#'user/c\nuser\u003E @c\n0\nuser\u003E (doseq [e elements]\n\t (.add queue e))\nnil\nuser\u003E (dotimes [_ 10]\n\t (let [e (.poll queue)]\n\t\t (println \"c=\" @c)\n\t\t (print \"time=\" (:time e) \":\")\n\t\t (println (force (:object e)))))\nc= 0\ntime= 0.07805244345581108 :19\nc= 19\ntime= 0.24297414417455565 :6\nc= 6\ntime= 0.24427040715816817 :0\nc= 0\ntime= 0.24938478920862384 :17\nc= 17\ntime= 0.33612588239752494 :6\nc= 6\ntime= 0.5148481493716295 :5\nc= 5\ntime= 0.5823642080700586 :7\nc= 7\ntime= 0.7674970100941858 :4\nc= 4\ntime= 0.9206272921555505 :14\nc= 14\ntime= 0.9958255204018474 :4\nnil\nuser\u003E @c\n4\nuser\u003E (def elements (take 10 (repeatedly \n\t\t\t (fn[](create-event-element \n\t\t\t\t (delay (update (rand-int 20)))\n\t\t\t\t (rand))))))\n#'user/elements\n;; if we check 'element', delay objects will be evaluated. The below is\n;; this example. Please compare the above with the below.\nuser\u003E elements \n({:object #\u003CDelay@37a63e06: 16\u003E, :time 0.48566816399656854} {:object #\u003CDelay@3321875: 19\u003E, :time 0.9374202154797486} {:object #\u003CDelay@4de3aaf6: 17\u003E, :time 0.3271116626875401} {:object #\u003CDelay@1ded246d: 15\u003E, :time 0.8843712542267577} {:object #\u003CDelay@3bf27f74: 10\u003E, :time 0.86383171974926} {:object #\u003CDelay@2d8db76b: 14\u003E, :time 0.2120086056700251} {:object #\u003CDelay@3304e92a: 5\u003E, :time 0.9406336968276247} {:object #\u003CDelay@767de91: 0\u003E, :time 0.2150071400135528} {:object #\u003CDelay@34450563: 7\u003E, :time 0.7520042839572664} {:object #\u003CDelay@1f64c164: 1\u003E, :time 0.6264819751284463})\n;; The object of the last elements is #\u003CDelay@1f64c164: 1\u003E. Therefore,\n;; This indicates the atom 'c' has already updated.\nuser\u003E @c \n1 \nuser\u003E (doseq [e elements]\n\t (.add queue e))\nnil\n;; 'atom c' has never been updated because it has already\n;; been evaluated.\nuser\u003E (dotimes [_ 10]\n\t (let [e (.poll queue)]\n\t\t (println \"c=\" @c)\n\t\t (print \"time=\" (:time e) \":\")\n\t\t (println (force (:object e)))))\nc= 1\ntime= 0.2120086056700251 :14\nc= 1\ntime= 0.2150071400135528 :0\nc= 1\ntime= 0.3271116626875401 :17\nc= 1\ntime= 0.48566816399656854 :16\nc= 1\ntime= 0.6264819751284463 :1\nc= 1\ntime= 0.7520042839572664 :7\nc= 1\ntime= 0.86383171974926 :10\nc= 1\ntime= 0.8843712542267577 :15\nc= 1\ntime= 0.9374202154797486 :19\nc= 1\ntime= 0.9406336968276247 :5\nnil\nuser\u003E ","created-at":1308852117000,"updated-at":1308852376000,"_id":"542692cdc026201cdc326ce6"},{"author":{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"},"editors":[{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"}],"body":";; the tarai benchmark comparing non-lazy version with lazy-version\n(defn tarai [x y z]\n (if (\u003C= (x) (y))\n (y)\n (recur (fn [] (tarai (fn [] (- (x) 1)) y z))\n (fn [] (tarai (fn [] (- (y) 1)) z x))\n (fn [] (tarai (fn [] (- (z) 1)) x y)))))\n\n(defn tarai-d [x y z]\n (if (\u003C= (force x) (force y))\n (force y)\n (recur (delay (tarai-d (- (force x) 1) y z))\n (delay (tarai-d (- (force y) 1) z x))\n (delay (tarai-d (- (force z) 1) x y)))))\n\nuser\u003E (dotimes [_ 10] (time (tarai (fn [] 192) (fn [] 96) (fn [] 0))))\n\"Elapsed time: 139.660729 msecs\"\n\"Elapsed time: 132.493587 msecs\"\n\"Elapsed time: 135.867772 msecs\"\n\"Elapsed time: 132.924774 msecs\"\n\"Elapsed time: 137.491084 msecs\"\n\"Elapsed time: 134.72752 msecs\"\n\"Elapsed time: 132.969652 msecs\"\n\"Elapsed time: 135.795754 msecs\"\n\"Elapsed time: 134.261724 msecs\"\n\"Elapsed time: 138.059968 msecs\"\n\nnil\nuser\u003E (dotimes [_ 10 ] (time (tarai-d 192 96 0)))\n\"Elapsed time: 3.181795 msecs\"\n\"Elapsed time: 2.960096 msecs\"\n\"Elapsed time: 3.000855 msecs\"\n\"Elapsed time: 3.140536 msecs\"\n\"Elapsed time: 3.658821 msecs\"\n\"Elapsed time: 3.319659 msecs\"\n\"Elapsed time: 2.9182 msecs\"\n\"Elapsed time: 3.125442 msecs\"\n\"Elapsed time: 2.944342 msecs\"\n\"Elapsed time: 2.951613 msecs\"\nnil","created-at":1308905934000,"updated-at":1308906319000,"_id":"542692cdc026201cdc326ce9"}],"notes":null,"arglists":["x"],"doc":"If x is a Delay, returns the (possibly cached) value of its expression, else returns x","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/force"},{"added":"1.1","ns":"clojure.core","name":"bound-fn*","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1350609405000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"bound-fn","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e82"}],"line":2011,"examples":[{"author":{"login":"metajack","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/194d8437f5baed192c90be27369c4922?r=PG&default=identicon"},"editors":[],"body":"(def ^:dynamic *some-var* nil)\n\n(defn f [] (println *some-var*))\n\n;; run f without a new binding\nuser=\u003E (f)\nnil\nnil\n\n;; run f with a new binding\nuser=\u003E (binding [*some-var* \"hello\"]\n (f))\nhello\nnil\n\n;; run f in a thread with a new binding\nuser=\u003E (binding [*some-var* \"goodbye\"]\n (.start (Thread. f)))\nnil\nnil\n\n;; run a bound f in a thread with a new binding\nuser=\u003E (binding [*some-var* \"goodbye\"]\n (.start (Thread. (bound-fn* f))))\ngoodbye\nnil\n","created-at":1331769960000,"updated-at":1331769960000,"_id":"542692d2c026201cdc326f5d"}],"notes":null,"arglists":["f"],"doc":"Returns a function, which will install the same bindings in effect as in\n the thread at the time bound-fn* was called and then call f with any given\n arguments. This may be used to define a helper function which runs on a\n different thread, but needs the same bindings in place.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/bound-fn*"},{"added":"1.2","ns":"clojure.core","name":"namespace-munge","file":"clojure/core_deftype.clj","type":"function","column":1,"see-alsos":null,"line":13,"examples":null,"notes":null,"arglists":["ns"],"doc":"Convert a Clojure namespace name to a legal Java package name.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/namespace-munge"},{"added":"1.2","ns":"clojure.core","name":"group-by","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1318588913000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"partition-by","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bf8"},{"created-at":1332443915000,"author":{"login":"Cosmi","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/10f2eae92de67116fa98d06ec55fcf29?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"frequencies","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bf9"}],"line":7294,"examples":[{"author":{"login":"mvonrohr","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/59714f4428e8ef53b809ee923203531?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (group-by count [\"a\" \"as\" \"asd\" \"aa\" \"asdf\" \"qwer\"])\n{1 [\"a\"], 2 [\"as\" \"aa\"], 3 [\"asd\"], 4 [\"asdf\" \"qwer\"]}\n\nuser=\u003E (group-by odd? (range 10))\n{false [0 2 4 6 8], true [1 3 5 7 9]}\n","created-at":1279083015000,"updated-at":1285486099000,"_id":"542692cdc026201cdc326cd2"},{"author":{"login":"Brool","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/781c0e32be2a2f7117dabd76a3fb7c3?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"uvtc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/34f159f89cbd1d9beac0276f5a7af552?r=PG&default=identicon"}],"body":";; group by a primary key\nuser=\u003E (group-by :user-id [{:user-id 1 :uri \"/\"} \n {:user-id 2 :uri \"/foo\"} \n {:user-id 1 :uri \"/account\"}])\n\n{1 [{:user-id 1, :uri \"/\"} {:user-id 1, :uri \"/account\"}],\n 2 [{:user-id 2, :uri \"/foo\"}]}\n","created-at":1285069474000,"updated-at":1347147375000,"_id":"542692cdc026201cdc326cd4"}],"notes":null,"arglists":["f coll"],"doc":"Returns a map of the elements of coll keyed by the result of\n f on each element. The value at each key will be a vector of the\n corresponding elements, in the order they appeared in coll.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/group-by"},{"added":"1.0","ns":"clojure.core","name":"prn","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1290672937000,"author":{"login":"dale","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a7a1eca257c6cea943fea41e5cc3e9a3?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"println","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cc3"},{"created-at":1291028040000,"author":{"login":"dale","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a7a1eca257c6cea943fea41e5cc3e9a3?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"pr","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cc4"}],"line":3740,"examples":[{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[{"login":"cloojure","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1ad3de25d00d953de6e8c82f554cdbf5?r=PG&default=identicon"},{"login":"cloojure","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1ad3de25d00d953de6e8c82f554cdbf5?r=PG&default=identicon"},{"login":"cloojure","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1ad3de25d00d953de6e8c82f554cdbf5?r=PG&default=identicon"}],"body":"user=\u003E (prn \"fred\" 1)\n\"fred\" 1\nnil\n\nuser=\u003E (def items [ \"hello\" :a 1 (list :b 2) \\c {:d 4} #{5 6 7} ])\n#'user/items\n\n; prn outputs items in a machine-readable format, such as in a source\n; file. Note the double-quotes around the string \"hello\" and the escaped letter \"c\".\nuser=\u003E (prn items)\n[\"hello\" :a 1 (:b 2) \\c {:d 4} #{5 6 7}]\nnil\n\n; println is for human-readable output, like a report. Note the lack of quotes around the string \"hello\", and the unescaped letter \"c\". \nuser=\u003E (println items)\n[hello :a 1 (:b 2) c {:d 4} #{5 6 7}]\nnil\n\n; pr-str produces a string with escaped punctuation, so that println yields the same result as the original prn call.\nuser=\u003E (println (pr-str items))\n[\"hello\" :a 1 (:b 2) \\c {:d 4} #{5 6 7}]\nnil\n\n","created-at":1335592532000,"updated-at":1402400103000,"_id":"542692d4c026201cdc32703b"}],"notes":null,"arglists":["& more"],"doc":"Same as pr followed by (newline). Observes *flush-on-newline*","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/prn"},{"added":"1.2","ns":"clojure.core","name":"extend","file":"clojure/core_deftype.clj","type":"function","column":1,"see-alsos":[{"created-at":1326611307000,"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"satisfies?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e53"},{"created-at":1326611311000,"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"extends?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e54"},{"created-at":1326611316000,"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"extenders","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e55"},{"created-at":1394618470000,"author":{"login":"Chort409","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/73da2cf9145cfb9c900b31436ee435a6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"extend-type","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e56"},{"created-at":1394618476000,"author":{"login":"Chort409","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/73da2cf9145cfb9c900b31436ee435a6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"extend-protocol","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e57"}],"line":780,"examples":[{"author":{"login":"semperos","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/edeae8e7534b3d554e4ec2c35ffc68d?r=PG&default=identicon"},"editors":[{"login":"semperos","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/edeae8e7534b3d554e4ec2c35ffc68d?r=PG&default=identicon"}],"body":"; From Sean Devlin's talk on protocols at Clojure Conj\n(defprotocol Dateable\n (to-ms [t]))\n\n(extend java.lang.Number\n Dateable\n {:to-ms identity})\n\n(extend java.util.Date\n Dateable\n {:to-ms #(.getTime %)})\n\n(extend java.util.Calendar\n Dateable\n {:to-ms #(to-ms (.getTime %))})","created-at":1296704103000,"updated-at":1296705296000,"_id":"542692c7c026201cdc3269d3"}],"notes":null,"arglists":["atype & proto+mmaps"],"doc":"Implementations of protocol methods can be provided using the extend construct:\n\n (extend AType\n AProtocol\n {:foo an-existing-fn\n :bar (fn [a b] ...)\n :baz (fn ([a]...) ([a b] ...)...)}\n BProtocol \n {...} \n ...)\n \n extend takes a type/class (or interface, see below), and one or more\n protocol + method map pairs. It will extend the polymorphism of the\n protocol's methods to call the supplied methods when an AType is\n provided as the first argument. \n\n Method maps are maps of the keyword-ized method names to ordinary\n fns. This facilitates easy reuse of existing fns and fn maps, for\n code reuse/mixins without derivation or composition. You can extend\n an interface to a protocol. This is primarily to facilitate interop\n with the host (e.g. Java) but opens the door to incidental multiple\n inheritance of implementation since a class can inherit from more\n than one interface, both of which extend the protocol. It is TBD how\n to specify which impl to use. You can extend a protocol on nil.\n\n If you are supplying the definitions explicitly (i.e. not reusing\n exsting functions or mixin maps), you may find it more convenient to\n use the extend-type or extend-protocol macros.\n\n Note that multiple independent extend clauses can exist for the same\n type, not all protocols need be defined in a single extend call.\n\n See also:\n extends?, satisfies?, extenders","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/extend"},{"added":"1.0","ns":"clojure.core","name":"unchecked-multiply","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":1240,"examples":[{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[{"login":"kentros","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/765acc548dfd021fd854d75f9da3d0a9?r=PG&default=identicon"}],"body":";; the unchecked-multiply function silently overflows\n\nuser=\u003E (* 1000000000000 10)\n10000000000000\nuser=\u003E (unchecked-multiply 1000000000000 10)\n10000000000000\n\nuser=\u003E (* 3037000500 3037000500)\nArithmeticException integer overflow clojure.lang.Numbers.throwIntOverflow (Numbers.java:1424)\nuser=\u003E (unchecked-multiply 3037000500 3037000500)\n-9223372036709301616\n\n","created-at":1313910992000,"updated-at":1407321150000,"_id":"542692c6c026201cdc326917"}],"notes":null,"arglists":["x y"],"doc":"Returns the product of x and y, both long.\n Note - uses a primitive operator subject to overflow.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/unchecked-multiply"},{"added":"1.5","ns":"clojure.core","name":"some-\u003E\u003E","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1412083996468,"author":{"login":"jw-00000","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/2936?v=2"},"to-var":{"ns":"clojure.core","name":"-\u003E\u003E","library-url":"https://github.com/clojure/clojure"},"_id":"542ab11ce4b0df9bb778a59d"},{"created-at":1412084003950,"author":{"login":"jw-00000","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/2936?v=2"},"to-var":{"ns":"clojure.core","name":"some-\u003E","library-url":"https://github.com/clojure/clojure"},"_id":"542ab123e4b0df9bb778a59e"}],"line":7790,"examples":null,"macro":true,"notes":null,"arglists":["expr & forms"],"doc":"When expr is not nil, threads it into the first form (via -\u003E\u003E),\n and when that result is not nil, through the next etc","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/some-\u003E\u003E"},{"added":"1.4","ns":"clojure.core","name":"default-data-readers","file":"clojure/core.clj","type":"var","column":1,"see-alsos":null,"line":7988,"examples":null,"notes":null,"arglists":[],"doc":"Default map of data reader functions provided by Clojure. May be\n overridden by binding *data-readers*.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/default-data-readers"},{"ns":"clojure.core","name":"-\u003EVecSeq","file":"clojure/gvec.clj","type":"function","column":1,"see-alsos":null,"line":59,"examples":null,"notes":null,"arglists":["am vec anode i offset _meta"],"doc":"Positional factory function for class clojure.core.VecSeq.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/-\u003EVecSeq"},{"added":"1.0","ns":"clojure.core","name":"even?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1354423235000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"odd?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dd1"}],"line":1400,"examples":[{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"rafmagana","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/40bd727b22d74930f292b63d45a71b07?r=PG&default=identicon"}],"body":"user=\u003E (even? 2)\ntrue\n\nuser=\u003E (even? 1)\nfalse","created-at":1279073824000,"updated-at":1406097631000,"_id":"542692ccc026201cdc326cb5"},{"author":{"login":"replore","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e7869fe1a48cb1814c657eaca6bea3eb?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (filter even? (range 10))\n(0 2 4 6 8)","created-at":1321356072000,"updated-at":1332949375000,"_id":"542692d2c026201cdc326f9e"}],"notes":null,"arglists":["n"],"doc":"Returns true if n is even, throws an exception if n is not an integer","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/even_q"},{"added":"1.0","ns":"clojure.core","name":"unchecked-dec","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1289217146000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unchecked-add","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c37"},{"created-at":1289217151000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unchecked-dec","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c38"},{"created-at":1289217154000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unchecked-inc","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c39"},{"created-at":1289217159000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unchecked-negate","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c3a"},{"created-at":1289217163000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unchecked-divide","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c3b"},{"created-at":1289217168000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unchecked-subtract","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c3c"},{"created-at":1289217172000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unchecked-multiply","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c3d"},{"created-at":1289217176000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unchecked-remainder","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c3e"}],"line":1184,"examples":[{"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (unchecked-dec 4)\n3\n\nuser=\u003E (unchecked-dec Integer/MIN_VALUE)\n2147483647\n\n","created-at":1289217142000,"updated-at":1289267924000,"_id":"542692c6c026201cdc326939"}],"notes":null,"arglists":["x"],"doc":"Returns a number one less than x, a long.\n Note - uses a primitive operator subject to overflow.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/unchecked-dec"},{"ns":"clojure.core","name":"Inst","file":"clojure/core.clj","type":"var","column":1,"see-alsos":null,"line":6909,"examples":null,"notes":null,"arglists":[],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.core/Inst"},{"added":"1.7","ns":"clojure.core","name":"tagged-literal?","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":7957,"examples":null,"notes":null,"arglists":["value"],"doc":"Return true if the value is the data representation of a tagged literal","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/tagged-literal_q"},{"added":"1.0","ns":"clojure.core","name":"double-array","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1349125799000,"author":{"login":"Ljos","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/45b996a79abca465acaf6c0f10b0437?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"doubles","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ac2"},{"created-at":1349125811000,"author":{"login":"Ljos","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/45b996a79abca465acaf6c0f10b0437?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"aget","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ac3"},{"created-at":1349125816000,"author":{"login":"Ljos","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/45b996a79abca465acaf6c0f10b0437?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"aset","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ac4"},{"created-at":1349125826000,"author":{"login":"Ljos","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/45b996a79abca465acaf6c0f10b0437?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"aset-double","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ac5"}],"line":5370,"examples":[{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[],"body":";; create a double array using double-array\n;; and show it can be used with the standard Java functions\n;; binarySearch and fill\n\nuser=\u003E (def ds (double-array (range 3 20)))\n#'user/ds\nuser=\u003E (type ds)\n[D\nuser=\u003E (vec ds)\n[3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0]\nuser=\u003E (java.util.Arrays/binarySearch ds 10.0)\n7\nuser=\u003E (java.util.Arrays/fill ds 3 8 99.0)\nnil\nuser=\u003E (vec ds)\n[3.0 4.0 5.0 99.0 99.0 99.0 99.0 99.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19\n.0]\nuser=\u003E","created-at":1313906832000,"updated-at":1313906832000,"_id":"542692cac026201cdc326b10"}],"notes":null,"arglists":["size-or-seq","size init-val-or-seq"],"doc":"Creates an array of doubles","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/double-array"},{"added":"1.0","ns":"clojure.core","name":"in-ns","type":"function","see-alsos":[{"created-at":1331258262000,"author":{"login":"frangio","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/646001f0ba2b7df47a16c0a1d5b62225?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ns","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c41"}],"examples":[{"author":{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},"editors":[{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; Let's create new namespace, create new variable in it, then access it from another namespace\n\n;; create the namespace and switch to it\nuser=\u003E (in-ns 'first-namespace)\n#<Namespace first-namespace>\n\n;; create a variable and check it\nfirst-namespace=\u003E (def my-var \"some value\")\n#'first-namespace/my-var\nfirst-namespace=\u003E my-var\n\"some value\"\n\n;; create another namespace and switch to this one\nfirst-namespace=\u003E (in-ns 'second-namespace)\n#<Namespace second-namespace>\n\n;; use variable from the other namespace here\nsecond-namespace=\u003E first-namespace/my-var\n\"some value\"","created-at":1285103646000,"updated-at":1285485966000,"_id":"542692cdc026201cdc326d10"},{"author":{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; The \"in-ns\" function works almost the same as \"ns\", but does not load clojure.core \n\nuser=\u003E (in-ns 'my-namespace)\n#<Namespace my-namespace>\n\n;; the function clojure.core/inc won't just work\nmy-namespace=\u003E (inc 1)\njava.lang.Exception: Unable to resolve symbol: inc in this context (NO_SOURCE_FILE:15)\n\nmy-namespace=\u003E (clojure.core/inc 1)\n2\n","created-at":1285105578000,"updated-at":1285485996000,"_id":"542692cdc026201cdc326d13"}],"notes":null,"arglists":["name"],"doc":"Sets *ns* to the namespace named by the symbol, creating it if needed.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/in-ns"},{"added":"1.0","ns":"clojure.core","name":"create-ns","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1284970193000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"remove-ns","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cb1"},{"created-at":1284970227000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"find-ns","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cb2"}],"line":4158,"examples":[{"author":{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; If you try this, you're doing it wrong\nuser=\u003E (create-ns my-new-namespace)\njava.lang.Exception: Unable to resolve symbol: my-new-namespace in this context (NO_SOURCE_FILE:2)\n\n\n;; Same deal, if you try this, you're doing it wrong\nuser=\u003E (create-ns \"my-new-namespace\")\njava.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.Symbol (NO_SOURCE_FILE:0)\n\n\n;; This is how you do it\nuser=\u003E (create-ns 'my-new-namespace)\n#<Namespace my-new-namespace>\n","created-at":1284947276000,"updated-at":1285485893000,"_id":"542692cac026201cdc326b8f"},{"author":{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},"editors":[{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; Let's create a namespace and check for our result\n;; the new namespace will be \"my-new-namespace\"\n\n;; obviously, it does not exist yet, so looking for it, finds nothing\nuser=\u003E (find-ns 'my-new-namespace) \nnil\n\n;; let's create it\nuser=\u003E (create-ns 'my-new-namespace)\n#<Namespace my-new-namespace>\n\n;; now searching for it again will have a result\nuser=\u003E (find-ns 'my-new-namespace)\n#<Namespace my-new-namespace>\n","created-at":1284947982000,"updated-at":1285486657000,"_id":"542692cac026201cdc326b91"},{"author":{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},"editors":[{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; You can create a namespace, not switch to it and still work in, by storing it\n\n;; create the namespace\nuser=\u003E (def for-later-use (create-ns 'my-namespace))\n#'user/for-later-use\n\n;; assign a value for a variable\nuser=\u003E (intern for-later-use 'my-var \"some value\")\n#'my-namespace/my-var\n;; notice how the \"for-later-use\" symbol has been evaluated to the namespace it represents\n\n;; check the new variable\nuser=\u003E my-namespace/my-var\n\"some value\"\n\n;; you can also work on a namespace by using the its name\n;; (but quoting it) instead of the return of \"create-ns\"\nuser=\u003E (intern 'my-namespace 'my-var \"some other value\")\n#'my-namespace/my-var\n\n;; check the new assignment and see what's changed\nuser=\u003E my-namespace/my-var\n\"some other value\"\n","created-at":1285113908000,"updated-at":1285485928000,"_id":"542692cbc026201cdc326b96"}],"notes":null,"arglists":["sym"],"doc":"Create a new namespace named by the symbol if one doesn't already\n exist, returns it or the already-existing namespace of the same\n name.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/create-ns"},{"added":"1.0","ns":"clojure.core","name":"re-matcher","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1282039999000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"re-find","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b2e"}],"line":4902,"examples":[{"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"editors":[{"login":"philos99","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1de5617efb013ca7c9cf8e5646818ffa?r=PG&default=identicon"}],"body":"user=\u003E (def *matcher* (re-matcher #\"\\d+\" \"abc12345def\"))\n#'user/*matcher*\n\nuser=\u003E (re-find *matcher*)\n\"12345\"","created-at":1280546885000,"updated-at":1317219277000,"_id":"542692c8c026201cdc326a0d"}],"notes":null,"tag":"java.util.regex.Matcher","arglists":["re s"],"doc":"Returns an instance of java.util.regex.Matcher, for use, e.g. in\n re-find.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/re-matcher"},{"added":"1.0","ns":"clojure.core","name":"defn","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1334710750000,"author":{"login":"Ljos","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/45b996a79abca465acaf6c0f10b0437?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"def","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521edb"},{"created-at":1334710756000,"author":{"login":"Ljos","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/45b996a79abca465acaf6c0f10b0437?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"defn-","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521edc"},{"created-at":1361269869000,"author":{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"defmacro","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521edd"},{"created-at":1399636777000,"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"fn","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ede"}],"line":285,"examples":[{"author":{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"}],"body":"user=\u003E (defn foo [a b c]\n\t (* a b c))\n#'user/foo\nuser=\u003E (foo 1 2 3)\n6\n\nuser=\u003E (defn bar [a b & [c]]\n (if c\n (* a b c)\n (* a b 100)))\n#'user/bar\nuser=\u003E (bar 5 6)\n3000\nuser=\u003E (bar 5 6 2)\n60\n\nuser=\u003E (defn baz [a b & {:keys [c d] :or {c 10 d 20}}]\n (* a b c d))\n#'user/baz\nuser=\u003E (baz 2 3)\n1200\nuser=\u003E (baz 2 3 :c 5)\n600\nuser=\u003E (baz 2 3 :c 5 :d 6)\n180\n\nuser=\u003E (defn boo [a b & {:keys [c d] :or {c 10 d 20} :as all-specified}]\n (println all-specified)\n (* a b c d))\n#'user/boo\nuser=\u003E (boo 2 3)\nnil\n1200\nuser=\u003E (boo 2 3 :c 5)\n{:c 5}\n600\nuser=\u003E (boo 1 2 :d 3 :c 4)\n{:c 4, :d 3}\n24\n","created-at":1279161740000,"updated-at":1361268155000,"_id":"542692cbc026201cdc326bd1"},{"author":{"login":"kotarak","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5db30f607f0b5fa70d690311aa3bfd3b?r=PG&default=identicon"},"editors":[{"login":"kotarak","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5db30f607f0b5fa70d690311aa3bfd3b?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (defn bar\n ([a b] (bar a b 100))\n ([a b c] (* a b c)))\n#'user/bar\nuser=\u003E (bar 5 6)\n3000\nuser=\u003E (bar 5 6 2)\n60\n","created-at":1279213901000,"updated-at":1285496324000,"_id":"542692cbc026201cdc326bd6"},{"author":{"login":"pkolloch","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/10b2fd3c0a4cc46dc241a48468dc551?r=PG&default=identicon"},"editors":[{"login":"pkolloch","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/10b2fd3c0a4cc46dc241a48468dc551?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"philos99","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1de5617efb013ca7c9cf8e5646818ffa?r=PG&default=identicon"}],"body":";; You can use destructuring to have keyword arguments. This would be a\n;; pretty verbose version of map (in an example a bit more verbose than\n;; the first above):\n\n(defn keyworded-map [& {function :function sequence :sequence}]\n (map function sequence))\n\n;; You can call it like this:\n\nuser=\u003E (keyworded-map :sequence [1 2 3] :function #(+ % 2))\n(3 4 5)\n\n\n;; The declaration can be shortened with \":keys\" if your local variables \n;; should be named in the same way as your keys in the map:\n\n(defn keyworded-map [& {:keys [function sequence]}]\n (map function sequence))\n","created-at":1280457897000,"updated-at":1317454000000,"_id":"542692cbc026201cdc326bd9"},{"author":{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},"editors":[{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"}],"body":"(defn somefn\n [req1 req2 ;required params\n & {:keys [a b c d e] ;optional params\n :or {a 1 ;optional params with preset default values other than the nil default\n ; b takes nil if not specified on call\n c 3 ; c is 3 when not specified on call\n d 0 ; d is 0 --//--\n ; e takes nil if not specified on call\n }\n :as mapOfParamsSpecifiedOnCall ;takes nil if no extra params(other than the required ones) are specified on call\n }]\n (println req1 req2 mapOfParamsSpecifiedOnCall a b c d e)\n )\n\n=\u003E (somefn 9 10 :b 2 :d 4)\n;9 10 {:b 2, :d 4} 1 2 3 4 nil\nnil\n=\u003E (somefn)\n;ArityException Wrong number of args (0) passed to: funxions$somefn ;clojure.lang.AFn.throwArity (AFn.java:437)\n=\u003E (somefn 9 10)\n;9 10 nil 1 nil 3 0 nil\nnil\n=\u003E (somefn 9 10 :x 123)\n;9 10 {:x 123} 1 nil 3 0 nil\nnil\n=\u003E (somefn 9 10 123)\n;IllegalArgumentException No value supplied for key: 123 ;clojure.lang.PersistentHashMap.create (PersistentHashMap.java:77)\n=\u003E (somefn 9 10 123 45)\n;9 10 {123 45} 1 nil 3 0 nil\nnil\n=\u003E (try \n (somefn 9 10 123)\n (catch IllegalArgumentException e (println \"caught:\" e)))\n;caught: #\u003CIllegalArgumentException java.lang.IllegalArgumentException: No value supplied for key: 123\u003E\nnil","created-at":1361269606000,"updated-at":1361269847000,"_id":"542692d2c026201cdc326f7c"}],"macro":true,"notes":null,"arglists":["name doc-string? attr-map? [params*] prepost-map? body","name doc-string? attr-map? ([params*] prepost-map? body) + attr-map?"],"doc":"Same as (def name (fn [params* ] exprs*)) or (def\n name (fn ([params* ] exprs*)+)) with any doc-string or attrs added\n to the var metadata. prepost-map defines a map with optional keys\n :pre and :post that contain collections of pre or post conditions.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/defn"},{"added":"1.0","ns":"clojure.core","name":"ref","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1284616785000,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.core","name":"alter","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d3e"},{"created-at":1284616936000,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.core","name":"ref-set","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d3f"},{"created-at":1323973222000,"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"add-watch","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d40"},{"created-at":1326521654000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"dosync","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d41"},{"created-at":1349393302000,"author":{"login":"eric","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2b0c9ae6f1da9716451e7c86bc87230b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"commute","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d42"},{"created-at":1349397556000,"author":{"login":"eric","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2b0c9ae6f1da9716451e7c86bc87230b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ensure","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d43"},{"created-at":1364770237000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ref-history-count","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d44"},{"created-at":1364770253000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ref-min-history","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d45"},{"created-at":1364770260000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ref-max-history","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d46"},{"created-at":1364873716000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"set-validator!","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d47"}],"line":2279,"examples":[{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"}],"body":"user=\u003E (ref [])\n#\u003Cref@5fafa486: []\u003E\n\nuser=\u003E (ref 1 :validator pos?)\n#\u003CRef@6c484c6b: 1\u003E\n\n=\u003E (ref 0 :validator pos?)\nIllegalStateException Invalid reference state clojure.lang.ARef.validate (ARef.java:33)\n\n=\u003E (dosync (ref-set (ref 1 :validator pos?) 0))\nIllegalStateException Invalid reference state clojure.lang.ARef.validate (ARef.java:33)\n\n=\u003E (dosync (ref-set (ref 1 :validator pos?) 2))\n2","created-at":1280779137000,"updated-at":1360387666000,"_id":"542692cac026201cdc326b3a"}],"notes":null,"arglists":["x","x & options"],"doc":"Creates and returns a Ref with an initial value of x and zero or\n more options (in any order):\n\n :meta metadata-map\n\n :validator validate-fn\n\n :min-history (default 0)\n :max-history (default 10)\n\n If metadata-map is supplied, it will become the metadata on the\n ref. validate-fn must be nil or a side-effect-free fn of one\n argument, which will be passed the intended new state on any state\n change. If the new state is unacceptable, the validate-fn should\n return false or throw an exception. validate-fn will be called on\n transaction commit, when all refs have their final values.\n\n Normally refs accumulate history dynamically as needed to deal with\n read demands. If you know in advance you will need history you can\n set :min-history to ensure it will be available when first needed (instead\n of after a read fault). History is limited, and the limit can be set\n with :max-history.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/ref"},{"added":"1.3","ns":"clojure.core","name":"bigint","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":3645,"examples":[{"author":{"login":"Miles","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bbb26d2a5e856c4fba0f72c3f7250f3f?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"Miles","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bbb26d2a5e856c4fba0f72c3f7250f3f?r=PG&default=identicon"},{"login":"rebcabin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/880b0bb3a4be9237326dd69565444dee?r=PG&default=identicon"}],"body":"user=\u003E (bigint 30)\n30\n\n\n;; Actually do something BigInteger-ish... (http://download.oracle.com/javase/6/docs/api/)\n\nuser=\u003E (def x (bigint 97))\n#'user/x\n\nuser=\u003E (.isProbablePrime (.toBigInteger x) 100)\ntrue\n","created-at":1283817133000,"updated-at":1375568824000,"_id":"542692cec026201cdc326d94"},{"author":{"login":"rebcabin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/880b0bb3a4be9237326dd69565444dee?r=PG&default=identicon"},"editors":[{"login":"rebcabin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/880b0bb3a4be9237326dd69565444dee?r=PG&default=identicon"}],"body":"user\u003E (= (bigint 42) (clojure.lang.BigInt/fromBigInteger (BigInteger. \"42\"))\ntrue\nuser\u003E (= 42N (bigint 42))\ntrue\nuser\u003E (= 42 (bigint 42))\ntrue\nuser\u003E (= 42 (clojure.lang.BigInt/fromBigInteger (BigInteger. \"42\"))\ntrue\n","created-at":1375568690000,"updated-at":1375569441000,"_id":"542692d2c026201cdc326f4f"},{"author":{"login":"rebcabin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/880b0bb3a4be9237326dd69565444dee?r=PG&default=identicon"},"editors":[{"login":"rebcabin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/880b0bb3a4be9237326dd69565444dee?r=PG&default=identicon"}],"body":"user\u003E (reduce * (repeat 20 1000))\nArithmeticException integer overflow clojure.lang.Numbers.throwIntOverflow (Numbers.java:1388)\n\nuser\u003E (reduce * (repeat 20 (bigint 1000)))\n1000000000000000000000000000000000000000000000000000000000000N\n","created-at":1375569614000,"updated-at":1375569672000,"_id":"542692d2c026201cdc326f51"}],"notes":[{"updated-at":1375486531000,"body":"The last example does not seem to work; there seems to be a missing coercion from Clojure BigInt to Java BigInteger. I get \u003Cpre\u003E\r\nIllegalArgumentException No matching method found: isProbablePrime for class clojure.lang.BigInt clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:53)\u003C/pre\u003E","created-at":1375486531000,"author":{"login":"rebcabin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/880b0bb3a4be9237326dd69565444dee?r=PG&default=identicon"},"_id":"542692edf6e94c697052200a"}],"tag":"clojure.lang.BigInt","arglists":["x"],"doc":"Coerce to BigInt","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/bigint"},{"added":"1.2","ns":"clojure.core","name":"extends?","file":"clojure/core_deftype.clj","type":"function","column":1,"see-alsos":[{"created-at":1302036433000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"defprotocol","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cb6"}],"line":558,"examples":[{"author":{"login":"mstoeckli","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/271f1fe6c39e19db5714ce29b64d3ad5?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (defprotocol Area (get-area [this]))\nArea\n\nuser=\u003E (defrecord Rectangle [width height]\n Area\n (get-area [this]\n (* width height)))\nuser.Rectangle\n\n(extends? Area Rectangle)\ntrue\n","created-at":1337146392000,"updated-at":1337146392000,"_id":"542692d3c026201cdc326fa4"}],"notes":null,"arglists":["protocol atype"],"doc":"Returns true if atype extends protocol","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/extends_q"},{"added":"1.1","ns":"clojure.core","name":"promise","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1343782692000,"author":{"login":"Dmitry Kakurin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/85b70be5da433a6adf5112e7140848da?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"realized?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ed2"},{"created-at":1291473023000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"future","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f35"},{"created-at":1301868450000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"deliver","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f36"}],"line":7244,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"neveu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/197e0539bc06e120eea534aa2a7d3ec0?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (def x (promise))\n#'user/x\n;; Trying to deref at this point will make your repl wait forever\n\n\nuser=\u003E (deliver x 100)\n#<core$promise$reify__5534@4369a50b: 100>\n\n;; the promise has been delivered, deref x will return immediately\nuser=\u003E @x\n100\n\n","created-at":1280748732000,"updated-at":1285488731000,"_id":"542692c7c026201cdc3269c8"},{"author":{"login":"neotyk","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/366ff985977b3aab09510bc335cd44a4?r=PG&default=identicon"},"editors":[],"body":";; Create a promise\nuser\u003E (def p (promise))\n#'user/p ; p is our promise\n\n;; Check if was delivered/realized\nuser\u003E (realized? p)\nfalse ; No yet\n\n;; Delivering the promise\nuser\u003E (deliver p 42)\n#\u003Ccore$promise$reify__5727@47122d: 42\u003E\n\n;; Check again if it was delivered\nuser\u003E (realized? p)\ntrue ; Yes!\n\n;; Deref to see what has been delivered\nuser\u003E @p\n42\n\n;; Note that @ is shorthand for deref\nuser\u003E (deref p)\n42\n","created-at":1324962605000,"updated-at":1324962605000,"_id":"542692d4c026201cdc32703f"}],"notes":null,"arglists":[""],"doc":"Returns a promise object that can be read with deref/@, and set,\n once only, with deliver. Calls to deref/@ prior to delivery will\n block, unless the variant of deref with timeout is used. All\n subsequent derefs will return the same delivered value without\n blocking. See also - realized?.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/promise"},{"added":"1.0","ns":"clojure.core","name":"aset-char","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":4007,"examples":[{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[],"body":";; create an array of 10 characters (initially set to blank by default)\n;; and set one of the elements to the character \"a\"\n\nuser=\u003E (def cs (char-array 10))\n#'user/cs\nuser=\u003E (vec cs)\n[\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ ]\nuser=\u003E (aset-char cs 3 \\a)\n\\a\nuser=\u003E (vec cs)\n[\\ \\ \\ \\a \\ \\ \\ \\ \\ \\ ]\nuser=\u003E","created-at":1313914505000,"updated-at":1313914505000,"_id":"542692c9c026201cdc326ad3"}],"notes":null,"arglists":["array idx val","array idx idx2 & idxv"],"doc":"Sets the value at the index/indices. Works on arrays of char. Returns val.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/aset-char"},{"added":"1.0","ns":"clojure.core","name":"rseq","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1293103256000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"reverse","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c2e"}],"line":1596,"examples":[{"author":{"login":"pkolloch","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/10b2fd3c0a4cc46dc241a48468dc551?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (vec (range 10))\n[0 1 2 3 4 5 6 7 8 9]\n\nuser=\u003E (rseq (vec (range 10)))\n(9 8 7 6 5 4 3 2 1 0)\n","created-at":1282324324000,"updated-at":1285494434000,"_id":"542692c8c026201cdc326a58"},{"author":{"login":"clojureking","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/92625b8a6be91bb8c688d0d07b4e2a32?r=PG&default=identicon"},"editors":[],"body":"(rseq (into (sorted-map) {:a 1 :b 2}))","created-at":1409352627000,"updated-at":1409352627000,"_id":"542692d5c026201cdc327078"}],"notes":null,"arglists":["rev"],"doc":"Returns, in constant time, a seq of the items in rev (which\n can be a vector or sorted-map), in reverse order. If rev is empty returns nil","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/rseq"},{"added":"1.10","ns":"clojure.core","name":"ex-cause","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":4857,"examples":null,"notes":null,"tag":"java.lang.Throwable","arglists":["ex"],"doc":"Returns the cause of ex if ex is a Throwable.\n Otherwise returns nil.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/ex-cause"},{"added":"1.0","ns":"clojure.core","name":"construct-proxy","file":"clojure/core_proxy.clj","type":"function","column":1,"see-alsos":null,"line":295,"examples":null,"notes":null,"arglists":["c & ctor-args"],"doc":"Takes a proxy class and any arguments for its superclass ctor and\n creates and returns an instance of the proxy.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/construct-proxy"},{"added":"1.0","ns":"clojure.core","name":"agent-errors","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":2253,"examples":null,"deprecated":"1.2","notes":null,"arglists":["a"],"doc":"DEPRECATED: Use 'agent-error' instead.\n Returns a sequence of the exceptions thrown during asynchronous\n actions of the agent.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/agent-errors"},{"added":"1.0","ns":"clojure.core","name":"*compile-files*","type":"var","see-alsos":null,"examples":null,"notes":null,"arglists":[],"doc":"Set to true when compiling files, false otherwise.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/*compile-files*"},{"added":"1.10","ns":"clojure.core","name":"ex-message","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":4849,"examples":null,"notes":null,"arglists":["ex"],"doc":"Returns the message attached to ex if ex is a Throwable.\n Otherwise returns nil.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/ex-message"},{"ns":"clojure.core","name":"*math-context*","type":"var","see-alsos":null,"examples":null,"notes":null,"tag":"java.math.MathContext","arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core/*math-context*"},{"added":"1.0","ns":"clojure.core","name":"float","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":3512,"examples":[{"author":{"login":"Miles","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bbb26d2a5e856c4fba0f72c3f7250f3f?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (float 1)\n1.0","created-at":1283814444000,"updated-at":1332952845000,"_id":"542692c9c026201cdc326afd"}],"notes":null,"arglists":["x"],"doc":"Coerce to float","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/float"},{"added":"1.0","ns":"clojure.core","name":"pr-str","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1299623857000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"pr","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b27"},{"created-at":1313054793000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"read-string","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b28"},{"created-at":1360241771000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"prn-str","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b29"}],"line":4785,"examples":[{"author":{"login":"Miles","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bbb26d2a5e856c4fba0f72c3f7250f3f?r=PG&default=identicon"},"editors":[{"login":"Miles","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bbb26d2a5e856c4fba0f72c3f7250f3f?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"Kototama","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a54a4dc204925d397ca010b9a332e74d?r=PG&default=identicon"},{"login":"Miles","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bbb26d2a5e856c4fba0f72c3f7250f3f?r=PG&default=identicon"}],"body":"user=\u003E (def x [1 2 3 4 5])\n#'user/x\nuser=\u003E x\n[1 2 3 4 5]\n\n\n;; Turn that data into a string...\nuser=\u003E (pr-str x)\n\"[1 2 3 4 5]\"\n\n\n;; ...and turn that string back into data!\nuser=\u003E (read-string (pr-str x))\n[1 2 3 4 5]\n","created-at":1284257614000,"updated-at":1287792086000,"_id":"542692cbc026201cdc326c20"},{"author":{"login":"dansalmo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e33ee460f5f61bc5ba9b598934766215?r=PG&default=identicon"},"editors":[],"body":";; you can think of pr-str as the inverse of read-string\n;; turn string into symbols\nuser=\u003E (read-string \"(a b foo :bar)\")\n(a b foo :bar)\n\n;;turn symbols into a string\nuser=\u003E (pr-str '(a b foo :bar))\n\"(a b foo :bar)\"","created-at":1346843924000,"updated-at":1346843924000,"_id":"542692d4c026201cdc327032"},{"author":{"login":"GyrosOfWar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8abc292bf5d9e88cfcbcfbe492774a38?r=PG&default=identicon"},"editors":[{"login":"GyrosOfWar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8abc292bf5d9e88cfcbcfbe492774a38?r=PG&default=identicon"},{"login":"GyrosOfWar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8abc292bf5d9e88cfcbcfbe492774a38?r=PG&default=identicon"},{"login":"GyrosOfWar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8abc292bf5d9e88cfcbcfbe492774a38?r=PG&default=identicon"}],"body":"(defn write-object\n \"Serializes an object to disk so it can be opened again later.\n Careful: It will overwrite an existing file at file-path.\"\n [obj file-path]\n (with-open [wr (writer file-path)]\n (.write wr (pr-str obj)))))","created-at":1391924453000,"updated-at":1391924601000,"_id":"542692d4c026201cdc327033"}],"notes":null,"tag":"java.lang.String","arglists":["& xs"],"doc":"pr to a string, returning it","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/pr-str"},{"added":"1.0","ns":"clojure.core","name":"concat","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1332796328000,"author":{"login":"Olivenmann","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d5b1703fb08dd81e4cb2f653a3aaf10b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"conj","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521da6"},{"created-at":1343083284000,"author":{"login":"john.r.woodward","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/22b6fbc4a386291e45b1cb4449377086?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"into","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521da7"}],"line":720,"examples":[{"author":{"login":"kotarak","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5db30f607f0b5fa70d690311aa3bfd3b?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"john.r.woodward","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/22b6fbc4a386291e45b1cb4449377086?r=PG&default=identicon"},{"login":"john.r.woodward","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/22b6fbc4a386291e45b1cb4449377086?r=PG&default=identicon"},{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"}],"body":"\nuser=\u003E (concat [1 2] [3 4])\n(1 2 3 4)\n\nuser=\u003E (into [] (concat [1 2] [3 4]))\n[1 2 3 4]\n\nuser=\u003E (concat [:a :b] nil [1 [2 3] 4])\n(:a :b 1 [2 3] 4)\n\n=\u003E (concat [1] [2] '(3 4) [5 6 7] #{9 10 8})\n(1 2 3 4 5 6 7 8 9 10)\n","created-at":1279026744000,"updated-at":1360435116000,"_id":"542692c9c026201cdc326a99"},{"author":{"login":"Bob Jarvis","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5ba4bce40c00d30a3b924cbaaf94c17a?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (concat \"abc\" \"def\")\n(\\a \\b \\c \\d \\e \\f)\n","created-at":1392247889000,"updated-at":1392247889000,"_id":"542692d2c026201cdc326f66"}],"notes":null,"arglists":["","x","x y","x y & zs"],"doc":"Returns a lazy seq representing the concatenation of the elements in the supplied colls.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/concat"},{"added":"1.0","ns":"clojure.core","name":"aset-short","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":3997,"examples":[{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[],"body":";; create an array of 10 shorts and set one of the values to 31415\n\nuser=\u003E (def ss (short-array 10))\n#'user/ss\nuser=\u003E (vec ss)\n[0 0 0 0 0 0 0 0 0 0]\nuser=\u003E (aset-short ss 3 31415)\n31415\nuser=\u003E (vec ss)\n[0 0 0 31415 0 0 0 0 0 0]\nuser=\u003E","created-at":1313915280000,"updated-at":1313915280000,"_id":"542692cac026201cdc326b1c"}],"notes":null,"arglists":["array idx val","array idx idx2 & idxv"],"doc":"Sets the value at the index/indices. Works on arrays of short. Returns val.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/aset-short"},{"added":"1.5","ns":"clojure.core","name":"set-agent-send-off-executor!","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":2112,"examples":null,"notes":null,"arglists":["executor"],"doc":"Sets the ExecutorService to be used by send-off","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/set-agent-send-off-executor!"},{"added":"1.0","ns":"clojure.core","name":"ns","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1289000801000,"author":{"login":"remleduff","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/f14b40211cdc07185c43edf8f4bd7a5b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"use","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f07"},{"created-at":1289000808000,"author":{"login":"remleduff","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/f14b40211cdc07185c43edf8f4bd7a5b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"require","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f08"},{"created-at":1289000818000,"author":{"login":"remleduff","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/f14b40211cdc07185c43edf8f4bd7a5b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"refer","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f09"},{"created-at":1291628676000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"import","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f0a"},{"created-at":1312583994000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ns-publics","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f0b"},{"created-at":1340999276000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"in-ns","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f0c"},{"created-at":1355453198000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"remove-ns","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f0d"},{"created-at":1366844150000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ns-map","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f0e"},{"created-at":1398960898000,"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"*ns*","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f0f"}],"line":5817,"examples":[{"author":{"login":"devijvers","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/81018e4231ac1ce8b7a9e6d377092656?r=PG&default=identicon"},"editors":[{"login":"devijvers","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/81018e4231ac1ce8b7a9e6d377092656?r=PG&default=identicon"},{"login":"devijvers","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/81018e4231ac1ce8b7a9e6d377092656?r=PG&default=identicon"},{"login":"devijvers","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/81018e4231ac1ce8b7a9e6d377092656?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; Generate a Java class\n(ns org.clojuredocs.test\n (:gen-class))\n\n(defn -main [] (prn \"Hello, World!\"))\n\n\n;; After compilation:\nsh$ java -cp classes org.clojuredocs.test\nHello, World!\n","created-at":1279069109000,"updated-at":1285486248000,"_id":"542692cac026201cdc326b6e"},{"author":{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},"editors":[{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; Let's create a namespace and then assign it as the current namespace\nuser=\u003E (create-ns 'my-new-namespace)\n#<Namespace my-new-namespace>\n\nuser=\u003E (ns 'my-new-namespace)\njava.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.Symbol (NO_SOURCE_FILE:26)\n;; oops, this is not the way to do it; if create-ns needs a symbol, ns does not\n\nuser=\u003E (ns my-new-namespace)\nnil\n\nmy-new-namespace=\u003E\n;; it worked as the current namespace is our newly created one\n\n","created-at":1284948992000,"updated-at":1285486298000,"_id":"542692cac026201cdc326b73"},{"author":{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},"editors":[{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; Generating a class so we can call Clojure from Java \n(ns com.domain.tiny\n (:gen-class\n :name com.domain.tiny\n :methods [#^{:static true} [binomial [int int] double]]))\n\n(defn binomial\n \"Calculate the binomial coefficient.\"\n [n k]\n (let [a (inc n)]\n (loop [b 1\n c 1]\n (if (\u003E b k)\n c\n (recur (inc b) (* (/ (- a b) b) c))))))\n\n(defn -binomial\n \"A Java-callable wrapper around the 'binomial' function.\"\n [n k]\n (binomial n k))\n\n(defn -main []\n (println (str \"(binomial 5 3): \" (binomial 5 3)))\n (println (str \"(binomial 10042 111): \" (binomial 10042 111))))\n\n\n;; Calling from Java\nimport com.domain.tiny;\n\npublic class Main {\n\n public static void main(String[] args) {\n System.out.println(\"(binomial 5 3): \" + tiny.binomial(5, 3));\n System.out.println(\"(binomial 10042, 111): \" + tiny.binomial(10042, 111));\n }\n}\n\n\n;; The result was:\n(binomial 5 3): 10.0\n(binomial 10042, 111): 4.9068389575068143E263\n\n\n;; Example was borrowed from clartaq @ Stack Overflow","created-at":1285031740000,"updated-at":1285486378000,"_id":"542692cac026201cdc326b76"},{"author":{"login":"remleduff","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/f14b40211cdc07185c43edf8f4bd7a5b?r=PG&default=identicon"},"editors":[{"login":"remleduff","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/f14b40211cdc07185c43edf8f4bd7a5b?r=PG&default=identicon"},{"login":"remleduff","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/f14b40211cdc07185c43edf8f4bd7a5b?r=PG&default=identicon"},{"login":"remleduff","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/f14b40211cdc07185c43edf8f4bd7a5b?r=PG&default=identicon"},{"login":"remleduff","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/f14b40211cdc07185c43edf8f4bd7a5b?r=PG&default=identicon"}],"body":";; Create a namespace named demo.namespace.\n(ns demo.namespace)\n\n;; Clojure recommends namespaces be at least \"two segments\" (ie, they should have at least one '.') otherwise it will create a class in the \"default package\", which is discouraged.\n\n;; If this declaration appears in a file named \"demo/namespace.clj\" present in your classpath, it is known as a \"lib\", \"demo/namespace.clj\" is the lib's \"root resource\". See http://clojure.org/libs\n\n;; From a clean repl you can load the lib using\nuser=\u003E(require 'demo.namespace) \n; or\nuser=\u003E(use 'demo.namespace)","created-at":1288999353000,"updated-at":1289001495000,"_id":"542692cac026201cdc326b79"},{"author":{"login":"remleduff","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/f14b40211cdc07185c43edf8f4bd7a5b?r=PG&default=identicon"},"editors":[{"login":"remleduff","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/f14b40211cdc07185c43edf8f4bd7a5b?r=PG&default=identicon"},{"login":"remleduff","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/f14b40211cdc07185c43edf8f4bd7a5b?r=PG&default=identicon"},{"login":"remleduff","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/f14b40211cdc07185c43edf8f4bd7a5b?r=PG&default=identicon"},{"login":"remleduff","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/f14b40211cdc07185c43edf8f4bd7a5b?r=PG&default=identicon"}],"body":";; This example will illustrate changing between namespaces at the repl\n\n;; At the repl, the ns macro can be used to create a namespace, but it is used to change the current namespace (be careful of typos)\nuser=\u003E(ns demo.namespace)\nnil\ndemo.namespace=\u003E ; The prompt at the repl is now \"demo.namespace\" reflecting that the current namespace is no longer \"user\".\n\n;; Add a new function to demo.namespace\ndemo.namespace=\u003E(defn foo [] (prn \"Hello from demo.namespace\"))\n#'demo.namespace/foo\n\n;; From within \"demo.namespace\" we can use foo without qualifying it\ndemo.namespace=\u003E(foo)\n\"Hello from demo.namespace\"\nnil\n\n;; Switch back to the \"user\" namespace\ndemo.namespace=\u003E(ns user)\nnil\n\n;; We can no longer use \"foo\" without qualification\nuser=\u003E (foo)\njava.lang.Exception: Unable to resolve symbol: foo in this context (NO_SOURCE_FILE:4)\n\nuser=\u003E (demo.namespace/foo)\n\"Hello from demo.namespace\"\nnil\n\n;; The public symbols of \"demo.namespace\" can be \"referred into\" the \"user\" namespace if desired\nuser=\u003E (refer 'demo.namespace)\nnil\n\n;; foo is now an alias in the \"user\" namespace which refers to the \"demo.namespace/foo\" symbol\nuser=\u003E (foo)\n\"Hello from demo.namespace\"\nnil","created-at":1289000535000,"updated-at":1289001111000,"_id":"542692cac026201cdc326b7e"},{"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"editors":[],"body":"(ns rosettacode.24game\n (:require [clojure.string :as str])\n (:use clojure.test))\n\n(deftest test\n (is (= \"ABC\" (str/capitalize \"abc\")))","created-at":1289383303000,"updated-at":1289383303000,"_id":"542692cac026201cdc326b83"},{"author":{"login":"scode","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/87b4fd6e7ac86cbf1f1b683f7856057?r=PG&default=identicon"},"editors":[],"body":";; Multiple required namespaces with aliases\n(ns demo.namespace\n (:require [com.example.httplib :as httplib]\n [com.example.otherlib :as otherlib]))\n","created-at":1297670267000,"updated-at":1297670267000,"_id":"542692cac026201cdc326b84"},{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"Dmitry Kakurin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/85b70be5da433a6adf5112e7140848da?r=PG&default=identicon"},{"login":"Dmitry Kakurin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/85b70be5da433a6adf5112e7140848da?r=PG&default=identicon"}],"body":";; In clojure 1.4 and higher you can use the refer function from within\n;; a require which is equivalent to (:use foo only [...]) but still \n;; allows you to reference the required namespace:\n(ns my.ns.example\n (:require [my.lib :refer [function1 function2]]))\n\n;; And :refer :all is equivalent to :use :\n(ns my.ns.example\n (:require [my.lib :refer :all]))\n","created-at":1340687963000,"updated-at":1357904913000,"_id":"542692d4c026201cdc327014"},{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[],"body":"(ns foo.bar\n (:refer-clojure :exclude [ancestors printf])\n (:require [clojure.contrib sql sql.tests])\n (:use [my.lib this that])\n (:import [java.util Date Timer Random]\n (java.sql Connection Statement)))","created-at":1358656144000,"updated-at":1358656144000,"_id":"542692d4c026201cdc327017"}],"macro":true,"notes":[{"updated-at":1291628686000,"body":"Good description of use/require/import here:\r\n\r\nhttp://blog.8thlight.com/articles/2010/12/6/clojure-libs-and-namespaces-require-use-import-and-ns","created-at":1291628686000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fac"}],"arglists":["name docstring? attr-map? references*"],"doc":"Sets *ns* to the namespace named by name (unevaluated), creating it\n if needed. references can be zero or more of: (:refer-clojure ...)\n (:require ...) (:use ...) (:import ...) (:load ...) (:gen-class)\n with the syntax of refer-clojure/require/use/import/load/gen-class\n respectively, except the arguments are unevaluated and need not be\n quoted. (:gen-class ...), when supplied, defaults to :name\n corresponding to the ns name, :main true, :impl-ns same as ns, and\n :init-impl-ns true. All options of gen-class are\n supported. The :gen-class directive is ignored when not\n compiling. If :gen-class is not supplied, when compiled only an\n nsname__init.class will be generated. If :refer-clojure is not used, a\n default (refer 'clojure.core) is used. Use of ns is preferred to\n individual calls to in-ns/require/use/import:\n\n (ns foo.bar\n (:refer-clojure :exclude [ancestors printf])\n (:require (clojure.contrib sql combinatorics))\n (:use (my.lib this that))\n (:import (java.util Date Timer Random)\n (java.sql Connection Statement)))","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/ns"},{"added":"1.0","ns":"clojure.core","name":"symbol","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1289212889000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"var","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d00"},{"created-at":1289212892000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"var?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d01"},{"created-at":1331269623000,"author":{"login":"franks42","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b3ee701dd6c481e5d310467ddfe62c48?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"symbol?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d02"},{"created-at":1331269707000,"author":{"login":"franks42","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b3ee701dd6c481e5d310467ddfe62c48?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"name","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d03"},{"created-at":1331269713000,"author":{"login":"franks42","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b3ee701dd6c481e5d310467ddfe62c48?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"namespace","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d04"},{"created-at":1350410406000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"keyword","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d05"}],"line":591,"examples":[{"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":";; Returns a symbol with the given namespace and name.\n;;\n;; (symbol name): name can be a string or a symbol.\n;;\n;; (symbol ns name): ns and name must both be strings.\n;;\n;; A symbol string begins with a non-numeric character and can contain\n;; alphanumeric characters and *, +, !, -, _, and ?. (see\n;; http://clojure.org/reader for details).\n;;\n;; symbol does not validate input strings for ns and name, and may return\n;; improper symbols with undefined behavior for non-conformant ns and\n;; name.\n\nuser=\u003E (symbol 'foo)\nfoo\n\nuser=\u003E (symbol \"foo\")\nfoo\n\nuser=\u003E (symbol \"clojure.core\" \"foo\")\nclojure.core/foo\n","created-at":1280546541000,"updated-at":1331646095000,"_id":"542692c8c026201cdc326a06"},{"author":{"login":"franks42","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b3ee701dd6c481e5d310467ddfe62c48?r=PG&default=identicon"},"editors":[{"login":"rafmagana","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/40bd727b22d74930f292b63d45a71b07?r=PG&default=identicon"}],"body":";; some gotchas to be aware of:\n\nuser=\u003E (symbol \"user\" 'abc)\nClassCastException clojure.lang.Symbol cannot be cast to java.lang.String clojure.core/symbol (core.clj:523)\n\nuser=\u003E (symbol *ns* \"abc\")\nClassCastException clojure.lang.Namespace cannot be cast to java.lang.String clojure.core/symbol (core.clj:523)\n\nuser=\u003E (symbol 'user \"abc\")\nClassCastException clojure.lang.Symbol cannot be cast to java.lang.String clojure.core/symbol (core.clj:523)\n\n\n;; Warning - the following generated symbols are non-conformant and may wreak\n;; serious havoc in the near/far future when least expected...\n\nuser=\u003E (symbol \"abc def\")\nabc def\n\nuser=\u003E (symbol \"123def\")\n123def\n\nuser=\u003E (symbol \"/123/def/ghi\")\n/123/def/ghi\n\nuser=\u003E (symbol \"/abc/def/ghi\")\n/abc/def/ghi","created-at":1331680187000,"updated-at":1406075648000,"_id":"542692d5c026201cdc3270a0"},{"body":";; but keywords and numbers are not names\n(symbol 3)\n;; Long cannot be cast to String\n\n;; ... and so they cannot be converted to symbols\n(symbol :dog) \n;; Keyword cannot be cast to String","author":{"login":"phreed","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/211644?v=2"},"created-at":1412434976752,"updated-at":1412435184005,"editors":[{"login":"phreed","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/211644?v=2"}],"_id":"54300c20e4b05f4d257a29a3"}],"notes":null,"tag":"clojure.lang.Symbol","arglists":["name","ns name"],"doc":"Returns a Symbol with the given namespace and name. Arity-1 works\n on strings, keywords, and vars.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/symbol"},{"added":"1.0","ns":"clojure.core","name":"to-array-2d","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1375613655000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"to-array","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521eac"}],"line":4029,"examples":[{"author":{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user\u003E (def a (to-array-2d [[1 2 3][4 5 6]]))\n#'user/a\nuser\u003E (alength a)\n2\nuser\u003E (alength (aget a 0))\n3\nuser\u003E (aget a 0 0)\n1\nuser\u003E (aget a 0 1)\n2\nuser\u003E (aget a 0 2)\n3\nuser\u003E (aget a 1 0)\n4\nuser\u003E (aget a 2 0)\n→ ERROR\nnil\n\nuser\u003E ","created-at":1307740341000,"updated-at":1325519043000,"_id":"542692cac026201cdc326b5b"},{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[],"body":";; quick example of a ragged array where the length of each element of the \n;; 2d array is unique\n\nuser=\u003E (def a (to-array-2d [[0][1 2][3 4 5][6 7 8 9]]))\n#'user/a\nuser=\u003E (map alength [(aget a 0)(aget a 1)(aget a 2)])\n(1 2 3)\nuser=\u003E","created-at":1313976771000,"updated-at":1313976771000,"_id":"542692cac026201cdc326b5d"}],"notes":null,"tag":"[[Ljava.lang.Object;","arglists":["coll"],"doc":"Returns a (potentially-ragged) 2-dimensional array of Objects\n containing the contents of coll, which can be any Collection of any\n Collection.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/to-array-2d"},{"added":"1.0","ns":"clojure.core","name":"mod","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1305751254000,"author":{"login":"Kototama","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a54a4dc204925d397ca010b9a332e74d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"rem","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e34"}],"line":3592,"examples":[{"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"editors":[{"login":"jeffmad","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c526ef2dcf52b0cf18875fcb5616cee0?r=PG&default=identicon"},{"login":"jeffmad","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c526ef2dcf52b0cf18875fcb5616cee0?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (mod 10 5)\n0\n\nuser=\u003E (mod 10 6)\n4\n\nuser=\u003E (mod 10 10)\n0\n\nuser=\u003E (mod 10 -1)\n0\n\n;; The mod function is defined as the amount by which a number exceeds the largest integer multiple of the divisor that is not greater than that number.\n;; The largest integer multiple of 5 not greater than -2 is 5 * -1 = -5. The amount by which -2 exceeds -5 is 3. \n;;\nuser=\u003E (mod -2 5) \n3","created-at":1279992236000,"updated-at":1412229945831,"_id":"542692cec026201cdc326d7d"}],"notes":[{"updated-at":1314955596000,"body":"The difference between **rem** and **mod** can be remembered by noting that **mod** always returns a value between 0 and div.","created-at":1314955596000,"author":{"login":"wdkrnls","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/6d08a2f792f289b95fe1d982d4133d71?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fc8"},{"updated-at":1350500565000,"body":"I am confused by the comment about the definition on lines 13+ of the example - which is not accurate when invoking mod when 'num' is positive and 'div' negative. Applying the definition to \u003Cpre\u003E(mod 10 -3)\u003C/pre\u003E we have \r\n\u003Cli\u003E the largest multiple of -3 not exceeding 10 is 9, from using -3 as a multiplier\u003C/li\u003E\r\n\u003Cli\u003E however (mod 10 -3) yields -2, meaning that 10 exceeds the largest multiple not greater than 10 by -2 i.e. 10 - -2 = 12 is the largest multiple <= 10, a contradiction.\u003C/li\u003E\r\n\u003Cli\u003E therefore (mod 10 -3) should yield 1, not -2 \u003C/li\u003E\r\n\r\n\u003Ci\u003ESo unless I misunderstood\u003C/i\u003E, the definition should be changed to something like: \u003Cbr\u003E\r\n\u003Cp\u003E\"The mod function is defined as the amount by which a number exceeds the largest integer multiple of the divisor that is not greater than that number, \u003Ci\u003Eexcept when the number is positive and the divisor negative, in which case the result is the amount by which the number exceeds the smallest multiple that is not smaller than the number.\u003C/i\u003E\"\u003C/p\u003E\r\n\r\n\u003Cb\u003EOr, change the implementation to something similar to\u003C/b\u003E:\r\n\r\n\u003Cpre\u003E(defn mod-2\r\n\t [num div]\r\n\t (let [m (rem num div)]\r\n\t (if (or (zero? m) (= (pos? num) (pos? div)))\r\n\t \tm\r\n\t \t(if (pos? div) (+ m div) m)))) \r\n\u003C/pre\u003E\r\n\t \t\r\nto fit the current definition.","created-at":1350430293000,"author":{"login":"kingcode","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3d7dd4232cb043d2a3efd99e08ff0983?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fef"}],"arglists":["num div"],"doc":"Modulus of num and div. Truncates toward negative infinity.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/mod"},{"added":"1.0","ns":"clojure.core","name":"amap","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1342853671000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"areduce","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d8d"},{"created-at":1346930905000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"map","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d8e"}],"line":5302,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"(def an-array (int-array 25000 (int 0)))\n\nuser=\u003E (time (amap ^ints an-array \n idx \n ret \n (+ (int 1) \n (aget ^ints an-array idx))))\n\n\"Elapsed time: 14.708653 msecs\"\n\n;; Note: without type hinting the performance of would not be good.","created-at":1281078010000,"updated-at":1285495171000,"_id":"542692ccc026201cdc326c51"}],"macro":true,"notes":null,"arglists":["a idx ret expr"],"doc":"Maps an expression across an array a, using an index named idx, and\n return value named ret, initialized to a clone of a, then setting \n each element of ret to the evaluation of expr, returning the new \n array ret.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/amap"},{"added":"1.0","ns":"clojure.core","name":"pop","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1366675885000,"author":{"login":"jjcomer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ef581bba2f97adb539c67a35465b3e1b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"peek","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e4d"},{"created-at":1399433581000,"author":{"login":"Yun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/f18708f979ad613ab134cb5002558965?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"rest","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e4e"},{"created-at":1400493789000,"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"conj","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e4f"}],"line":1481,"examples":[{"author":{"login":"pkolloch","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/10b2fd3c0a4cc46dc241a48468dc551?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (peek [1 2 3])\n3\nuser=\u003E (pop [1 2 3])\n[1 2]\nuser=\u003E (peek '(1 2 3))\n1\nuser=\u003E (pop '(1 2 3))\n(2 3)","created-at":1282321157000,"updated-at":1332951332000,"_id":"542692cec026201cdc326db5"}],"notes":[{"updated-at":1349888752000,"body":"Small reminder:\r\n\r\n\u003Cbr\u003E\r\nDo not work for arbitrary seq but just for persistent types implementing clojure.lang.IPersistentStack (like clojure.lang.Persistent*).\r\n\r\n\u003Cbr\u003E\r\nExample:\r\n\u003Cpre\u003Euser> (pop (cons 1 '()))\r\n; Evaluation aborted.\r\n\u003C/pre\u003E\r\ndo not work because type is clojure.lang.Cons but\r\n\r\n\u003Cpre\u003Euser> (pop (conj '() 1))\r\n()\r\n\u003C/pre\u003E\r\nworks because type is clojure.lang.PersistentList.","created-at":1349885055000,"author":{"login":"tomby42","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/305033855efb82d6041586b874b5bb24?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521feb"}],"arglists":["coll"],"doc":"For a list or queue, returns a new list/queue without the first\n item, for a vector, returns a new vector without the last item. If\n the collection is empty, throws an exception. Note - not the same\n as next/butlast.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/pop"},{"added":"1.0","ns":"clojure.core","name":"use","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1284770251000,"author":{"login":"rbolkey","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d537f88b794c220d6ce447add22c12a7?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"refer","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dd2"},{"created-at":1284770260000,"author":{"login":"rbolkey","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d537f88b794c220d6ce447add22c12a7?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"require","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dd3"},{"created-at":1289380610000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ns","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dd4"},{"created-at":1291628646000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"import","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dd5"}],"line":6156,"examples":[{"author":{"login":"scode","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/87b4fd6e7ac86cbf1f1b683f7856057?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; Use the namespace clojure.java.io:\nuser=\u003E (use '(clojure.java io))\n\n","created-at":1279160083000,"updated-at":1285497782000,"_id":"542692cfc026201cdc326e03"},{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"clizzin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/555813697e5dc358bb27d5efd3ffa23?r=PG&default=identicon"}],"body":";; Imports only the split function from clojure.string.\nuser=\u003E (use '[clojure.string :only (split)])\nnil\n\n;; split is now available without a namespace qualification.\nuser=\u003E (split \"hello world\" #\" \")\n[\"hello\" \"world\"]\n\n;; You can also add the :as keyword to import the rest of clojure.string\n;; with a namespace qualification.\nuser=\u003E (use '[clojure.string :as s :only (split)])\nnil\n\n;; Now we can access any function in clojure.string using s.\nuser=\u003E (s/replace \"foobar\" \"foo\" \"squirrel\")\n\"squirrelbar\"\n\n;; And we can still call split with or without the s qualification.\nuser=\u003E (split \"hello world\" #\" \")\n[\"hello\" \"world\"]\nuser=\u003E (s/split \"hello world\" #\" \")\n[\"hello\" \"world\"]","created-at":1279596076000,"updated-at":1294233809000,"_id":"542692cfc026201cdc326e05"},{"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"editors":[{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"}],"body":"(ns some.namespace\n (:require [clojure.contrib.json :as json])\n (:use [clojure.string :only [trim lower-case split]]\n [clojure.contrib.shell-out]\n [clojure.pprint]\n [clojure.test]))\n","created-at":1291021620000,"updated-at":1338424818000,"_id":"542692cfc026201cdc326e08"}],"notes":[{"updated-at":1291628658000,"body":"Good description of use/require/import here:\r\n\r\nhttp://blog.8thlight.com/articles/2010/12/6/clojure-libs-and-namespaces-require-use-import-and-ns","created-at":1291628658000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fab"},{"updated-at":1318868130000,"body":"http://blog.8thlight.com/colin-jones/2010/12/05/clojure-libs-and-namespaces-require-use-import-and-ns.html","created-at":1318868130000,"author":{"login":"vikbehal","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b773242b82712096e51f5f6aed5f9abd?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fd0"}],"arglists":["& args"],"doc":"Like 'require, but also refers to each lib's namespace using\n clojure.core/refer. Use :use in the ns macro in preference to calling\n this directly.\n\n 'use accepts additional options in libspecs: :exclude, :only, :rename.\n The arguments and semantics for :exclude, :only, and :rename are the same\n as those documented for clojure.core/refer.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/use"},{"ns":"clojure.core","name":"unquote","file":"clojure/core.clj","type":"var","column":1,"see-alsos":[{"created-at":1319196053000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unquote-splicing","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d5d"}],"line":13,"examples":[{"author":{"login":"huahaiy","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/889685?v=2"},"editors":[{"login":"huahaiy","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/889685?v=2"}],"body":"user=\u003E (let [x 2]\n `(1 x 3))\n(1 user/x 3)\n\nuser=\u003E (let [x 2]\n `(1 ~x 3))\n(1 2 3)\n","created-at":1305077398000,"updated-at":1305077465000,"_id":"542692cec026201cdc326d76"},{"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"editors":[],"body":"user=\u003E `(1 (dec 3) 3)\n\n(1 (clojure.core/dec 3) 3)\n\nuser =\u003E `(1 ~(dec 3) 3)\n\n(1 2 3)","created-at":1319196729000,"updated-at":1319196729000,"_id":"542692d5c026201cdc3270af"}],"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core/unquote"},{"added":"1.0","ns":"clojure.core","name":"declare","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1336168390000,"author":{"login":"gavilancomun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/f4b1f93f88e052f9eb412a8791b6ddf1?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"def","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c7e"}],"line":2793,"examples":[{"author":{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (defn foo []\n (undefined-func))\n; Evaluation aborted. Unable to resolve symbol: undefined-func in this context\nnil\n\nuser=\u003E (declare undefined-func)\n#'user/undefined-func\n\nuser=\u003E (defn foo []\n (undefined-func))\n#'user/foo\n","created-at":1279161281000,"updated-at":1285500741000,"_id":"542692cdc026201cdc326d18"},{"author":{"login":"lu4nx","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4acdafde2cbf672ee0389cf8016378?r=PG&default=identicon"},"editors":[{"login":"lu4nx","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4acdafde2cbf672ee0389cf8016378?r=PG&default=identicon"}],"body":"user=\u003E (declare show)\n#'user/show\nuser=\u003E (defn welcome [user-name] (prn (show) user-name))\n#'user/welcome\nuser=\u003E (defn show [] (prn \"welcome \"))\n#'user/show\nuser=\u003E (welcome \"lu4nx\")\n\"welcome \"\nnil \"lu4nx\"\nnil\nuser=\u003E ","created-at":1385992546000,"updated-at":1385992606000,"_id":"542692d2c026201cdc326f78"}],"macro":true,"notes":null,"arglists":["& names"],"doc":"defs the supplied var names with no bindings, useful for making forward declarations.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/declare"},{"added":"1.1","ns":"clojure.core","name":"dissoc!","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1329969087000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"assoc!","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ea9"}],"line":3407,"examples":[{"author":{"login":"ghoseb","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8aa4490274249db8981283bdadb2ec2b?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":";; dissoc! works on a transient map\n\n;; WARNING: Below is an example of what is called \"bashing in place\" of\n;; a transient, and is _NOT_ the correct way to use transients. See assoc!\n;; examples for some discussion of the reason.\n\n(let [my-map (transient {:x 1 :y 2 :z 3})]\n (dissoc! my-map :x) ; mistake is to use my-map below, not dissoc! return val\n (persistent! my-map)) ; returns persistent map {:y 2 :z 3}\n\n\n;; Here is a correct way to do the operation described above:\n\n(let [my-map (transient {:x 1 :y 2 :z 3})\n x (dissoc! my-map :x)] ; after this, don't use my-map again, only x\n (persistent! x)) ; returns persistent map {:y 2 :z 3}","created-at":1293728413000,"updated-at":1329969418000,"_id":"542692cbc026201cdc326c15"}],"notes":null,"arglists":["map key","map key & ks"],"doc":"Returns a transient map that doesn't contain a mapping for key(s).","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/dissoc!"},{"added":"1.2","ns":"clojure.core","name":"reductions","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1289800579000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"reduce","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b07"}],"line":7362,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (reductions + [1 1 1 1])\n(1 2 3 4)\nuser=\u003E (reductions + [1 2 3])\n(1 3 6)\n\n;; This is just like reduce except that the calculation is collected during the reduce.\nuser=\u003E (assert (= (reduce + [1 2 3]) \n (last (reductions + [1 2 3]))))\nnil\n","created-at":1281363432000,"updated-at":1285494988000,"_id":"542692cbc026201cdc326baa"}],"notes":null,"arglists":["f coll","f init coll"],"doc":"Returns a lazy seq of the intermediate values of the reduction (as\n per reduce) of coll by f, starting with init.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/reductions"},{"added":"1.0","ns":"clojure.core","name":"aset-byte","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":4002,"examples":[{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[],"body":";; create an array of 10 bytes and set one of the values to 127\n\nuser=\u003E (def bs (byte-array 10))\n#'user/bs\nuser=\u003E (vec bs)\n[0 0 0 0 0 0 0 0 0 0]\nuser=\u003E (aset-byte bs 2 127)\n127\nuser=\u003E (vec bs)\n[0 0 127 0 0 0 0 0 0 0]\nuser=\u003E","created-at":1313914294000,"updated-at":1313914294000,"_id":"542692c6c026201cdc32692c"}],"notes":null,"arglists":["array idx val","array idx idx2 & idxv"],"doc":"Sets the value at the index/indices. Works on arrays of byte. Returns val.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/aset-byte"},{"added":"1.9","ns":"clojure.core","name":"indexed?","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":6340,"examples":null,"notes":null,"arglists":["coll"],"doc":"Return true if coll implements Indexed, indicating efficient lookup by index","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/indexed_q"},{"added":"1.1","ns":"clojure.core","name":"ref-history-count","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1329984882000,"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ref-min-history","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521eb6"},{"created-at":1329984893000,"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ref-max-history","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521eb7"},{"created-at":1364770223000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ref","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521eb8"}],"line":2480,"examples":[{"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (def store (ref {}))\n#'user/store\nuser=\u003E (ref-history-count store)\n0\nuser=\u003E (ref-max-history store)\n10\nuser=\u003E (ref-min-history store)\n0","created-at":1329984988000,"updated-at":1329984988000,"_id":"542692d5c026201cdc327069"}],"notes":null,"arglists":["ref"],"doc":"Returns the history count of a ref","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/ref-history-count"},{"added":"1.2","ns":"clojure.core","name":"-","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1351919398000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"-'","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d20"}],"line":1045,"examples":[{"author":{"login":"MrHus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4fa262299223e58030e9062d97224547?r=PG&default=identicon"},"editors":[{"login":"MrHus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4fa262299223e58030e9062d97224547?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (- 1)\n-1 \nuser=\u003E (- 6 3) \n3\nuser=\u003E (- 10 3 2) \n5","created-at":1279418306000,"updated-at":1332950680000,"_id":"542692c8c026201cdc326a4f"}],"notes":null,"arglists":["x","x y","x y & more"],"doc":"If no ys are supplied, returns the negation of x, else subtracts\n the ys from x and returns the result. Does not auto-promote\n longs, will throw on overflow. See also: -'","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/-"},{"added":"1.1","ns":"clojure.core","name":"assoc!","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1324959540000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"dissoc!","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521a8d"},{"created-at":1324959556000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"transient","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521a8e"},{"created-at":1327875049000,"author":{"login":"ghoseb","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8aa4490274249db8981283bdadb2ec2b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"conj!","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521a8f"}],"line":3394,"examples":[{"author":{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"},"editors":[{"login":"ghoseb","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8aa4490274249db8981283bdadb2ec2b?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":";; The key concept to understand here is that transients are \n;; not meant to be `bashed in place`; always use the value \n;; returned by either assoc! or other functions that operate\n;; on transients.\n\n(defn merge2\n \"An example implementation of `merge` using transients.\"\n [x y]\n (persistent! (reduce\n (fn [res [k v]] (assoc! res k v))\n (transient x)\n y)))\n\n;; Why always use the return value, and not the original? Because the return\n;; value might be a different object than the original. The implementation\n;; of Clojure transients in some cases changes the internal representation\n;; of a transient collection (e.g. when it reaches a certain size). In such\n;; cases, if you continue to try modifying the original object, the results\n;; will be incorrect.\n\n;; Think of transients like persistent collections in how you write code to\n;; update them, except unlike persistent collections, the original collection\n;; you passed in should be treated as having an undefined value. Only the return\n;; value is predictable.","created-at":1307739385000,"updated-at":1329969063000,"_id":"542692c8c026201cdc326a21"}],"notes":null,"arglists":["coll key val","coll key val & kvs"],"doc":"When applied to a transient map, adds mapping of key(s) to\n val(s). When applied to a transient vector, sets the val at index.\n Note - index must be \u003C= (count vector). Returns coll.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/assoc!"},{"added":"1.0","ns":"clojure.core","name":"hash-set","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":391,"examples":[{"author":{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},"editors":[{"login":"rafael","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7adbf4434f63cedd463196b652fa7a44?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"clojureking","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/92625b8a6be91bb8c688d0d07b4e2a32?r=PG&default=identicon"}],"body":"user=\u003E (hash-set 1 2 1 3 1 4 1 5)\n#{1 2 3 4 5}\n\nuser=\u003E (= (hash-set :c :a :b) #{:b :a :c})\ntrue \n\n\nuser=\u003E (hash-set (seq \"Lorem ipsum dolor sit amet\"))\n#{(\\L \\o \\r \\e \\m \\space \\i \\p \\s \\u \\m \\space \\d \\o \\l \\o \\r \\space \\s \\i \\t \\space \\a \\m \\e \\t)} \n\nuser=\u003E (apply hash-set (seq \"Lorem ipsum dolor sit amet\"))\n#{\\space \\a \\d \\e \\i \\L \\l \\m \\o \\p \\r \\s \\t \\u} \n","created-at":1280503618000,"updated-at":1409426792000,"_id":"542692c6c026201cdc326931"}],"notes":null,"arglists":["","& keys"],"doc":"Returns a new hash set with supplied keys. Any equal keys are\n handled as if by repeated uses of conj.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/hash-set"},{"added":"1.4","ns":"clojure.core","name":"reduce-kv","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":6989,"examples":null,"notes":null,"arglists":["f init coll"],"doc":"Reduces an associative collection. f should be a function of 3\n arguments. Returns the result of applying f to init, the first key\n and the first value in coll, then applying f to that result and the\n 2nd key and value, etc. If coll contains no entries, returns init\n and f is not called. Note that reduce-kv is supported on vectors,\n where the keys will be the ordinals.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/reduce-kv"},{"added":"1.0","ns":"clojure.core","name":"or","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1300530940000,"author":{"login":"j1n3l0","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/6db7c6ecdbe97a1e844c88ecf587f61f?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"and","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c42"},{"created-at":1334293978000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"if","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c43"}],"line":856,"examples":[{"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"editors":[],"body":"user\u003E (or true false false)\ntrue\n\nuser\u003E (or true true true)\ntrue\n\nuser\u003E (or false false false)\nfalse\n\nuser\u003E (or nil nil)\nnil\n\nuser\u003E (or false nil)\nnil\n\nuser\u003E (or true nil)\ntrue\n\n;; or doesn't evaluate if the first value is true\nuser\u003E (or true (println \"foo\"))\ntrue\n\n;; order matters\nuser\u003E (or (println \"foo\") true)\nfoo\ntrue","created-at":1293673853000,"updated-at":1293673853000,"_id":"542692cbc026201cdc326bc3"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[],"body":";; See examples for \"if\" explaining Clojure's idea of logical true\n;; and logical false.","created-at":1334293981000,"updated-at":1334293981000,"_id":"542692d4c026201cdc327022"}],"macro":true,"notes":null,"arglists":["","x","x & next"],"doc":"Evaluates exprs one at a time, from left to right. If a form\n returns a logical true value, or returns that value and doesn't\n evaluate any of the other expressions, otherwise it returns the\n value of the last expression. (or) returns nil.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/or"},{"added":"1.0","ns":"clojure.core","name":"cast","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":348,"examples":[{"author":{"login":"Victor","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bc41ebab54cc0e0fbe99d753876d45ce?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (cast Integer 1) \n1\n","created-at":1289541716000,"updated-at":1289541716000,"_id":"542692cdc026201cdc326ccd"}],"notes":null,"arglists":["c x"],"doc":"Throws a ClassCastException if x is not a c, else returns x.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/cast"},{"added":"1.0","ns":"clojure.core","name":"reset!","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1324098243000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"swap!","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ee4"},{"created-at":1360265917000,"author":{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"compare-and-set!","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ee5"},{"created-at":1360265926000,"author":{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"atom","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ee6"}],"line":2393,"examples":[{"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"editors":[{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"\u003Cpre\u003Euser=> (def x (atom 10))\r\n#'user/x\r\n\r\nuser=> @x\r\n10\r\n\r\nuser=> (reset! x 20)\r\n20\r\n\r\nuser=> @x\r\n20\r\n\u003C/pre\u003E","created-at":1281850260000,"updated-at":1281854550000,"_id":"542692ccc026201cdc326cb0"}],"notes":null,"arglists":["atom newval"],"doc":"Sets the value of atom to newval without regard for the\n current value. Returns newval.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/reset!"},{"added":"1.0","ns":"clojure.core","name":"name","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1385200415000,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"namespace","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ca3"}],"line":1604,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"rafmagana","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/40bd727b22d74930f292b63d45a71b07?r=PG&default=identicon"}],"body":"user=\u003E (name :x)\n\"x\"\n\nuser=\u003E (name \"x\")\n\"x\"\n\nuser=\u003E (name 'x)\n\"x\"","created-at":1280319438000,"updated-at":1406075702000,"_id":"542692cbc026201cdc326b9a"}],"notes":null,"tag":"java.lang.String","arglists":["x"],"doc":"Returns the name String of a string, symbol or keyword.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/name"},{"added":"1.0","ns":"clojure.core","name":"ffirst","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1343067219000,"author":{"login":"john.r.woodward","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/22b6fbc4a386291e45b1cb4449377086?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"first","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521a7f"},{"created-at":1348637462000,"author":{"login":"dansalmo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e33ee460f5f61bc5ba9b598934766215?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"fnext","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521a80"},{"created-at":1348637521000,"author":{"login":"dansalmo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e33ee460f5f61bc5ba9b598934766215?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"nfirst","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521a81"}],"line":100,"examples":[{"author":{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},"editors":[{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (ffirst '([]))\nnil \n\nuser=\u003E (ffirst ['(a b c) '(b a c)])\na \n\nuser=\u003E (ffirst '([a b c] [b a c]))\na","created-at":1280345631000,"updated-at":1332951869000,"_id":"542692cbc026201cdc326bba"},{"author":{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (first {:b 2 :a 1 :c 3})\n[:b 2] \n\nuser=\u003E (ffirst {:b 2 :a 1 :c 3})\n:b","created-at":1280345657000,"updated-at":1332951883000,"_id":"542692cbc026201cdc326bbd"}],"notes":null,"arglists":["x"],"doc":"Same as (first (first x))","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/ffirst"},{"added":"1.0","ns":"clojure.core","name":"sorted-set","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1317095643000,"author":{"login":"pauldoo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5cb916d3c8abc9f45a093209e72489fb?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"sorted-set-by","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c6b"},{"created-at":1330671694000,"author":{"login":"Chouser","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7a0192050ed6488670acfd3f59405c10?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"subseq","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c6c"},{"created-at":1330671698000,"author":{"login":"Chouser","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7a0192050ed6488670acfd3f59405c10?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"rsubseq","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c6d"},{"created-at":1330671734000,"author":{"login":"Chouser","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7a0192050ed6488670acfd3f59405c10?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"sorted-map","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c6e"}],"line":419,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[],"body":"\u003Cpre\u003E\r\nuser=\u003E (sorted-set 3 2 1)\r\n#{1 2 3}\r\nuser=\u003E (sorted-set 3 2 1 1)\r\n#{1 2 3}\r\n\u003C/pre\u003E","created-at":1280319522000,"updated-at":1280319522000,"_id":"542692cfc026201cdc326e6f"}],"notes":null,"arglists":["& keys"],"doc":"Returns a new sorted set with supplied keys. Any equal keys are\n handled as if by repeated uses of conj.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/sorted-set"},{"added":"1.0","ns":"clojure.core","name":"counted?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":6318,"examples":[{"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (counted? [:a :b :c])\ntrue\n\nuser=\u003E (counted? '(:a :b :c))\ntrue\n\nuser=\u003E (counted? {:a 1 :b 2 :c 3})\ntrue\n\nuser=\u003E (counted? #{:a :b :c})\ntrue\n\nuser=\u003E (counted? \"asdf\")\nfalse\n\nuser=\u003E (counted? (into-array Integer/TYPE [1 2 3]))\nfalse","created-at":1286508818000,"updated-at":1286508818000,"_id":"542692cac026201cdc326b0c"}],"notes":null,"arglists":["coll"],"doc":"Returns true if coll implements count in constant time","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/counted_q"},{"added":"1.1","ns":"clojure.core","name":"byte-array","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":5346,"examples":[{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"}],"body":";; create an array of bytes\n;; and demonstrate that you can use it in the standard Java fill function\n;; note the needed byte coercion in the fill function call\n\nuser=\u003E (def bees (byte-array 10))\n#'user/bees\n\nuser=\u003E (for [i (range 10)](aset-byte bees i (* i i)))\n(0 1 4 9 16 25 36 49 64 81)\n\nuser=\u003E (vec bees)\n[0 1 4 9 16 25 36 49 64 81]\n\nuser=\u003E (java.util.Arrays/fill bees (byte 122))\nnil\nuser=\u003E (vec bees)\n[122 122 122 122 122 122 122 122 122 122]\nuser=\u003E","created-at":1313959908000,"updated-at":1313962959000,"_id":"542692cec026201cdc326d67"}],"notes":null,"arglists":["size-or-seq","size init-val-or-seq"],"doc":"Creates an array of bytes","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/byte-array"},{"added":"1.11","ns":"clojure.core","name":"parse-double","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":8179,"examples":null,"notes":null,"arglists":["s"],"doc":"Parse string with floating point components and return a Double value,\n or nil if parse fails.\n\n Grammar: https://docs.oracle.com/javase/8/docs/api/java/lang/Double.html#valueOf-java.lang.String-","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/parse-double"},{"added":"1.7","ns":"clojure.core","name":"tagged-literal","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":7963,"examples":null,"notes":null,"arglists":["tag form"],"doc":"Construct a data representation of a tagged literal from a\n tag symbol and a form.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/tagged-literal"},{"added":"1.0","ns":"clojure.core","name":"println","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1290672953000,"author":{"login":"dale","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a7a1eca257c6cea943fea41e5cc3e9a3?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"prn","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ae2"},{"created-at":1302236980000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"print","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ae3"},{"created-at":1374264342000,"author":{"login":"lbeschastny","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/416170465e4045f810f09a9300dda4dd?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"println-str","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ae4"}],"line":3759,"examples":[{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"cloojure","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1ad3de25d00d953de6e8c82f554cdbf5?r=PG&default=identicon"},{"login":"cloojure","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1ad3de25d00d953de6e8c82f554cdbf5?r=PG&default=identicon"},{"login":"cloojure","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1ad3de25d00d953de6e8c82f554cdbf5?r=PG&default=identicon"}],"body":"user=\u003E (println \"Hello world.\")\nHello world.\nnil\n\nuser=\u003E (def items [ \"hello\" :a 1 (list :b 2) \\c {:d 4} #{5 6 7} ])\n#'user/items\n\n; println is for human-readable output, like a report. Note the lack of quotes around the string \"hello\" and the unescaped letter \"c\". \nuser=\u003E (println items)\n[hello :a 1 (:b 2) c {:d 4} #{5 6 7}]\nnil\n\n; prn outputs items in a machine-readable format, such as in a source\n; file. Note the double-quotes around the string \"hello\" and the escaped letter \"c\".\nuser=\u003E (prn items)\n[\"hello\" :a 1 (:b 2) \\c {:d 4} #{5 6 7}]\nnil\n\n; pr-str produces a string with escaped punctuation, so that println yields the same result as the original prn call.\nuser=\u003E (println (pr-str items))\n[\"hello\" :a 1 (:b 2) \\c {:d 4} #{5 6 7}]\nnil\n\n; Calling println w/o args outputs a newline and nothing else.\nuser=\u003E (println)\n\nnil\n; The newline function does the same.\nuser=\u003E (newline)\n\nnil\nuser=\u003E","created-at":1280776981000,"updated-at":1402400141000,"_id":"542692cec026201cdc326d9a"}],"notes":null,"arglists":["& more"],"doc":"Same as print followed by (newline)","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/println"},{"added":"1.2","ns":"clojure.core","name":"extend-type","file":"clojure/core_deftype.clj","type":"macro","column":1,"see-alsos":[{"created-at":1336757561000,"author":{"login":"Cosmi","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/10f2eae92de67116fa98d06ec55fcf29?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"extend","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521be8"},{"created-at":1351471424000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"extend-protocol","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521be9"},{"created-at":1351471431000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"defprotocol","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bea"}],"line":848,"examples":[{"author":{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"},"editors":[],"body":";;; This is a library for the shopping result.\n\n(defrecord Banana [qty])\n\n;;; 'subtotal' differ from each fruit.\n\n(defprotocol Fruit\n (subtotal [item]))\n\n(extend-type Banana\n Fruit\n (subtotal [item]\n (* 158 (:qty item))))\n\n;;; Please see the term of 'reify'.","created-at":1315674061000,"updated-at":1315674061000,"_id":"542692cbc026201cdc326bc2"}],"macro":true,"notes":null,"arglists":["t & specs"],"doc":"A macro that expands into an extend call. Useful when you are\n supplying the definitions explicitly inline, extend-type\n automatically creates the maps required by extend. Propagates the\n class as a type hint on the first argument of all fns.\n\n (extend-type MyType \n Countable\n (cnt [c] ...)\n Foo\n (bar [x y] ...)\n (baz ([x] ...) ([x y & zs] ...)))\n\n expands into:\n\n (extend MyType\n Countable\n {:cnt (fn [c] ...)}\n Foo\n {:baz (fn ([x] ...) ([x y & zs] ...))\n :bar (fn [x y] ...)})","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/extend-type"},{"added":"1.0","ns":"clojure.core","name":"macroexpand-1","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1284957759000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"macroexpand","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b13"},{"created-at":1289586228000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.walk","name":"macroexpand-all","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b14"}],"line":4044,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (macroexpand-1 '(defstruct mystruct[a b]))\n(def mystruct (clojure.core/create-struct [a b]))\n","created-at":1286272779000,"updated-at":1286272779000,"_id":"542692cbc026201cdc326ba7"},{"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (macroexpand-1 '(-\u003E c (+ 3) (* 2)))\n(clojure.core/-\u003E (clojure.core/-\u003E c (+ 3)) (* 2))","created-at":1339248839000,"updated-at":1339248839000,"_id":"542692d4c026201cdc326ffa"}],"notes":null,"arglists":["form"],"doc":"If form represents a macro form, returns its expansion,\n else returns form.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/macroexpand-1"},{"added":"1.0","ns":"clojure.core","name":"assoc-in","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1291975376000,"author":{"login":"alimoeeny","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e8dd06976ead4082d2181f3807117e1?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"assoc","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ac6"},{"created-at":1302248543000,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.core","name":"update-in","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ac7"},{"created-at":1318010528000,"author":{"login":"jks","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/de50bee3396570d25f900873303c98f1?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"get-in","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ac9"}],"line":6224,"examples":[{"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (def users [{:name \"James\" :age 26} {:name \"John\" :age 43}])\n \nuser=\u003E (assoc-in users [1 :age] 44)\n[{:name \"James\", :age 26} {:name \"John\", :age 44}]\n\nuser=\u003E (assoc-in users [1 :password] \"nhoJ\")\n[{:name \"James\", :age 26} {:password \"nhoJ\", :name \"John\", :age 43}]\n\n;; Also (assoc m 2 {...}) or (conj m {...})\nuser=\u003E (assoc-in users [2] {:name \"Jack\" :age 19}) \n[{:name \"James\", :age 26} {:name \"John\", :age 43} {:name \"Jack\", :age 19}]\n\n\n\n\n;; From http://clojure-examples.appspot.com/clojure.core/assoc-in","created-at":1278953901000,"updated-at":1285503732000,"_id":"542692cac026201cdc326b38"},{"author":{"login":"devth","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/70c7535cbb9fea0353250a4edda155be?r=PG&default=identicon"},"editors":[],"body":"(def ppl (atom {\"persons\" {\"joe\" {:age 1}}}))\n(swap! ppl assoc-in [\"persons\" \"bob\"] {:age 11})\n\n@ppl\n{\"persons\" {\"joe\" {:age 1}, \"bob\" {:age 11}}}","created-at":1378880124000,"updated-at":1378880124000,"_id":"542692d2c026201cdc326f4c"},{"body":"; be careful with that empty path sequence, it's seldom what you want\nuser=\u003E (assoc-in {} [] {:k :v})\n{nil {:k :v}}","author":{"login":"pmbauer","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/453580?v=2"},"created-at":1412006606316,"updated-at":1412006606316,"_id":"542982cee4b09282a148f203"}],"notes":null,"arglists":["m [k & ks] v"],"doc":"Associates a value in a nested associative structure, where ks is a\n sequence of keys and v is the new value and returns a new nested structure.\n If any levels do not exist, hash-maps will be created.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/assoc-in"},{"added":"1.0","ns":"clojure.core","name":"char-name-string","file":"clojure/core_print.clj","type":"var","column":1,"see-alsos":[{"created-at":1375209941000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"char-escape-string","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b76"}],"line":342,"examples":[{"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (char-name-string \\newline)\n\"newline\"","created-at":1375209966000,"updated-at":1375209966000,"_id":"542692d2c026201cdc326f5f"}],"notes":null,"tag":"java.lang.String","arglists":[],"doc":"Returns name string for char or nil if none","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/char-name-string"},{"added":"1.0","ns":"clojure.core","name":"bit-test","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1405720487000,"author":{"login":"phreed","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3a0c739cf289be18be932dc3022e6fd3?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"bit-set","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cac"},{"created-at":1405720498000,"author":{"login":"phreed","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3a0c739cf289be18be932dc3022e6fd3?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"bit-shift-left","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cad"},{"created-at":1405720509000,"author":{"login":"phreed","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3a0c739cf289be18be932dc3022e6fd3?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"bit-xor","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cae"}],"line":1363,"examples":[{"author":{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},"editors":[{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (bit-test 2r1001 0)\ntrue \n\nuser=\u003E (bit-test 2r1001 1)\nfalse \n\nuser=\u003E (bit-test 2r1001 7)\nfalse","created-at":1280338595000,"updated-at":1332953129000,"_id":"542692cfc026201cdc326e7c"}],"notes":null,"arglists":["x n"],"doc":"Test bit at index n","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/bit-test"},{"added":"1.0","ns":"clojure.core","name":"defmethod","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1285162546000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"defmulti","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b40"},{"created-at":1341270386000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"remove-method","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b41"},{"created-at":1341270389000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"remove-all-methods","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b42"},{"created-at":1341270393000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"prefers","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b43"},{"created-at":1341270396000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"methods","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b44"},{"created-at":1341270398000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"get-method","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b45"}],"line":1800,"examples":[{"author":{"login":"Victor","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bc41ebab54cc0e0fbe99d753876d45ce?r=PG&default=identicon"},"editors":[],"body":"(defmulti service-charge (fn [acct] [(account-level acct) (:tag acct)]))\n(defmethod service-charge [::acc/Basic ::acc/Checking] [_] 25)\n(defmethod service-charge [::acc/Basic ::acc/Savings] [_] 10)\n(defmethod service-charge [::acc/Premium ::acc/Account] [_] 0)","created-at":1290489730000,"updated-at":1290489730000,"_id":"542692c7c026201cdc3269cb"},{"author":{"login":"Victor","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bc41ebab54cc0e0fbe99d753876d45ce?r=PG&default=identicon"},"editors":[],"body":";this example illustrates that the dispatch type\n;does not have to be a symbol, but can be anything (in this case, it's a string)\n\n(defmulti greeting\n (fn[x] (x \"language\")))\n\n;params is not used, so we could have used [_]\n(defmethod greeting \"English\" [params]\n \"Hello!\")\n\n(defmethod greeting \"French\" [params]\n \"Bonjour!\")\n\n;then can use this like this:\n(def english-map {\"id\" \"1\", \"language\" \"English\"})\n(def french-map {\"id\" \"2\", \"language\" \"French\"})\n\n=\u003E(greeting english-map)\n\"Hello!\"\n=\u003E(greeting french-map)\n\"Bounjour!\"\n","created-at":1290492873000,"updated-at":1290492873000,"_id":"542692c7c026201cdc3269cc"},{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[],"body":";; Methods can be given a name. Very useful in stack traces.\n(defmethod foo \"a\" name-of-method [params] \"was a\")\n","created-at":1308205150000,"updated-at":1308205150000,"_id":"542692c7c026201cdc3269cd"}],"macro":true,"notes":null,"arglists":["multifn dispatch-val & fn-tail"],"doc":"Creates and installs a new method of multimethod associated with dispatch-value. ","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/defmethod"},{"added":"1.10","ns":"clojure.core","name":"requiring-resolve","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":6145,"examples":null,"notes":null,"arglists":["sym"],"doc":"Resolves namespace-qualified sym per 'resolve'. If initial resolve\nfails, attempts to require sym's namespace and retries.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/requiring-resolve"},{"ns":"clojure.core","name":"EMPTY-NODE","file":"clojure/gvec.clj","type":"var","column":1,"see-alsos":null,"line":20,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core/EMPTY-NODE"},{"added":"1.0","ns":"clojure.core","name":"time","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":null,"line":3910,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[],"body":"user\u003E (time (Thread/sleep 100))\n\"Elapsed time: 100.284772 msecs\"\nnil","created-at":1286871374000,"updated-at":1286871374000,"_id":"542692c6c026201cdc326908"},{"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"editors":[],"body":";when working with lazy seqs\n(time (doall (...)))","created-at":1289011003000,"updated-at":1289011003000,"_id":"542692c6c026201cdc326909"},{"author":{"login":"Omer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/dae0f434afde5246ccb030cdec81fb71?r=PG&default=identicon"},"editors":[{"login":"Omer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/dae0f434afde5246ccb030cdec81fb71?r=PG&default=identicon"}],"body":";; Time how long it takes to write a string to a file 100 times\n(defn time-test []\n (with-open [w (writer \"test.txt\" :append false)]\n (dotimes [_ 100]\n (.write w \"I am being written to a file.\"))))\n\n\nuser=\u003E (time (time-test))\n\"Elapsed time: 19.596371 msecs\"","created-at":1338273583000,"updated-at":1338273812000,"_id":"542692d5c026201cdc3270a6"},{"author":{"login":"micrub","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c649274329369f1a7a4869e29655e058?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (time (Thread/sleep 1000))\n\"Elapsed time: 1000.267483 msecs\"\nnil\nuser=\u003E (with-out-str (time (Thread/sleep 1000)))\n\"\\\"Elapsed time: 1010.12942 msecs\\\"\\n\"\n\n","created-at":1400389644000,"updated-at":1400389644000,"_id":"542692d5c026201cdc3270a8"}],"macro":true,"notes":null,"arglists":["expr"],"doc":"Evaluates expr and prints the time it took. Returns the value of\n expr.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/time"},{"added":"1.0","ns":"clojure.core","name":"memoize","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1358780692000,"author":{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"delay","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d2a"}],"line":6414,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; First we define a function that presumably have some expensive computation.\nuser=\u003E (defn myfunc[a] (println \"doing some work\") (+ a 10))\n#'user/myfunc\n\n;; Next we create a memoized version of the function.\nuser=\u003E (def myfunc-memo (memoize myfunc))\n#'user/myfunc-memo\n\n\n;; The first time we call the function with a particular argument the\n;; original function is invoked and the value is returned. The next\n;; time the function is called with the same argument the cached result\n;; is returned and the original function is NOT called.\n\nuser=\u003E (myfunc-memo 1)\ndoing some work\n11\nuser=\u003E (myfunc-memo 1)\n11\nuser=\u003E (myfunc-memo 20)\ndoing some work\n30\nuser=\u003E (myfunc-memo 20)\n30\n","created-at":1280909609000,"updated-at":1285495306000,"_id":"542692ccc026201cdc326c75"}],"notes":null,"arglists":["f"],"doc":"Returns a memoized version of a referentially transparent function. The\n memoized version of the function keeps a cache of the mapping from arguments\n to results and, when calls with the same arguments are repeated often, has\n higher performance at the expense of higher memory use.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/memoize"},{"added":"1.0","ns":"clojure.core","name":"alter-meta!","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1375212992000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"vary-meta","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bd0"},{"created-at":1375213001000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"with-meta","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bd1"}],"line":2423,"examples":null,"notes":null,"arglists":["iref f & args"],"doc":"Atomically sets the metadata for a namespace/var/ref/agent/atom to be:\n\n (apply f its-current-meta args)\n\n f must be free of side-effects","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/alter-meta!"},{"added":"1.1","ns":"clojure.core","name":"future?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1339251269000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"future","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ef5"}],"line":6609,"examples":[{"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"editors":[{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"}],"body":"user=\u003E (def f (future (inc 0)))\n#'user/f\n\nuser=\u003E (future? f)\ntrue\n\nuser=\u003E (future? 1)\nfalse\n","created-at":1339251424000,"updated-at":1339251441000,"_id":"542692d3c026201cdc326fb9"}],"notes":null,"arglists":["x"],"doc":"Returns true if x is a future","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/future_q"},{"added":"1.0","ns":"clojure.core","name":"zero?","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1400618891000,"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"pos?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dde"},{"created-at":1400618896000,"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"neg?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ddf"}],"line":869,"examples":[{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"}],"body":"user=\u003E (zero? 0)\ntrue\nuser=\u003E (zero? 0.0)\ntrue\nuser=\u003E (zero? 1)\nfalse\nuser=\u003E (zero? 0x0)\ntrue\nuser=\u003E (zero? 3.14159265358M)\nfalse\nuser=\u003E (zero? (/ 1 2))\nfalse","created-at":1279075455000,"updated-at":1335332526000,"_id":"542692c8c026201cdc326a6d"}],"notes":null,"arglists":["num"],"doc":"Returns true if num is zero, else false","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/zero_q"},{"added":"1.9","ns":"clojure.core","name":"simple-keyword?","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":1652,"examples":null,"notes":null,"arglists":["x"],"doc":"Return true if x is a keyword without a namespace","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/simple-keyword_q"},{"added":"1.0","ns":"clojure.core","name":"require","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1281451664000,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.core","name":"remove-ns","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bf3"},{"created-at":1291628612000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"import","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bf4"},{"created-at":1291628619000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"use","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bf5"},{"created-at":1358655983000,"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ns","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bf6"}],"line":6066,"examples":[{"author":{"login":"scode","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/87b4fd6e7ac86cbf1f1b683f7856057?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; Require clojure.java.io and call its file function:\n\nuser=\u003E (require '(clojure.java io))\nuser=\u003E (clojure.java.io/file \"filename\")\n#<File filename>","created-at":1279160245000,"updated-at":1285487630000,"_id":"542692ccc026201cdc326cb8"},{"author":{"login":"teyc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bd6e62afb4881ab0f617611b8b65d003?r=PG&default=identicon"},"editors":[{"login":"teyc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bd6e62afb4881ab0f617611b8b65d003?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"Victor","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bc41ebab54cc0e0fbe99d753876d45ce?r=PG&default=identicon"},{"login":"Victor","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bc41ebab54cc0e0fbe99d753876d45ce?r=PG&default=identicon"}],"body":";; alias clojure.java.io as io\nuser=\u003E (require '[clojure.java.io :as io])\nnil\n\nuser=\u003E (io/file \"Filename\")\n#\u003CFile Filename\u003E\n\n;; alias clojure.java.io as io using prefixes\nuser=\u003E (require '(clojure.java [io :as io2])\nnil\n\nuser=\u003E (io2/file \"Filename\")\n#\u003CFile Filename\u003E","created-at":1283923768000,"updated-at":1289545242000,"_id":"542692ccc026201cdc326cbb"},{"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"editors":[],"body":"(ns rosettacode.24game\n (:require [clojure.string :as str]))\n\n(defn parse-infix-data\n \"input '1+2+3+4'\n output (1 + 2 + 3 + 4)\n where the numbers are clojure numbers, and the symbols are clojure operators\"\n [string] (map read-string (next (str/split string #\"\"))))","created-at":1289382235000,"updated-at":1289382235000,"_id":"542692ccc026201cdc326cc0"},{"author":{"login":"lambder","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1c0c20072f52de3a6335cae183b865f6?r=PG&default=identicon"},"editors":[],"body":"(require '(clojure.contrib [sql :as sql]))","created-at":1314991093000,"updated-at":1314991093000,"_id":"542692ccc026201cdc326cc1"},{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[{"login":"nickgieschen","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cbfa20635c9269675d54547c080c9b64?r=PG&default=identicon"}],"body":"(ns myproject.core\n (:use [clojure.core] :reload)\n (:require [clojure.string :as str :refer [replace]] :reload-all))\n\n(str/replace \"foo\" #\"o\" \"e\")\n\"fee\"","created-at":1358655968000,"updated-at":1376964466000,"_id":"542692d5c026201cdc327072"}],"notes":[{"updated-at":1291628629000,"body":"Good description of use/require/import here:\r\n\r\nhttp://blog.8thlight.com/articles/2010/12/6/clojure-libs-and-namespaces-require-use-import-and-ns","created-at":1291628629000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521faa"}],"arglists":["& args"],"doc":"Loads libs, skipping any that are already loaded. Each argument is\n either a libspec that identifies a lib, a prefix list that identifies\n multiple libs whose names share a common prefix, or a flag that modifies\n how all the identified libs are loaded. Use :require in the ns macro\n in preference to calling this directly.\n\n Libs\n\n A 'lib' is a named set of resources in classpath whose contents define a\n library of Clojure code. Lib names are symbols and each lib is associated\n with a Clojure namespace and a Java package that share its name. A lib's\n name also locates its root directory within classpath using Java's\n package name to classpath-relative path mapping. All resources in a lib\n should be contained in the directory structure under its root directory.\n All definitions a lib makes should be in its associated namespace.\n\n 'require loads a lib by loading its root resource. The root resource path\n is derived from the lib name in the following manner:\n Consider a lib named by the symbol 'x.y.z; it has the root directory\n \u003Cclasspath\u003E/x/y/, and its root resource is \u003Cclasspath\u003E/x/y/z.clj, or\n \u003Cclasspath\u003E/x/y/z.cljc if \u003Cclasspath\u003E/x/y/z.clj does not exist. The\n root resource should contain code to create the lib's\n namespace (usually by using the ns macro) and load any additional\n lib resources.\n\n Libspecs\n\n A libspec is a lib name or a vector containing a lib name followed by\n options expressed as sequential keywords and arguments.\n\n Recognized options:\n :as takes a symbol as its argument and makes that symbol an alias to the\n lib's namespace in the current namespace.\n :as-alias takes a symbol as its argument and aliases like :as, however\n the lib will not be loaded. If the lib has not been loaded, a new\n empty namespace will be created (as with create-ns).\n :refer takes a list of symbols to refer from the namespace or the :all\n keyword to bring in all public vars.\n\n Prefix Lists\n\n It's common for Clojure code to depend on several libs whose names have\n the same prefix. When specifying libs, prefix lists can be used to reduce\n repetition. A prefix list contains the shared prefix followed by libspecs\n with the shared prefix removed from the lib names. After removing the\n prefix, the names that remain must not contain any periods.\n\n Flags\n\n A flag is a keyword.\n Recognized flags: :reload, :reload-all, :verbose\n :reload forces loading of all the identified libs even if they are\n already loaded (has no effect on libspecs using :as-alias)\n :reload-all implies :reload and also forces loading of all libs that the\n identified libs directly or indirectly load via require or use\n (has no effect on libspecs using :as-alias)\n :verbose triggers printing information about each load, alias, and refer\n\n Example:\n\n The following would load the libraries clojure.zip and clojure.set\n abbreviated as 's'.\n\n (require '(clojure zip [set :as s]))","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/require"},{"added":"1.0","ns":"clojure.core","name":"unchecked-dec-int","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":1177,"examples":null,"notes":null,"arglists":["x"],"doc":"Returns a number one less than x, an int.\n Note - uses a primitive operator subject to overflow.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/unchecked-dec-int"},{"added":"1.1","ns":"clojure.core","name":"persistent!","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1286870194000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"transient","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521a86"}],"line":3375,"examples":[{"author":{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"},"editors":[],"body":"user\u003E (def foo (transient [1 2 3]))\n#'user/foo\nuser\u003E foo\n#\u003CTransientVector clojure.lang.PersistentVector$TransientVector@12c9b4d1\u003E\nuser\u003E (persistent! foo)\n[1 2 3]\nuser\u003E foo\n#\u003CTransientVector clojure.lang.PersistentVector$TransientVector@12c9b4d1\u003E\nuser\u003E (conj! foo 4)\n→ ERROR:Transient used after persistent! call\nuser\u003E (persistent! foo)\n→ ERROR: Transient used after persistent! call","created-at":1307739912000,"updated-at":1307739912000,"_id":"542692cdc026201cdc326d20"}],"notes":null,"arglists":["coll"],"doc":"Returns a new, persistent version of the transient collection, in\n constant time. The transient collection cannot be used after this\n call, any such use will throw an exception.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/persistent!"},{"added":"1.0","ns":"clojure.core","name":"nnext","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":121,"examples":[{"author":{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},"editors":[],"body":"\u003Cpre\u003Euser=> (nnext '(1 2 3))\r\n(3)\r\n\u003C/pre\u003E\r\n\r\n\u003Cpre\u003Euser=> (nnext [])\r\nnil \r\n\u003C/pre\u003E\r\n\r\n\u003Cpre\u003Euser=> (nnext ['(a b c) '(b a c) '(c b a) '(a c b)])\r\n((c b a) (a c b)) \r\n\u003C/pre\u003E\r\n\r\n\u003Cpre\u003Euser=> (nnext {:a 1, :b 2, :c 3, :d 4})\r\n([:c 3] [:d 4]) \r\n\u003C/pre\u003E\r\n\r\n\u003Cpre\u003Euser=> (nnext #{:a :b :c})\r\n(:c)\r\n\u003C/pre\u003E\r\n","created-at":1281033362000,"updated-at":1281033362000,"_id":"542692cbc026201cdc326ba1"}],"notes":null,"arglists":["x"],"doc":"Same as (next (next x))","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/nnext"},{"added":"1.0","ns":"clojure.core","name":"add-watch","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1331138866000,"author":{"login":"pjlegato","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4ce55cfd8b3ae2f63f5ecbc8fc1c05d4?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"remove-watch","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e04"}],"line":2161,"examples":[{"author":{"login":"devijvers","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/81018e4231ac1ce8b7a9e6d377092656?r=PG&default=identicon"},"editors":[{"login":"devijvers","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/81018e4231ac1ce8b7a9e6d377092656?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"Daniel Brotsky","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/afb394be4b0eb5fc369a2fdbfea0a236?r=PG&default=identicon"}],"body":";; Add useful context to watcher function:\n(defn watch-agent [_agent context]\n (let [watch-fn (fn [_context _key _ref old-value new-value] ;...\n )] \n (add-watch _agent nil (partial watch-fn context))))\n","created-at":1279390260000,"updated-at":1356749167000,"_id":"542692c6c026201cdc326935"},{"author":{"login":"Daniel Brotsky","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/afb394be4b0eb5fc369a2fdbfea0a236?r=PG&default=identicon"},"editors":[{"login":"Daniel Brotsky","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/afb394be4b0eb5fc369a2fdbfea0a236?r=PG&default=identicon"},{"login":"avasenin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2918eef190b9952940232b30a4f5541d?r=PG&default=identicon"}],"body":";; timing of agent actions and watches using nrepl (ymmv)\nuser\u003E (def a (agent 0))\n#'user/a\nuser\u003E a\n#\u003CAgent@2bd9c3e7: 0\u003E\nuser\u003E (add-watch a :key (fn [k r os ns] (print k r os ns)))\n#\u003CAgent@2bd9c3e7: 0\u003E\nuser\u003E (send a inc)\n:key #\u003CAgent@2bd9c3e7: 1\u003E 0 1\n#\u003CAgent@2bd9c3e7: 1\u003E\nuser\u003E a\n:key #\u003CAgent@2bd9c3e7: 2\u003E 1 2\n#\u003CAgent@2bd9c3e7: 2\u003E\n","created-at":1356749543000,"updated-at":1358869311000,"_id":"542692d1c026201cdc326f45"}],"notes":null,"arglists":["reference key fn"],"doc":"Adds a watch function to an agent/atom/var/ref reference. The watch\n fn must be a fn of 4 args: a key, the reference, its old-state, its\n new-state. Whenever the reference's state might have been changed,\n any registered watches will have their functions called. The watch fn\n will be called synchronously, on the agent's thread if an agent,\n before any pending sends if agent or ref. Note that an atom's or\n ref's state may have changed again prior to the fn call, so use\n old/new-state rather than derefing the reference. Note also that watch\n fns may be called from multiple threads simultaneously. Var watchers\n are triggered only by root binding changes, not thread-local\n set!s. Keys must be unique per reference, and can be used to remove\n the watch with remove-watch, but are otherwise considered opaque by\n the watch mechanism.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/add-watch"},{"added":"1.0","ns":"clojure.core","name":"not-every?","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1315793146000,"author":{"login":"wdkrnls","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/6d08a2f792f289b95fe1d982d4133d71?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"every?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b10"},{"created-at":1315793156000,"author":{"login":"wdkrnls","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/6d08a2f792f289b95fe1d982d4133d71?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"not-any?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b11"},{"created-at":1315793166000,"author":{"login":"wdkrnls","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/6d08a2f792f289b95fe1d982d4133d71?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"some","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b12"}],"line":2701,"examples":[{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (not-every? odd? '(1 2 3))\ntrue\nuser=\u003E (not-every? odd? '(1 3))\nfalse","created-at":1279074566000,"updated-at":1332950344000,"_id":"542692ccc026201cdc326c92"}],"notes":null,"tag":"java.lang.Boolean","arglists":["pred coll"],"doc":"Returns false if (pred x) is logical true for every x in\n coll, else true.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/not-every_q"},{"added":"1.0","ns":"clojure.core","name":"class?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1357883124000,"author":{"login":"Dmitry Kakurin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/85b70be5da433a6adf5112e7140848da?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"class","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f40"}],"line":5496,"examples":[{"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (class? 1)\nfalse\n\nuser=\u003E (class? java.lang.String)\ntrue\n\nuser=\u003E (class? [])\nfalse","created-at":1286508711000,"updated-at":1286508711000,"_id":"542692cac026201cdc326b16"}],"notes":null,"arglists":["x"],"doc":"Returns true if x is an instance of Class","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/class_q"},{"added":"1.0","ns":"clojure.core","name":"rem","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1305751179000,"author":{"login":"Kototama","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a54a4dc204925d397ca010b9a332e74d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"quot","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521de4"},{"created-at":1305751201000,"author":{"login":"Kototama","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a54a4dc204925d397ca010b9a332e74d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"mod","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521de5"}],"line":1283,"examples":[{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (rem 10 9)\n1\nuser=\u003E (rem 2 2)\n0","created-at":1279071638000,"updated-at":1332952568000,"_id":"542692c8c026201cdc3269df"},{"author":{"login":"OnesimusUnbound","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fa4c391db0d2d1744cc2cd0d787dd3d?r=PG&default=identicon"},"editors":[{"login":"popopome","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/f764e6667c2664b9979227fc40be024e?r=PG&default=identicon"},{"login":"popopome","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/f764e6667c2664b9979227fc40be024e?r=PG&default=identicon"},{"login":"iwilcox","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2cc6ed44aee2bf3d2d6064c941b1600a?r=PG&default=identicon"}],"body":";; rem and mod are commonly used to get the remainder.\n;; mod means Gaussian mod, so the result is always\n;; non-negative. Don't confuse it with ANSI C's %\n;; operator, which despite being although pronounced\n;; 'mod' actually implements rem, i.e. -10 % 3 = -1.\n\nuser=\u003E (mod -10 3)\n2\n\nuser=\u003E (rem -10 3)\n-1","created-at":1314221509000,"updated-at":1395347906000,"_id":"542692c8c026201cdc3269e1"}],"notes":null,"arglists":["num div"],"doc":"remainder of dividing numerator by denominator.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/rem"},{"added":"1.2","ns":"clojure.core","name":"agent-error","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1329375490000,"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"agent","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e79"},{"created-at":1329375495000,"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"restart-agent","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e7a"},{"created-at":1329375504000,"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"set-error-handler!","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e7b"}],"line":2186,"examples":[{"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"editors":[],"body":"(def tdate (agent (java.util.Date.)))\n\n@tdate\n=\u003E #\u003CDate Wed Feb 15 23:25:26 CET 2012\u003E\n\n(send tdate inc) ;;this has no meaning, rendering a (silent) error\n\n(agent-error tdate)\n=\u003E #\u003CClassCastException java.lang.ClassCastException: java.util.Date cannot be cast to java.lang.Number\u003E","created-at":1329375525000,"updated-at":1329375525000,"_id":"542692d1c026201cdc326f48"}],"notes":null,"arglists":["a"],"doc":"Returns the exception thrown during an asynchronous action of the\n agent if the agent is failed. Returns nil if the agent is not\n failed.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/agent-error"},{"added":"1.0","ns":"clojure.core","name":"some","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1302013833000,"author":{"login":"pauldoo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5cb916d3c8abc9f45a093209e72489fb?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"every?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b19"},{"created-at":1314584649000,"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"not-any?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b1a"},{"created-at":1333669222000,"author":{"login":"Radford Smith","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7db5c7bf2289ca4da17da34aef761283?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"keep","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b1b"},{"created-at":1333669233000,"author":{"login":"Radford Smith","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7db5c7bf2289ca4da17da34aef761283?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"keep-indexed","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b1c"},{"created-at":1374512423000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"some-fn","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b1d"}],"line":2709,"examples":[{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[],"body":"\u003Cpre\u003Euser=\u003E (some even? '(1 2 3 4))\r\ntrue\r\nuser=\u003E (some even? '(1 3 5 7))\r\nnil\u003C/pre\u003E","created-at":1279071879000,"updated-at":1279071879000,"_id":"542692c6c026201cdc32693b"},{"author":{"login":"devijvers","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/81018e4231ac1ce8b7a9e6d377092656?r=PG&default=identicon"},"editors":[],"body":"\u003Cpre\u003E\r\nuser=\u003E (some true? [false false false])\r\nnil\r\nuser=\u003E (some true? [false true false])\r\ntrue\r\nuser=\u003E (some true? [true true true])\r\ntrue\r\n\u003C/pre\u003E","created-at":1279402782000,"updated-at":1279402782000,"_id":"542692c6c026201cdc32693c"},{"author":{"login":"MrHus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4fa262299223e58030e9062d97224547?r=PG&default=identicon"},"editors":[],"body":"\u003Cpre\u003Euser=> (some #(= 5 %) [1 2 3 4 5])\r\ntrue\r\nuser=> (some #(= 5 %) [6 7 8 9 10])\r\nnil\u003C/pre\u003E","created-at":1279415908000,"updated-at":1279415908000,"_id":"542692c6c026201cdc32693d"},{"author":{"login":"jamesqiu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bc1268deaa7f2e78fe2b5ea76e6481d8?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (some #(when (even? %) %) '(1 2 3 4))\n2","created-at":1297541384000,"updated-at":1297541384000,"_id":"542692c6c026201cdc32693e"},{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (some {2 \"two\" 3 \"three\"} [nil 3 2])\n\"three\"","created-at":1310849563000,"updated-at":1310849563000,"_id":"542692c6c026201cdc32693f"},{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[],"body":";; some can be used as a substitute for (first (filter ...\n;; in most cases\n\nuser=\u003E (first (filter even? [1 2 3 4]))\n2\nuser=\u003E (some #(if (even? %) %) [1 2 3 4])\n2\nuser=\u003E","created-at":1314584832000,"updated-at":1314584832000,"_id":"542692c6c026201cdc326940"},{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"uvtc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/34f159f89cbd1d9beac0276f5a7af552?r=PG&default=identicon"}],"body":";; find a whether a word is in a list of words.\n(def word \"foo\")\n(some (partial = word) words)","created-at":1314782258000,"updated-at":1343769249000,"_id":"542692c6c026201cdc326941"},{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (some #{2} (range 0 10))\n2\n\nuser=\u003E (some #{200} (range 0 10))\nnil","created-at":1362705803000,"updated-at":1362705803000,"_id":"542692d5c026201cdc32708a"}],"notes":[{"updated-at":1351243602000,"body":"Be careful about using sets as predicates if you don't know what is in the set.\r\nIn particular, \u003Cpre\u003E(#{nil} nil)\u003C/pre\u003E is \u003Cpre\u003Enil\u003C/pre\u003E and \u003Cpre\u003E(#{false} false)\u003C/pre\u003E is \u003Cpre\u003Efalse\u003C/pre\u003E Consider using \u003Cpre\u003Econtains?\u003C/pre\u003E instead.","created-at":1351243602000,"author":{"login":"Sgeo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bf4e0e4e4f0b1f703b1372a8dd7b0735?r=PG&default=identicon"},"_id":"542692edf6e94c6970521ff3"}],"arglists":["pred coll"],"doc":"Returns the first logical true value of (pred x) for any x in coll,\n else nil. One common idiom is to use a set as pred, for example\n this will return :fred if :fred is in the sequence, otherwise nil:\n (some #{:fred} coll)","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/some"},{"added":"1.1","ns":"clojure.core","name":"future-cancelled?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1339251909000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"future","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521aa0"},{"created-at":1339251915000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"future?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521aa1"},{"created-at":1339251923000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"future-cancel","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521aa2"},{"created-at":1339251931000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"future-done?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521aa3"}],"line":7153,"examples":[{"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (def f (future (inc 0))) \n#'user/f\n\nuser=\u003E (future-cancel f) \nfalse\n\nuser=\u003E (future-cancelled? f)\nfalse\n\nuser=\u003E (future-done? f) \ntrue\n\nuser=\u003E @f \n1\n","created-at":1339251900000,"updated-at":1339251900000,"_id":"542692d3c026201cdc326fb5"},{"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (def f (future (Thread/sleep 5000) (inc 0)))\n#'user/f\n\nuser=\u003E (future-cancel f) \ntrue\n\nuser=\u003E (future-cancelled? f) \ntrue\n\nuser=\u003E (future-done? f) \ntrue\n\nuser=\u003E @f \njava.util.concurrent.CancellationException (NO_SOURCE_FILE:0)","created-at":1339252110000,"updated-at":1339252110000,"_id":"542692d3c026201cdc326fb6"}],"notes":null,"arglists":["f"],"doc":"Returns true if future f is cancelled","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/future-cancelled_q"},{"added":"1.0","ns":"clojure.core","name":"memfn","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":null,"line":3897,"examples":[{"author":{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},"editors":[{"login":"Dmitry Kakurin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/85b70be5da433a6adf5112e7140848da?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (def *files* (file-seq (java.io.File. \"/tmp/\")))\n#'user/*files*\nuser=\u003E (count (filter (memfn isDirectory) *files*))\n68\nuser=\u003E (count (filter #(.isDirectory %) *files*))\n68\n","created-at":1279241437000,"updated-at":1285500178000,"_id":"542692cac026201cdc326b0d"}],"macro":true,"notes":null,"arglists":["name & args"],"doc":"Expands into code that creates a fn that expects to be passed an\n object and any args and calls the named instance method on the\n object passing the args. Use when you want to treat a Java method as\n a first-class fn. name may be type-hinted with the method receiver's\n type in order to avoid reflective calls.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/memfn"},{"added":"1.9","ns":"clojure.core","name":"neg-int?","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":1428,"examples":null,"notes":null,"arglists":["x"],"doc":"Return true if x is a negative fixed precision integer","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/neg-int_q"},{"added":"1.0","ns":"clojure.core","name":"struct-map","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1283400432000,"author":{"login":"james","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4b163432c99a124feee4be046a3f9d66?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"struct","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c56"}],"line":4078,"examples":[{"author":{"login":"james","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4b163432c99a124feee4be046a3f9d66?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; create a new struct type\n(defstruct s :1 :2)\n#'user/s\n\nuser=\u003E (type s)\nclojure.lang.PersistentStructMap$Def\n\n;; create an instance of this new struct type\n(def s1 (struct s \"one\" \"two\"))\n#'user/s1\n\nuser=\u003E (println s1)\n{:1 \"one\", :2 \"two\"}\n\nuser=\u003E (type s1)\nclojure.lang.PersistentStructMap\n\n;; create a new struct instance that is based on the previous struct type\n;; with the option of supplying a new key/value pairs\n(def s2 (struct-map s :3 \"three\"))\n#'user/s2\n\nuser=\u003E (println s2)\n{:1 nil, :2 nil, :3 \"three\"}\n\nuser=\u003E (type s2)\nclojure.lang.PersistentStructMap\n","created-at":1283401838000,"updated-at":1285488890000,"_id":"542692ccc026201cdc326c94"}],"notes":null,"arglists":["s & inits"],"doc":"Returns a new structmap instance with the keys of the\n structure-basis. keyvals may contain all, some or none of the basis\n keys - where values are not supplied they will default to nil.\n keyvals can also contain keys not in the basis.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/struct-map"},{"added":"1.0","ns":"clojure.core","name":"drop","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1288872301000,"author":{"login":"jartur","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8eae7b45fd8d383bc1a49e24bee51c9b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"take","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521c99"},{"created-at":1288872352000,"author":{"login":"jartur","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8eae7b45fd8d383bc1a49e24bee51c9b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"drop-last","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521c9a"},{"created-at":1288872358000,"author":{"login":"jartur","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8eae7b45fd8d383bc1a49e24bee51c9b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"drop-while","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521c9b"},{"created-at":1306331554000,"author":{"login":"Dmitry Kakurin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/85b70be5da433a6adf5112e7140848da?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"nthnext","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521c9c"},{"created-at":1356088859000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"nthrest","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521c9d"}],"line":2926,"examples":[{"author":{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (drop -1 [1 2 3 4])\n(1 2 3 4) \n\nuser=\u003E (drop 0 [1 2 3 4])\n(1 2 3 4) \n\nuser=\u003E (drop 2 [1 2 3 4])\n(3 4) \n\nuser=\u003E (drop 5 [1 2 3 4])\n()","created-at":1280344844000,"updated-at":1332952687000,"_id":"542692cec026201cdc326da3"}],"notes":null,"arglists":["n","n coll"],"doc":"Returns a laziness-preserving sequence of all but the first n items in coll.\n Returns a stateful transducer when no collection is provided.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/drop"},{"added":"1.4","ns":"clojure.core","name":"*data-readers*","file":"clojure/core.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":7996,"examples":null,"notes":null,"arglists":[],"doc":"Map from reader tag symbols to data reader Vars.\n\n When Clojure starts, it searches for files named 'data_readers.clj'\n and 'data_readers.cljc' at the root of the classpath. Each such file\n must contain a literal map of symbols, like this:\n\n {foo/bar my.project.foo/bar\n foo/baz my.project/baz}\n\n The first symbol in each pair is a tag that will be recognized by\n the Clojure reader. The second symbol in the pair is the\n fully-qualified name of a Var which will be invoked by the reader to\n parse the form following the tag. For example, given the\n data_readers.clj file above, the Clojure reader would parse this\n form:\n\n #foo/bar [1 2 3]\n\n by invoking the Var #'my.project.foo/bar on the vector [1 2 3]. The\n data reader function is invoked on the form AFTER it has been read\n as a normal Clojure data structure by the reader.\n\n Reader tags without namespace qualifiers are reserved for\n Clojure. Default reader tags are defined in\n clojure.core/default-data-readers but may be overridden in\n data_readers.clj, data_readers.cljc, or by rebinding this Var.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/*data-readers*"},{"added":"1.0","ns":"clojure.core","name":"nth","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1303125578000,"author":{"login":"Havvy","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e799a79441c7543be48562403411cd13?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"first","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d83"},{"created-at":1303125582000,"author":{"login":"Havvy","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e799a79441c7543be48562403411cd13?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"second","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d84"},{"created-at":1303125660000,"author":{"login":"Havvy","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e799a79441c7543be48562403411cd13?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"nthnext","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d85"},{"created-at":1389744320000,"author":{"login":"jw0","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ca45063da41a9f3aa9028295d8b66d89?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"get","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d86"}],"line":891,"examples":[{"author":{"login":"MrHus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4fa262299223e58030e9062d97224547?r=PG&default=identicon"},"editors":[],"body":"\u003Cpre\u003E\r\nuser=> (nth [\"a\" \"b\" \"c\" \"d\"] 0) \r\n\"a\"\r\nuser=> (nth [\"a\" \"b\" \"c\" \"d\"] 1) \r\n\"b\"\r\nuser=> (nth [] 0 \"nothing found\")\r\n\"nothing found\"\r\nuser=> (nth [0 1 2] 77 1337)\r\n1337\r\n\u003C/pre\u003E","created-at":1279417427000,"updated-at":1279417427000,"_id":"542692cbc026201cdc326c10"}],"notes":null,"arglists":["coll index","coll index not-found"],"doc":"Returns the value at the index. get returns nil if index out of\n bounds, nth throws an exception unless not-found is supplied. nth\n also works for strings, Java arrays, regex Matchers and Lists, and,\n in O(n) time, for sequences.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/nth"},{"added":"1.0","ns":"clojure.core","name":"sorted?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1281961844000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"sorted-map","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521af9"},{"created-at":1281961850000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"sorted-set","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521afa"}],"line":6312,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (sorted? (sorted-set 5 3 1 2 4))\ntrue\nuser=\u003E (sorted? (sorted-map :a 1 :c 3 :b 2))\ntrue\n\n;; Note you can't just pass in a collection that happens to be sorted.\nuser=\u003E (sorted? [1 2 3 4 5])\nfalse\n","created-at":1281961832000,"updated-at":1285494525000,"_id":"542692c7c026201cdc326985"},{"author":{"login":"Alexey Tarasevich","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/43e0398b89022d32b43de4c968069312?r=PG&default=identicon"},"editors":[{"login":"Alexey Tarasevich","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/43e0398b89022d32b43de4c968069312?r=PG&default=identicon"}],"body":"=\u003E (sorted? (sort [1 2]))\nfalse","created-at":1385847625000,"updated-at":1385847666000,"_id":"542692d5c026201cdc327097"}],"notes":null,"arglists":["coll"],"doc":"Returns true if coll implements Sorted","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/sorted_q"},{"added":"1.0","ns":"clojure.core","name":"nil?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1365638069000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"identity","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c87"}],"line":438,"examples":[{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (nil? nil)\ntrue\nuser=\u003E (nil? 0)\nfalse\nuser=\u003E (nil? false)\nfalse","created-at":1279074467000,"updated-at":1332952587000,"_id":"542692c6c026201cdc326943"}],"notes":null,"tag":"java.lang.Boolean","arglists":["x"],"doc":"Returns true if x is nil, false otherwise.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/nil_q"},{"added":"1.2","ns":"clojure.core","name":"extend-protocol","file":"clojure/core_deftype.clj","type":"macro","column":1,"see-alsos":[{"created-at":1336670528000,"author":{"login":"Cosmi","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/10f2eae92de67116fa98d06ec55fcf29?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"extend","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b0a"},{"created-at":1336670535000,"author":{"login":"Cosmi","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/10f2eae92de67116fa98d06ec55fcf29?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"extend-type","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b0b"},{"created-at":1351471414000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"defprotocol","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b0c"}],"line":880,"examples":[{"author":{"login":"kevinjqiu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/696a8f13a7fcf0b4265fe801f18ba7b5?r=PG&default=identicon"},"editors":[{"login":"bmabey","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/1837?v=2"}],"body":"(defprotocol XmlNode\n (as-xml [this]))\n\n(defrecord User [^Integer id ^String name ^java.util.Date dob])\n\n; protocols can be extended to existing types and user defined types\n(extend-protocol XmlNode\n Integer\n (as-xml [this] (str this))\n String\n (as-xml [this] (identity this))\n java.util.Date\n (as-xml [this] (-\u003E (java.text.SimpleDateFormat. \"yyyy-MM-dd HH:mm:ss\") .format this))\n User\n (as-xml [this] (str \"\u003Cuser\u003E\"\n \"\u003Cid\u003E\" (as-xml (:id this)) \"\u003C/id\u003E\"\n \"\u003Cname\u003E\" (as-xml (:name this)) \"\u003C/name\u003E\"\n \"\u003Cdob\u003E\" (as-xml (:dob this)) \"\u003C/dob\u003E\")))","created-at":1298553541000,"updated-at":1304571501000,"_id":"542692cdc026201cdc326d08"}],"macro":true,"notes":null,"arglists":["p & specs"],"doc":"Useful when you want to provide several implementations of the same\n protocol all at once. Takes a single protocol and the implementation\n of that protocol for one or more types. Expands into calls to\n extend-type:\n\n (extend-protocol Protocol\n AType\n (foo [x] ...)\n (bar [x y] ...)\n BType\n (foo [x] ...)\n (bar [x y] ...)\n AClass\n (foo [x] ...)\n (bar [x y] ...)\n nil\n (foo [x] ...)\n (bar [x y] ...))\n\n expands into:\n\n (do\n (clojure.core/extend-type AType Protocol \n (foo [x] ...) \n (bar [x y] ...))\n (clojure.core/extend-type BType Protocol \n (foo [x] ...) \n (bar [x y] ...))\n (clojure.core/extend-type AClass Protocol \n (foo [x] ...) \n (bar [x y] ...))\n (clojure.core/extend-type nil Protocol \n (foo [x] ...) \n (bar [x y] ...)))","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/extend-protocol"},{"added":"1.0","ns":"clojure.core","name":"split-at","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1314290653000,"author":{"login":"Havvy","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e799a79441c7543be48562403411cd13?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"split-with","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f61"},{"created-at":1314291163000,"author":{"login":"Havvy","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e799a79441c7543be48562403411cd13?r=PG&default=identicon"},"to-var":{"ns":"clojure.string","name":"split","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f62"}],"line":3008,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (split-at 2 [1 2 3 4 5])\n[(1 2) (3 4 5)]","created-at":1281512425000,"updated-at":1332951434000,"_id":"542692c9c026201cdc326af7"}],"notes":null,"arglists":["n coll"],"doc":"Returns a vector of [(take n coll) (drop n coll)]","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/split-at"},{"added":"1.0","ns":"clojure.core","name":"*e","file":"clojure/core.clj","type":"var","column":1,"see-alsos":[{"created-at":1334156010000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.repl","name":"pst","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ad3"}],"dynamic":true,"line":6360,"examples":[{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (ns-refers) ;;Oops! we missed a namespace (ns-refers 'user)\n; Evaluation aborted.\n\nuser=\u003E *e\n#<CompilerException java.lang.IllegalArgumentException: Wrong number of args passed to: core$ns-refers (NO_SOURCE_FILE:0)>\n","created-at":1281462019000,"updated-at":1285494968000,"_id":"542692c9c026201cdc326af2"}],"notes":null,"arglists":[],"doc":"bound in a repl thread to the most recent exception caught by the repl","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/*e"},{"added":"1.0","ns":"clojure.core","name":"load-reader","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1350072969000,"author":{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"load-file","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bb9"}],"line":4108,"examples":[{"author":{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},"editors":[],"body":"(load-reader (java.io.FileReader. \"filename.clj\"))","created-at":1350072954000,"updated-at":1350072954000,"_id":"542692d4c026201cdc326ff5"}],"notes":null,"arglists":["rdr"],"doc":"Sequentially read and evaluate the set of forms contained in the\n stream/file","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/load-reader"},{"added":"1.7","ns":"clojure.core","name":"random-sample","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":7865,"examples":null,"notes":null,"arglists":["prob","prob coll"],"doc":"Returns items from coll with random probability of prob (0.0 -\n 1.0). Returns a transducer when no collection is provided.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/random-sample"},{"added":"1.5","ns":"clojure.core","name":"cond-\u003E","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1411998595433,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"cond-\u003E\u003E","library-url":"https://github.com/clojure/clojure"},"_id":"54296383e4b09282a148f1f5"},{"created-at":1411998602440,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"-\u003E","library-url":"https://github.com/clojure/clojure"},"_id":"5429638ae4b09282a148f1f6"},{"created-at":1411998615269,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"-\u003E\u003E","library-url":"https://github.com/clojure/clojure"},"_id":"54296397e4b09282a148f1f8"},{"created-at":1411998624770,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"as-\u003E","library-url":"https://github.com/clojure/clojure"},"_id":"542963a0e4b09282a148f1f9"},{"created-at":1411998631299,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"some-\u003E","library-url":"https://github.com/clojure/clojure"},"_id":"542963a7e4b09282a148f1fa"},{"created-at":1411998638842,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"some-\u003E\u003E","library-url":"https://github.com/clojure/clojure"},"_id":"542963aee4b09282a148f1fb"},{"created-at":1411998676919,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"cond","library-url":"https://github.com/clojure/clojure"},"_id":"542963d4e4b09282a148f1fc"}],"line":7730,"examples":null,"macro":true,"notes":null,"arglists":["expr & clauses"],"doc":"Takes an expression and a set of test/form pairs. Threads expr (via -\u003E)\n through each form for which the corresponding test\n expression is true. Note that, unlike cond branching, cond-\u003E threading does\n not short circuit after the first true test expression.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/cond-\u003E"},{"added":"1.0","ns":"clojure.core","name":"dotimes","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1327501844000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"repeat","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c5f"},{"created-at":1338272081000,"author":{"login":"Omer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/dae0f434afde5246ccb030cdec81fb71?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"for","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c60"},{"created-at":1340037835000,"author":{"login":"Parijat Mishra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e3aba44539a78ea92373418456f090e3?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"doseq","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c61"}],"line":3331,"examples":[{"author":{"login":"Brian Marick","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a523012f661f603806ab1c22d855216f?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (dotimes [n 5] (println \"n is\" n))\nn is 0\nn is 1\nn is 2\nn is 3\nn is 4\nnil","created-at":1278822115000,"updated-at":1332952709000,"_id":"542692c7c026201cdc3269c5"},{"author":{"login":"GyrosOfWar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8abc292bf5d9e88cfcbcfbe492774a38?r=PG&default=identicon"},"editors":[{"login":"GyrosOfWar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8abc292bf5d9e88cfcbcfbe492774a38?r=PG&default=identicon"},{"login":"GyrosOfWar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8abc292bf5d9e88cfcbcfbe492774a38?r=PG&default=identicon"},{"login":"GyrosOfWar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8abc292bf5d9e88cfcbcfbe492774a38?r=PG&default=identicon"}],"body":"user=\u003E (dotimes [n 10] (println (map #(* % (inc n)) (range 1 11))))\n(1 2 3 4 5 6 7 8 9 10)\n(2 4 6 8 10 12 14 16 18 20)\n(3 6 9 12 15 18 21 24 27 30)\n(4 8 12 16 20 24 28 32 36 40)\n(5 10 15 20 25 30 35 40 45 50)\n(6 12 18 24 30 36 42 48 54 60)\n(7 14 21 28 35 42 49 56 63 70)\n(8 16 24 32 40 48 56 64 72 80)\n(9 18 27 36 45 54 63 72 81 90)\n(10 20 30 40 50 60 70 80 90 100)\nnil","created-at":1388454361000,"updated-at":1390607598000,"_id":"542692d2c026201cdc326f94"}],"macro":true,"notes":null,"arglists":["bindings & body"],"doc":"bindings =\u003E name n\n\n Repeatedly executes body (presumably for side-effects) with name\n bound to integers from 0 through n-1.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/dotimes"},{"added":"1.12","ns":"clojure.core","name":"stream-seq!","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":6870,"examples":null,"notes":null,"arglists":["stream"],"doc":"Takes a java.util.stream.BaseStream instance s and returns a seq of its\n contents. This is a terminal operation on the stream.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/stream-seq!"},{"added":"1.0","ns":"clojure.core","name":"select-keys","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":1555,"examples":[{"author":{"login":"Brian Marick","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a523012f661f603806ab1c22d855216f?r=PG&default=identicon"},"editors":[{"login":"Brian Marick","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a523012f661f603806ab1c22d855216f?r=PG&default=identicon"},{"login":"devijvers","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/81018e4231ac1ce8b7a9e6d377092656?r=PG&default=identicon"}],"body":"\u003Cpre\u003Euser=> (select-keys {:a 1 :b 2} [:a])\r\n{:a 1}\r\nuser=> (select-keys {:a 1 :b 2} [:a :c])\r\n{:a 1}\r\n\u003C/pre\u003E","created-at":1278823330000,"updated-at":1279397566000,"_id":"542692c8c026201cdc326a0a"}],"notes":null,"arglists":["map keyseq"],"doc":"Returns a map containing only those entries in map whose key is in keys","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/select-keys"},{"added":"1.0","ns":"clojure.core","name":"bit-and","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":1307,"examples":[{"author":{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},"editors":[{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (bit-and 2r1100 2r1001)\n8\n;; 8 = 2r1000\n\n;; the same in decimal\nuser=\u003E (bit-and 12 9)\n8","created-at":1280337486000,"updated-at":1332952202000,"_id":"542692c8c026201cdc326a70"},{"author":{"login":"Pierre","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/dc0590890ca22fee047f8e2598c2568d?r=PG&default=identicon"},"editors":[],"body":"user\u003E (bit-and 0x08 0xFF)\n8","created-at":1332068603000,"updated-at":1332068603000,"_id":"542692d2c026201cdc326f57"},{"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (Integer/toBinaryString 235)\n\"11101011\"\nuser=\u003E (Integer/toBinaryString 199)\n\"11000111\"\nuser=\u003E (bit-and 235 199)\n195\nuser=\u003E (Integer/toBinaryString 195)\n\"11000011\"\n\n;;11101011\n;;&\n;;11000111\n;;=\n;;11000011","created-at":1345828834000,"updated-at":1345828834000,"_id":"542692d2c026201cdc326f58"}],"notes":null,"arglists":["x y","x y & more"],"doc":"Bitwise and","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/bit-and"},{"added":"1.9","ns":"clojure.core","name":"bounded-count","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":7576,"examples":null,"notes":null,"arglists":["n coll"],"doc":"If coll is counted? returns its count, else will count at most the first n\n elements of coll using its seq","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/bounded-count"},{"added":"1.7","ns":"clojure.core","name":"update","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":6251,"examples":null,"notes":null,"arglists":["m k f","m k f x","m k f x y","m k f x y z","m k f x y z & more"],"doc":"'Updates' a value in an associative structure, where k is a\n key and f is a function that will take the old value\n and any supplied args and return the new value, and returns a new\n structure. If the key does not exist, nil is passed as the old value.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/update"},{"added":"1.0","ns":"clojure.core","name":"list*","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":650,"examples":[{"author":{"login":"Dmitry Kakurin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/85b70be5da433a6adf5112e7140848da?r=PG&default=identicon"},"editors":[{"login":"Dmitry Kakurin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/85b70be5da433a6adf5112e7140848da?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"Dmitry Kakurin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/85b70be5da433a6adf5112e7140848da?r=PG&default=identicon"}],"body":";; `list*` function:\nuser=\u003E (list* 1 [2 3])\n(1 2 3)\nuser=\u003E (list* 1 2 [3 4])\n(1 2 3 4)\n\n;; compared to regular `list` function:\nuser=\u003E (list 1 [2 3])\n(1 [2 3])\nuser=\u003E (list 1 2 [3 4])\n(1 2 [3 4])\n\n;; Corner cases:\nuser=\u003E (list* nil [1 2])\n(nil 1 2)\nuser=\u003E (list* 1 nil)\n(1)\nuser=\u003E (list* () [1 2])\n(() 1 2)\nuser=\u003E (list* 1 ())\n(1)\n","created-at":1280721203000,"updated-at":1306322562000,"_id":"542692c6c026201cdc3268d5"}],"notes":null,"arglists":["args","a args","a b args","a b c args","a b c d & more"],"doc":"Creates a new seq containing the items prepended to the rest, the\n last of which will be treated as a sequence.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/list*"},{"added":"1.2","ns":"clojure.core","name":"reify","file":"clojure/core_deftype.clj","type":"macro","column":1,"see-alsos":[{"created-at":1323993523000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"proxy","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ef4"}],"line":70,"examples":[{"author":{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"},"editors":[{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"},{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"},{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"},{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"}],"body":"(ns foo)\n\n;;; This is a library for the shopping result.\n\n(defrecord Banana [qty])\n(defrecord Grape [qty])\n(defrecord Orange [qty])\n\n;;; 'subtotal' differs from each fruit.\n\n(defprotocol Fruit\n (subtotal [item]))\n\n(extend-type Banana\n Fruit\n (subtotal [item]\n (* 158 (:qty item))))\n\n(extend-type Grape\n Fruit\n (subtotal [item]\n (* 178 (:qty item))))\n\n(extend-type Orange\n Fruit\n (subtotal [item]\n (* 98 (:qty item))))\n\n;;; 'coupon' is the function returing a 'reify' of subtotal. This is\n;;; when someone uses a coupon ticket, the price of some fruits is \n;;; taken off 25%.\n\n(defn coupon [item]\n (reify Fruit\n (subtotal [_]\n (int (* 0.75 (subtotal item))))))\n\n;;; Example: To compute the total when someone bought 10 oranges,\n;;; 15 bananas and 10 grapes using a coupon.\n;;; foo=\u003E (apply + (map subtotal [(Orange. 10) (Banana. 15) (coupon (Grape. 10))]))\n;;; 4685 ; (apply + '(980 2370 1335))\n;;; foo=\u003E \n","created-at":1315673869000,"updated-at":1315674588000,"_id":"542692cdc026201cdc326d5d"},{"author":{"login":"number23","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/89e8dc9231de751fd558d5784406cc5e?r=PG&default=identicon"},"editors":[],"body":";; Using a reified FileFilter implementation to obtain only directory files\n(.listFiles (java.io.File. \".\")\n (reify\n java.io.FileFilter\n (accept [this f]\n (.isDirectory f))))\n","created-at":1339172939000,"updated-at":1339172939000,"_id":"542692d5c026201cdc32706f"},{"author":{"login":"puredanger","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/89c8afd032c7b3473f67c9b00d3acd5a?r=PG&default=identicon"},"editors":[],"body":";;;; This example shows how to reify a multi-arity protocol function\n;;;; (note the different style in defprotocol vs reify)\n\n;; define a multi-arity protocol function blah\n(defprotocol Foo\n (blah\n [this x]\n [this x y]))\n\n;; define an anonymous extension via reify\n(def r (reify Foo \n (blah [_ x] x)\n (blah [_ x y] y)))\n\n;; invoke blah via the r instance\n(blah r 1) ;; =\u003E 1\n(blah r 1 2) ;; =\u003E 2\n\n\n","created-at":1355788930000,"updated-at":1355788930000,"_id":"542692d5c026201cdc327070"}],"macro":true,"notes":null,"arglists":["& opts+specs"],"doc":"reify creates an object implementing a protocol or interface.\n reify is a macro with the following structure:\n\n (reify options* specs*)\n \n Currently there are no options.\n\n Each spec consists of the protocol or interface name followed by zero\n or more method bodies:\n\n protocol-or-interface-or-Object\n (methodName [args+] body)*\n\n Methods should be supplied for all methods of the desired\n protocol(s) and interface(s). You can also define overrides for\n methods of Object. Note that the first parameter must be supplied to\n correspond to the target object ('this' in Java parlance). Thus\n methods for interfaces will take one more argument than do the\n interface declarations. Note also that recur calls to the method\n head should *not* pass the target object, it will be supplied\n automatically and can not be substituted.\n\n The return type can be indicated by a type hint on the method name,\n and arg types can be indicated by a type hint on arg names. If you\n leave out all hints, reify will try to match on same name/arity\n method in the protocol(s)/interface(s) - this is preferred. If you\n supply any hints at all, no inference is done, so all hints (or\n default of Object) must be correct, for both arguments and return\n type. If a method is overloaded in a protocol/interface, multiple\n independent method definitions must be supplied. If overloaded with\n same arity in an interface you must specify complete hints to\n disambiguate - a missing hint implies Object.\n\n Method heads are recursion points for recur, as in a fn. The method\n bodies of reify are lexical closures, and can refer to the surrounding\n local scope:\n \n (str (let [f \"foo\"] \n (reify Object\n (toString [this] f))))\n == \"foo\"\n\n (seq (let [f \"foo\"] \n (reify clojure.lang.Seqable\n (seq [this] (seq f)))))\n == (\\f \\o \\o)\n \n reify always implements clojure.lang.IObj and transfers meta\n data of the form to the created object.\n \n (meta ^{:k :v} (reify Object (toString [this] \"foo\")))\n == {:k :v}","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/reify"},{"added":"1.0","ns":"clojure.core","name":"update-in","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1302248534000,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.core","name":"assoc-in","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c66"},{"created-at":1318010541000,"author":{"login":"jks","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/de50bee3396570d25f900873303c98f1?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"get-in","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c67"},{"created-at":1348895075000,"author":{"login":"eric","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2b0c9ae6f1da9716451e7c86bc87230b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"fnil","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c68"}],"line":6235,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (def users [{:name \"James\" :age 26} {:name \"John\" :age 43}])\n#'user/users\n\nuser=\u003E (update-in users [1 :age] inc)\n\n[{:name \"James\", :age 26} {:name \"John\", :age 44}]\n","created-at":1280322066000,"updated-at":1285488296000,"_id":"542692c9c026201cdc326a9e"},{"author":{"login":"gregg-williams","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/58610a64fc8638eec8d2239d80d4046f?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"Jeff N","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7a9dd2ab880632b999aaeff00fc0d8e2?r=PG&default=identicon"},{"login":"Jeff N","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7a9dd2ab880632b999aaeff00fc0d8e2?r=PG&default=identicon"}],"body":"user=\u003E (def p {:name \"James\" :age 26})\n#'user/p\n\nuser=\u003E (update-in p [:age] inc)\n{:name \"James\", :age 27}\n\n;; remember, the value of p hasn't changed!\nuser=\u003E (update-in p [:age] + 10)\n{:name \"James\", :age 36}\n\n","created-at":1283780561000,"updated-at":1341886597000,"_id":"542692c9c026201cdc326aa0"},{"author":{"login":"shuaybi","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d1906fc5df2c8ce5b2d58cc6ea855aab?r=PG&default=identicon"},"editors":[{"login":"shuaybi","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d1906fc5df2c8ce5b2d58cc6ea855aab?r=PG&default=identicon"}],"body":"(defn char-cnt [s]\n \"Counts occurence of each character in s\"\n (reduce\n (fn [m k]\n (update-in m [k] (fnil inc 0)))\n {}\n (seq s)))\n;Note use of fnil above - returns 0 if nil is passed to inc (avoids null pointer exception)\n","created-at":1305018966000,"updated-at":1305019056000,"_id":"542692c9c026201cdc326aa4"},{"author":{"login":"jamesqiu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bc1268deaa7f2e78fe2b5ea76e6481d8?r=PG&default=identicon"},"editors":[],"body":"; f has args \nuser=\u003E (update-in {:a 3} [:a] / 4 5)\n{:a 3/20}","created-at":1349714558000,"updated-at":1349714558000,"_id":"542692d5c026201cdc3270b1"},{"body":"; be careful with that empty path sequence, it's seldom what you want\nuser=\u003E (update-in {} [] (constantly {:k :v}))\n{nil {:k :v}}","author":{"login":"pmbauer","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/453580?v=2"},"created-at":1412006537832,"updated-at":1412006537832,"_id":"54298289e4b09282a148f202"}],"notes":null,"arglists":["m ks f & args"],"doc":"'Updates' a value in a nested associative structure, where ks is a\n sequence of keys and f is a function that will take the old value\n and any supplied args and return the new value, and returns a new\n nested structure. If any levels do not exist, hash-maps will be\n created.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/update-in"},{"added":"1.0","ns":"clojure.core","name":"prefer-method","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1337584953000,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"prefers","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e0f"},{"created-at":1337584964000,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"get-method","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e10"},{"created-at":1337584977000,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"methods","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e11"}],"line":1820,"examples":null,"notes":null,"arglists":["multifn dispatch-val-x dispatch-val-y"],"doc":"Causes the multimethod to prefer matches of dispatch-val-x over dispatch-val-y \n when there is a conflict","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/prefer-method"},{"added":"1.0","ns":"clojure.core","name":"aset-int","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":3972,"examples":[{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[],"body":";; create an array of 10 ints and set one of the values to 31415\n\nuser=\u003E (def is (int-array 10))\n#'user/is\nuser=\u003E (vec is)\n[0 0 0 0 0 0 0 0 0 0]\nuser=\u003E (aset-int is 3 31415)\n31415\nuser=\u003E (vec is)\n[0 0 0 31415 0 0 0 0 0 0]\nuser=\u003E","created-at":1313915065000,"updated-at":1313915065000,"_id":"542692cdc026201cdc326d37"}],"notes":null,"arglists":["array idx val","array idx idx2 & idxv"],"doc":"Sets the value at the index/indices. Works on arrays of int. Returns val.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/aset-int"},{"added":"1.0","ns":"clojure.core","name":"*clojure-version*","file":"clojure/core.clj","type":"var","column":3,"see-alsos":[{"created-at":1328398023000,"author":{"login":"steveminer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d28543d134185d12d4006a74738d233e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"clojure-version","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521aa6"}],"dynamic":true,"line":7217,"examples":[{"author":{"login":"mattdw","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ee24aacb65359196b0a1bad050f9a62f?r=PG&default=identicon"},"editors":[],"body":"\u003Cpre\u003E\r\nuser=\u003E *clojure-version*\r\n{:interim true, :major 1, :minor 2, :incremental 0, :qualifier \"master\"}\r\n\u003C/pre\u003E","created-at":1280322760000,"updated-at":1280322760000,"_id":"542692cac026201cdc326b62"}],"notes":null,"arglists":[],"doc":"The version info for Clojure core, as a map containing :major :minor \n :incremental and :qualifier keys. Feature releases may increment \n :minor and/or :major, bugfix releases will increment :incremental. \n Possible values of :qualifier include \"GA\", \"SNAPSHOT\", \"RC-x\" \"BETA-x\"","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/*clojure-version*"},{"added":"1.7","ns":"clojure.core","name":"ensure-reduced","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":2866,"examples":null,"notes":null,"arglists":["x"],"doc":"If x is already reduced?, returns it, else returns (reduced x)","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/ensure-reduced"},{"added":"1.0","ns":"clojure.core","name":"*'","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":998,"examples":null,"notes":null,"arglists":["","x","x y","x y & more"],"doc":"Returns the product of nums. (*') returns 1. Supports arbitrary precision.\n See also: *","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/*'"},{"added":"1.0","ns":"clojure.core","name":"instance?","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1285513897000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"type","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e9d"},{"created-at":1285513925000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"supers","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e9e"},{"created-at":1341631058000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"doto","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e9f"},{"created-at":1341631065000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"class","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ea0"}],"line":141,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"john.r.woodward","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/22b6fbc4a386291e45b1cb4449377086?r=PG&default=identicon"},{"login":"steloflute","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fc0969cd0910a427052f0f6281967392?r=PG&default=identicon"},{"login":"Phalphalak","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a684c0fd4f27597437de953e92a15d4b?r=PG&default=identicon"},{"login":"Phalphalak","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a684c0fd4f27597437de953e92a15d4b?r=PG&default=identicon"},{"login":"Phalphalak","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a684c0fd4f27597437de953e92a15d4b?r=PG&default=identicon"},{"login":"Phalphalak","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a684c0fd4f27597437de953e92a15d4b?r=PG&default=identicon"},{"login":"Phalphalak","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a684c0fd4f27597437de953e92a15d4b?r=PG&default=identicon"},{"login":"Phalphalak","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a684c0fd4f27597437de953e92a15d4b?r=PG&default=identicon"}],"body":"user=\u003E (instance? Long 1)\ntrue\nuser=\u003E (instance? Integer 1)\nfalse\nuser=\u003E (instance? Number 1)\ntrue\nuser=\u003E (instance? String 1)\nfalse\nuser=\u003E (instance? String \"1\")\ntrue\n","created-at":1282289726000,"updated-at":1358905451000,"_id":"542692c6c026201cdc3268e1"},{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[{"login":"Phalphalak","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a684c0fd4f27597437de953e92a15d4b?r=PG&default=identicon"},{"login":"Phalphalak","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a684c0fd4f27597437de953e92a15d4b?r=PG&default=identicon"},{"login":"Phalphalak","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a684c0fd4f27597437de953e92a15d4b?r=PG&default=identicon"}],"body":"user=\u003E (def al (new java.util.ArrayList))\n#'user/al\nuser=\u003E (instance? java.util.Collection al)\ntrue\nuser=\u003E (instance? java.util.RandomAccess al)\ntrue\nuser=\u003E (instance? java.lang.String al)\nfalse","created-at":1313989675000,"updated-at":1358543212000,"_id":"542692c6c026201cdc3268eb"},{"author":{"login":"Phalphalak","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a684c0fd4f27597437de953e92a15d4b?r=PG&default=identicon"},"editors":[{"login":"Phalphalak","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a684c0fd4f27597437de953e92a15d4b?r=PG&default=identicon"}],"body":";; Some things are more than what they seem to be at first glance\nuser=\u003E (instance? clojure.lang.IFn +)\ntrue\nuser=\u003E (instance? clojure.lang.Keyword :a)\ntrue\nuser=\u003E (instance? clojure.lang.IFn :a)\ntrue\nuser=\u003E (instance? clojure.lang.IFn {:a 1})\ntrue\n","created-at":1358905444000,"updated-at":1358905610000,"_id":"542692d3c026201cdc326fcf"}],"notes":null,"arglists":["c x"],"doc":"Evaluates x and tests if it is an instance of the class\n c. Returns true or false","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/instance_q"},{"added":"1.0","ns":"clojure.core","name":"with-open","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":null,"line":3857,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; Opens the file 'myfile.txt' and prints out the contents. The \n;; 'with-open' ensures that the reader is closed at the end of the \n;; form. \n;; \n;; Please note that reading a file a character at a time is not \n;; very efficient.\n\nuser=\u003E (with-open [r (java.io.FileReader. \"myfile.txt\")] \n (loop [c (.read r)] \n (if (not= c -1)\n (do \n (print (char c)) \n (recur (.read r))))))\n","created-at":1281949367000,"updated-at":1285494614000,"_id":"542692c7c026201cdc32699a"},{"author":{"login":"octopusgrabbus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fd31b8bcea99fa7b0711fbc424587774?r=PG&default=identicon"},"editors":[],"body":"(defn write-csv-file\n \"Writes a csv file using a key and an s-o-s (sequence of sequences)\"\n [out-sos out-file]\n\n (spit out-file \"\" :append false)\n (with-open [out-data (io/writer out-file)]\n (csv/write-csv out-data out-sos)))\n\n","created-at":1352321815000,"updated-at":1352321815000,"_id":"542692d6c026201cdc3270bb"}],"macro":true,"notes":null,"arglists":["bindings & body"],"doc":"bindings =\u003E [name init ...]\n\n Evaluates body in a try expression with names bound to the values\n of the inits, and a finally clause that calls (.close name) on each\n name in reverse order.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/with-open"},{"added":"1.6","ns":"clojure.core","name":"mix-collection-hash","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":5228,"examples":null,"notes":null,"arglists":["hash-basis count"],"doc":"Mix final collection hash for ordered or unordered collections.\n hash-basis is the combined collection hash, count is the number\n of elements included in the basis. Note this is the hash code\n consistent with =, different from .hashCode.\n See http://clojure.org/data_structures#hash for full algorithms.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/mix-collection-hash"},{"added":"1.0","ns":"clojure.core","name":"re-find","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1282039272000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"re-groups","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bfe"},{"created-at":1282039314000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"re-matcher","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bff"},{"created-at":1282039324000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"re-pattern","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c00"},{"created-at":1282039359000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"re-seq","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c01"},{"created-at":1324028214000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"re-matches","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c02"},{"created-at":1379040124000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"subs","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c03"}],"line":4951,"examples":[{"author":{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (def *matcher* (re-matcher #\"\\d+\" \"abc12345def\"))\n#'user/*matcher*\n\nuser=\u003E (re-find *matcher*)\n\"12345\"\n\n;; If you only want the first match, it is shorter to call re-find with the\n;; pattern and the string to search, rather than explicitly creating a matcher\n;; as above.\nuser=\u003E (re-find #\"\\d+\" \"abc12345def\")\n\"12345\"\n\n;; If you want all matches as a sequence, use re-seq. Creating a matcher\n;; explicitly with re-matcher and passing it to re-find is only the best way\n;; if you want to write a loop that iterates through all matches, and do not\n;; want to use re-seq for some reason.\n","created-at":1279049854000,"updated-at":1324024860000,"_id":"542692cac026201cdc326b4c"},{"author":{"login":"OnesimusUnbound","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fa4c391db0d2d1744cc2cd0d787dd3d?r=PG&default=identicon"},"editors":[],"body":";; re-find can be used to iterate through re matches in the string\n\nuser=\u003E (def phone-number \"672-345-456-3212\")\n#'user/phone-number\n\nuser=\u003E (def matcher (re-matcher #\"\\d+\" phone-number))\n#'user/matcher\n\nuser=\u003E (re-find matcher)\n\"672\"\n\nuser=\u003E (re-find matcher)\n\"345\"\n\nuser=\u003E (re-find matcher)\n\"456\"\n\nuser=\u003E (re-find matcher)\n\"3212\"\n\n;; when there's no more valid matches, nil is returned\nuser=\u003E (re-find matcher)\nnil","created-at":1312373129000,"updated-at":1312373129000,"_id":"542692cac026201cdc326b4f"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[],"body":";; When there are parenthesized groups in the pattern and re-find\n;; finds a match, it returns a vector. The first item is the part of\n;; the string that matches the entire pattern, and each successive\n;; item are the parts of the string that matched the 1st, 2nd,\n;; etc. parenthesized groups. Groups are numbered by the order in\n;; which their left parenthesis occurs in the string, from left to\n;; right.\nuser=\u003E (def line \" RX packets:1871074138 errors:5 dropped:48 overruns:9\")\n#'user/line\n\nuser=\u003E (re-find #\"(\\S+):(\\d+)\" line)\n[\"packets:1871074138\" \"packets\" \"1871074138\"]\n\n;; groups can nest\nuser=\u003E (re-find #\"(\\S+:(\\d+)) \\S+:\\d+\" line)\n[\"packets:1871074138 errors:5\" \"packets:1871074138\" \"1871074138\"]\n\n;; If there is no match, re-find always returns nil, whether there are\n;; parenthesized groups or not.\nuser=\u003E (re-find #\"(\\S+):(\\d+)\" \":2 numbers but not 1 word-and-colon: before\")\nnil\n\n;; A parenthesized group can have nil as its result if it is part of\n;; an 'or' (separated by | in the regex), and another alternative is\n;; the one that matches.\nuser=\u003E (re-find #\"(\\D+)|(\\d+)\" \"word then number 57\")\n[\"word then number \" \"word then number \" nil]\n\nuser=\u003E (re-find #\"(\\D+)|(\\d+)\" \"57 number then word\")\n[\"57\" nil \"57\"]\n\n;; It is also possible for a group to match the empty string.\nuser=\u003E (re-find #\"(\\d*)(\\S)\\S+\" \"lots o' digits 123456789\")\n[\"lots\" \"\" \"l\"]\n\n;; If you want to use parentheses to group a part of the regex, but\n;; have no interest in capturing the string it matches, you can follow\n;; the left paren with ?: to prevent capturing.\nuser=\u003E (re-find #\"(?:\\S+):(\\d+)\" line)\n[\"packets:1871074138\" \"1871074138\"]\n\n;; re-matches also behaves this way, and re-seq returns a sequence of\n;; matches, where each one can be a vector like re-find returns.\n","created-at":1324028180000,"updated-at":1324028180000,"_id":"542692d4c026201cdc32704a"},{"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"editors":[],"body":";;It's possible to get variables out of your string with regexp\n\nuser=\u003E (re-find #\"(\\d\\d\\d) (USD)\" \"450 USD\")\n[\"450 USD\" \"450\" \"USD\"]\nuser=\u003E (nth *1 1)\n\"450\"\n\n;;thanks kotarak @ stackoverflow.com for this one","created-at":1326426979000,"updated-at":1326426979000,"_id":"542692d4c026201cdc32704b"},{"author":{"login":"Pete Mancini","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/19c72d50850490b8dea594fe3eb04437?r=PG&default=identicon"},"editors":[{"login":"Pete Mancini","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/19c72d50850490b8dea594fe3eb04437?r=PG&default=identicon"}],"body":";; If your input has line delimiters you can switch on multiline with (?m)\n\nuser=\u003E (def testcase \"Line 1\\nLine 2\\nTarget Line\\nLine 4\\nNot a target line\")\nuser=\u003E(re-find #\"(?im)^target.*$\" testcase)\n\"Target Line\"","created-at":1369872025000,"updated-at":1369872064000,"_id":"542692d4c026201cdc32704c"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[],"body":";; Note: See clojure.core/subs for discussion of behavior of substrings\n;; holding onto references of the original strings, which can\n;; significantly affect your memory usage in some cases.","created-at":1379040119000,"updated-at":1379040119000,"_id":"542692d4c026201cdc32704e"}],"notes":null,"arglists":["m","re s"],"doc":"Returns the next regex match, if any, of string to pattern, using\n java.util.regex.Matcher.find(). Uses re-groups to return the\n groups.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/re-find"},{"added":"1.7","ns":"clojure.core","name":"run!","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":7902,"examples":null,"notes":null,"arglists":["proc coll"],"doc":"Runs the supplied procedure (via reduce), for purposes of side\n effects, on successive items in the collection. Returns nil","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/run!"},{"added":"1.0","ns":"clojure.core","name":"val","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1318590007000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"vals","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521efb"}],"line":1589,"examples":[{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (map val {:a 1 :b 2})\n(1 2)\n","created-at":1280777702000,"updated-at":1285495495000,"_id":"542692c6c026201cdc3268cd"},{"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"editors":[],"body":"(val (first {:one :two}))\n:two","created-at":1288970694000,"updated-at":1288970694000,"_id":"542692c6c026201cdc3268cf"},{"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"editors":[],"body":";syntactic sugar for (val)\n(:doc (meta #'meta))","created-at":1288970885000,"updated-at":1288970885000,"_id":"542692c6c026201cdc3268d0"}],"notes":[{"updated-at":1345454203000,"body":"This is my first attempt at using this site to gain an understanding of a closure function. Two of the examples above seem incorrect. \r\n\r\nExample 3(?) seems to have nothing to do with val \r\n\r\n(notice the lack of example identifiers)\r\n","created-at":1344320583000,"author":{"login":"dansalmo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e33ee460f5f61bc5ba9b598934766215?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fe6"}],"arglists":["e"],"doc":"Returns the value in the map entry.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/val"},{"added":"1.0","ns":"clojure.core","name":"defonce","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":null,"line":5881,"examples":[{"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"editors":[],"body":"user\u003E (defonce foo 5)\n#'user/foo\n\nuser\u003E foo\n5\n\n;; defonce does nothing the second time\nuser\u003E (defonce foo 10)\nnil\n\nuser\u003E foo\n5","created-at":1293672804000,"updated-at":1293672804000,"_id":"542692cec026201cdc326dba"}],"macro":true,"notes":[{"updated-at":1385014731000,"body":"Note that this isn't thread safe. I.e. EXPR for the same NAME can be evaluated more than once.","created-at":1385014731000,"author":{"login":"lnostdal","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a539e214c9980ff4b53ad5ca9347aa91?r=PG&default=identicon"},"_id":"542692edf6e94c697052200d"}],"arglists":["name expr"],"doc":"defs name to have the root value of the expr iff the named var has no root value,\n else expr is unevaluated","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/defonce"},{"added":"1.0","ns":"clojure.core","name":"unchecked-add","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1289215695000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unchecked-dec","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b8a"},{"created-at":1289215703000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unchecked-inc","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b8b"},{"created-at":1289215708000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unchecked-negate","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b8c"},{"created-at":1289215717000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unchecked-divide","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b8d"},{"created-at":1289215722000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unchecked-subtract","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b8e"},{"created-at":1289215736000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unchecked-multiply","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b8f"},{"created-at":1289215741000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unchecked-remainder","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b90"}],"line":1212,"examples":[{"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; can't interchange INTs with LONGs, only F(int, int) or F(long, long)\n;; F is a function, not an operator.\n;; overflow very easily as shown below.\n\nuser=\u003E (unchecked-add Integer/MAX_VALUE 0)\n2147483647\n\nuser=\u003E (unchecked-add Integer/MAX_VALUE 1)\n-2147483648\n\nuser=\u003E (unchecked-add Integer/MAX_VALUE Integer/MAX_VALUE)\n-2\n\nuser=\u003E (unchecked-add Integer/MAX_VALUE Long/MAX_VALUE)\njava.lang.IllegalArgumentException: No matching method found: unchecked_add (NO_SOURCE_FILE:0)\n\nuser=\u003E (unchecked-add Integer/MAX_VALUE Long/MAX_VALUE)\njava.lang.IllegalArgumentException: No matching method found: unchecked_add (NO_SOURCE_FILE:0)\n\nuser=\u003E (unchecked-add Long/MAX_VALUE Long/MAX_VALUE)\n-2\n\nuser=\u003E (unchecked-add 5 Long/MAX_VALUE)\njava.lang.IllegalArgumentException: No matching method found: unchecked_add (NO_SOURCE_FILE:0)\n\nuser=\u003E (unchecked-add 5555555555 Long/MAX_VALUE)\n-9223372031299220254","created-at":1289215507000,"updated-at":1289267828000,"_id":"542692c9c026201cdc326ac9"}],"notes":null,"arglists":["x y"],"doc":"Returns the sum of x and y, both long.\n Note - uses a primitive operator subject to overflow.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/unchecked-add"},{"added":"1.0","ns":"clojure.core","name":"loaded-libs","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":6167,"examples":null,"notes":null,"arglists":[""],"doc":"Returns a sorted set of symbols naming the currently loaded libs","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/loaded-libs"},{"ns":"clojure.core","name":"-\u003EVec","file":"clojure/gvec.clj","type":"function","column":1,"see-alsos":null,"line":170,"examples":null,"notes":null,"arglists":["am cnt shift root tail _meta"],"doc":"Positional factory function for class clojure.core.Vec.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/-\u003EVec"},{"added":"1.9","ns":"clojure.core","name":"bytes?","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":5441,"examples":null,"notes":null,"arglists":["x"],"doc":"Return true if x is a byte array","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/bytes_q"},{"added":"1.0","ns":"clojure.core","name":"not","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1301366612000,"author":{"login":"pauldoo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5cb916d3c8abc9f45a093209e72489fb?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"complement","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dd8"},{"created-at":1375213332000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"false?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dd9"}],"line":526,"examples":[{"author":{"login":"mattdw","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ee24aacb65359196b0a1bad050f9a62f?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (not true)\nfalse\nuser=\u003E (not false)\ntrue\n;; acts as complement of `boolean`\nuser=\u003E (boolean \"a string\")\ntrue\nuser=\u003E (not \"a string\")\nfalse\nuser=\u003E (boolean 1)\ntrue\nuser=\u003E (not 1)\nfalse","created-at":1280323469000,"updated-at":1332951521000,"_id":"542692cfc026201cdc326e64"}],"notes":null,"tag":"java.lang.Boolean","arglists":["x"],"doc":"Returns true if x is logical false, false otherwise.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/not"},{"added":"1.0","ns":"clojure.core","name":"with-meta","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1301486163000,"author":{"login":"ninjudd","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7ced25585a7556e9b9b975c1f9e136e3?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"vary-meta","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d5e"},{"created-at":1341551175000,"author":{"login":"jgauthier","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e8668403f9cac4041a106e57e8037dff?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"meta","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d5f"},{"created-at":1374315863000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"alter-meta!","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d60"}],"line":213,"examples":[{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (with-meta [1 2 3] {:my \"meta\"})\n[1 2 3]\n\nuser=\u003E (meta (with-meta [1 2 3] {:my \"meta\"}))\n{:my \"meta\"}\n","created-at":1280776037000,"updated-at":1285495834000,"_id":"542692c8c026201cdc326a41"},{"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"editors":[],"body":";; the same example above in a simplified way\nuser=\u003E (def wm (with-meta [1 2 3] {:my \"meta\"}))\n#'user/wm\n\nuser=\u003E wm\n[1 2 3]\n\nuser=\u003E (meta wm)\n{:my \"meta\"}","created-at":1359717828000,"updated-at":1359717828000,"_id":"542692d6c026201cdc3270ba"}],"notes":null,"arglists":["obj m"],"doc":"Returns an object of the same type and value as obj, with\n map m as its metadata.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/with-meta"},{"added":"1.7","ns":"clojure.core","name":"unreduced","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":2872,"examples":null,"notes":null,"arglists":["x"],"doc":"If x is reduced?, returns (deref x), else returns x","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/unreduced"},{"added":"1.0","ns":"clojure.core","name":"the-ns","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":4179,"examples":[{"author":{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},"editors":[{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; Let's play with a namespace by its name and by its symbol \nuser=\u003E (def for-later-use (create-ns 'my-namespace))\n#'user/for-later-use\n\nuser=\u003E (the-ns for-later-use)\n#<Namespace my-namespace>\n\n\nuser=\u003E (the-ns 'my-namespace)\n#<Namespace my-namespace>\n\n;; not going to find anything this way because we just asked the repl\n;; not to perform an evaluate on it and there is not such \n;; namespace with the name \"for-later-use\"\nuser=\u003E (the-ns 'for-later-use)\njava.lang.Exception: No namespace: for-later-use found (NO_SOURCE_FILE:0)\n\n;; not going to work either because \"my-namespace\" is the name of a namespace\n;; and not a symbol that points to something\nuser=\u003E (the-ns my-namespace)\njava.lang.Exception: Unable to resolve symbol: my-namespace in this context (NO_SOURCE_FILE:12)\n","created-at":1285114597000,"updated-at":1285485857000,"_id":"542692c6c026201cdc3268d9"}],"notes":null,"arglists":["x"],"doc":"If passed a namespace, returns it. Else, when passed a symbol,\n returns the namespace named by it, throwing an exception if not\n found.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/the-ns"},{"added":"1.6","ns":"clojure.core","name":"record?","file":"clojure/core_deftype.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":407,"examples":null,"notes":null,"arglists":["x"],"doc":"Returns true if x is a record","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/record_q"},{"added":"1.0","ns":"clojure.core","name":"type","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1281949423000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"class","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521acb"},{"created-at":1285511147000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"supers","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521acc"},{"created-at":1285513879000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"instance?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521acd"}],"line":3492,"examples":[{"author":{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"ampleyfly","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d1f7428e063b5d881a2366ee5fd526fd?r=PG&default=identicon"},{"login":"categorics","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3de94aa23c7d475ed00b9d32bc35877a?r=PG&default=identicon"}],"body":";; Checking numbers\nuser=\u003E (type 10)\njava.lang.Long\n\nuser=\u003E (type 10.0)\njava.lang.Double\n\n\n;; Checking collections\nuser=\u003E (type [10 20])\nclojure.lang.PersistentVector\n\nuser=\u003E (type '(10 20))\nclojure.lang.PersistentList\n\n\n;; Checking other, but somewhat intuitive, forms\nuser=\u003E (type :a)\nclojure.lang.Keyword\n\nuser=\u003E (type Thread)\njava.lang.Class\n\n\n;; Checking a symbol\nuser=\u003E (type 'whatever)\nclojure.lang.Symbol\n\n;; A surprise attack yields\nuser=\u003E (type clojure.lang.Symbol)\n;; not such a surprising response\njava.lang.Class\n\n\n;; Checking a function\nuser=\u003E (defn foo [] (\"any string\"))\n#'user/foo\nuser=\u003E (type foo)\nuser$foo\n\n\n;; Checking a macro\nuser=\u003E (type fn)\nuser$fn\n\nuser=\u003E (type clojure.core/fn)\njava.lang.Exception: Can't take value of a macro: #'clojure.core/fn (NO_SOURCE_FILE:94)\n\n","created-at":1284412202000,"updated-at":1395473818000,"_id":"542692cfc026201cdc326e29"},{"author":{"login":"shuaybi","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d1906fc5df2c8ce5b2d58cc6ea855aab?r=PG&default=identicon"},"editors":[{"login":"shuaybi","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d1906fc5df2c8ce5b2d58cc6ea855aab?r=PG&default=identicon"}],"body":";This example demonstrates how to add type information to regular clojure maps\n(defn purchase-order [id date amount]\n ^{:type ::PurchaseOrder} ;metadata\n {:id id :date date :amount amount})\n\n(def my-order (purchase-order 10 (java.util.Date.) 100.0))\n\n(my-order)\n=\u003E {:id 10, :date #\u003CDate Sun May 15 14:29:19 EDT 2011\u003E, :amount 100.0}\n\n(type my-order)\n=\u003E PurchaseOrder","created-at":1305510021000,"updated-at":1305510113000,"_id":"542692cfc026201cdc326e2d"}],"notes":null,"arglists":["x"],"doc":"Returns the :type metadata of x, or its Class if none","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/type"},{"added":"1.0","ns":"clojure.core","name":"identical?","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1343319790000,"author":{"login":"john.r.woodward","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/22b6fbc4a386291e45b1cb4449377086?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"=","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cc5"},{"created-at":1343319794000,"author":{"login":"john.r.woodward","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/22b6fbc4a386291e45b1cb4449377086?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"==","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cc6"}],"line":777,"examples":[{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"john.r.woodward","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/22b6fbc4a386291e45b1cb4449377086?r=PG&default=identicon"},{"login":"john.r.woodward","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/22b6fbc4a386291e45b1cb4449377086?r=PG&default=identicon"}],"body":"user=\u003E (def x 1)\n#'user/x\nuser=\u003E (identical? x x)\ntrue\nuser=\u003E (identical? x 1)\ntrue\nuser=\u003E (identical? x 2)\nfalse\nuser=\u003E (identical? x ((constantly 1) 8))\ntrue\nuser=\u003E (identical? 'a 'a)\nfalse","created-at":1279074018000,"updated-at":1343322315000,"_id":"542692c8c026201cdc326a61"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (def x {:foo 1, :bar -3})\n#'user/x\nuser=\u003E (def y {:foo 1, :bar -3})\n#'user/y\n;; Values are equal, but different objects were constructed\nuser=\u003E (= x y)\ntrue\nuser=\u003E (identical? x y)\nfalse\n","created-at":1329874849000,"updated-at":1329874849000,"_id":"542692d3c026201cdc326fca"}],"notes":null,"arglists":["x y"],"doc":"Tests if 2 arguments are the same object","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/identical_q"},{"added":"1.0","ns":"clojure.core","name":"unchecked-divide-int","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":1247,"examples":null,"notes":null,"arglists":["x y"],"doc":"Returns the division of x by y, both int.\n Note - uses a primitive operator subject to truncation.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/unchecked-divide-int"},{"added":"1.0","ns":"clojure.core","name":"ns-name","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":4190,"examples":[{"author":{"login":"sunng","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4cc03baa6fbb880e246ce5c9c8e247ce?r=PG&default=identicon"},"editors":[{"login":"sunng","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4cc03baa6fbb880e246ce5c9c8e247ce?r=PG&default=identicon"}],"body":";; get the namespace name as string\nuser=\u003E (ns-name (the-ns 'user))\nuser\n","created-at":1327579554000,"updated-at":1327579773000,"_id":"542692d4c026201cdc32701b"}],"notes":null,"arglists":["ns"],"doc":"Returns the name of the namespace, a symbol.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/ns-name"},{"added":"1.0","ns":"clojure.core","name":"max-key","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1350408889000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"max","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e60"},{"created-at":1371841171000,"author":{"login":"adereth","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5ad11b4e208a6cdb3bd45fe01dea59b7?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"min-key","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e61"}],"line":5042,"examples":[{"author":{"login":"pkolloch","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/10b2fd3c0a4cc46dc241a48468dc551?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (max-key count \"asd\" \"bsd\" \"dsd\" \"long word\")\n\"long word\"","created-at":1282324042000,"updated-at":1332951974000,"_id":"542692c6c026201cdc3268d3"}],"notes":null,"arglists":["k x","k x y","k x y & more"],"doc":"Returns the x for which (k x), a number, is greatest.\n\n If there are multiple such xs, the last one is returned.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/max-key"},{"added":"1.3","ns":"clojure.core","name":"*unchecked-math*","type":"var","see-alsos":null,"examples":null,"notes":[{"updated-at":1339147124000,"body":"Note that, even if `*unchecked-math*` is true when compiling, the unchecked operations are used only when both operands are primitive; if either operand is boxed, normal Clojure arithmetic is used (see [this message](http://groups.google.com/group/clojure/msg/532b32950db75f56) from Stuart Sierra on the Clojure Google group). This can be worked around by adding type hints (e.g. `^long`) where necessary.","created-at":1339147124000,"author":{"login":"glchapman","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a5176d5d971ba68c15f4afe376aeaf18?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fe3"}],"arglists":[],"doc":"While bound to true, compilations of +, -, *, inc, dec and the\n coercions will be done without overflow checks. While bound\n to :warn-on-boxed, same behavior as true, and a warning is emitted\n when compilation uses boxed math. Default: false.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/*unchecked-math*"},{"added":"1.0","ns":"clojure.core","name":"defn-","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1358128693000,"author":{"login":"juan.facorro","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d6f59d93cc17c698f16e550034a2d1ad?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"defn","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d56"}],"line":4978,"examples":[{"author":{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"\nuser=\u003E (ns test)\nnil\n\ntest=\u003E (defn- foo []\n \"World!\")\n#'test/foo\n\ntest=\u003E (defn bar []\n (str \"Hello \" (foo)))\n#'test/bar\n\ntest=\u003E (foo)\n\"World!\"\ntest=\u003E (bar)\n\"Hello World!\"\ntest=\u003E (ns playground)\nnil\nplayground=\u003E (test/bar)\n\"Hello World!\"\n\n;; Error will be thrown\n;; var: #'test/foo is not public\nplayground=\u003E (test/foo)\n","created-at":1279162183000,"updated-at":1285500672000,"_id":"542692cac026201cdc326b4a"}],"macro":true,"notes":null,"arglists":["name & decls"],"doc":"same as defn, yielding non-public def","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/defn-"},{"added":"1.0","ns":"clojure.core","name":"*out*","type":"var","see-alsos":[{"created-at":1302912138000,"author":{"login":"hoornet","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5834f829a9def19620d4014c46642172?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"*in*","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c2b"}],"examples":null,"notes":null,"tag":"java.io.Writer","arglists":[],"doc":"A java.io.Writer object representing standard output for print operations.\n\n Defaults to System/out, wrapped in an OutputStreamWriter","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/*out*"},{"added":"1.0","ns":"clojure.core","name":"file-seq","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1329988618000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.java.io","name":"file","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b05"},{"created-at":1329988623000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.java.io","name":"delete-file","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b06"}],"line":5001,"examples":[{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":";; first create a Java File object using the file function in\n;; the clojure.java.io package and use that object to create a file-seq\n;; then show the first and first 10 members of that seq\n\nuser=\u003E (def f (clojure.java.io/file \"c:\\\\clojure-1.2.0\"))\n#'user/f\nuser=\u003E (def fs (file-seq f))\n#'user/fs\nuser=\u003E (first fs)\n#\u003CFile c:\\clojure-1.2.0\u003E\nuser=\u003E (clojure.pprint/pprint (take 10 fs))\n(#\u003CFile c:\\clojure-1.2.0\u003E\n #\u003CFile c:\\clojure-1.2.0\\.gitignore\u003E\n #\u003CFile c:\\clojure-1.2.0\\build.xml\u003E\n #\u003CFile c:\\clojure-1.2.0\\changes.txt\u003E\n #\u003CFile c:\\clojure-1.2.0\\cl.bat\u003E\n #\u003CFile c:\\clojure-1.2.0\\clojure.jar\u003E\n #\u003CFile c:\\clojure-1.2.0\\doc\u003E\n #\u003CFile c:\\clojure-1.2.0\\doc\\clojure\u003E\n #\u003CFile c:\\clojure-1.2.0\\doc\\clojure\\pprint\u003E\n #\u003CFile c:\\clojure-1.2.0\\doc\\clojure\\pprint\\CommonLispFormat.markdown\u003E)\nuser=\u003E","created-at":1313961191000,"updated-at":1329988607000,"_id":"542692cbc026201cdc326bf2"}],"notes":null,"arglists":["dir"],"doc":"A tree seq on java.io.Files","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/file-seq"},{"added":"1.0","ns":"clojure.core","name":"agent","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1287220581000,"author":{"login":"hugoduncan","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/80fa2a15219b987664e4d6f5c78b4c27?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"set-error-handler!","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b66"},{"created-at":1332037921000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"send","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b67"},{"created-at":1332037925000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"send-off","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b68"},{"created-at":1332038024000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"release-pending-sends","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b69"},{"created-at":1332038048000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"agent-error","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b6a"},{"created-at":1332038056000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"restart-agent","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b6b"},{"created-at":1349393706000,"author":{"login":"eric","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2b0c9ae6f1da9716451e7c86bc87230b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"add-watch","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b6c"},{"created-at":1358869462000,"author":{"login":"avasenin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2918eef190b9952940232b30a4f5541d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"set-error-mode!","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b6d"},{"created-at":1364873755000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"set-validator!","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b6e"}],"line":2071,"examples":[{"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"editors":[{"login":"srid","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bd3a68d670372cd09876c26270a4299a?r=PG&default=identicon"},{"login":"srid","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bd3a68d670372cd09876c26270a4299a?r=PG&default=identicon"}],"body":"; Agents provide shared access to mutable state. They allow non-blocking (asynchronous as opposed to synchronous atoms) and independent change of individual locations (unlike coordinated change of multiple locations through refs).\n\n; agent creates one:\n\nuser=\u003E (def counter (agent 0))\n#'user/counter\n\n; send changes its value:\nuser=\u003E (send counter inc)\n\n; @ or deref provides a snapshot of the current state:\nuser=\u003E @counter\n1\n\n; agents can reference any data structure:\n\nuser=\u003E (def pulp-fiction (agent {}))\n#'user/pulp-fiction\nuser=\u003E (send pulp-fiction assoc :act-one \"PROLOGUE\")\nuser=\u003E @pulp-fiction\n{:act-one \"PROLOGUE\"}\nuser=\u003E (send pulp-fiction assoc :act-two \"VINCENT VEGA & MARSELLUS WALLACE'S WIFE\")\nuser=\u003E @pulp-fiction\n{:act-two \"VINCENT VEGA & MARSELLUS WALLACE'S WIFE\", :act-one \"PROLOGUE\"}\n\n; From http://clojure-examples.appspot.com/clojure.core/agent with permission.","created-at":1278720383000,"updated-at":1316480449000,"_id":"542692cfc026201cdc326e6c"}],"notes":null,"arglists":["state & options"],"doc":"Creates and returns an agent with an initial value of state and\n zero or more options (in any order):\n\n :meta metadata-map\n\n :validator validate-fn\n\n :error-handler handler-fn\n\n :error-mode mode-keyword\n\n If metadata-map is supplied, it will become the metadata on the\n agent. validate-fn must be nil or a side-effect-free fn of one\n argument, which will be passed the intended new state on any state\n change. If the new state is unacceptable, the validate-fn should\n return false or throw an exception. handler-fn is called if an\n action throws an exception or if validate-fn rejects a new state --\n see set-error-handler! for details. The mode-keyword may be either\n :continue (the default if an error-handler is given) or :fail (the\n default if no error-handler is given) -- see set-error-mode! for\n details.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/agent"},{"added":"1.0","ns":"clojure.core","name":"ns-map","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1288055092000,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.core","name":"ns-interns","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bc2"},{"created-at":1288055096000,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.core","name":"ns-publics","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bc3"},{"created-at":1288055105000,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.core","name":"ns-refers","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bc4"},{"created-at":1288055110000,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.core","name":"ns-imports","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bc5"}],"line":4197,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[],"body":"(ns-map 'clojure.core)\n{sorted-map #'clojure.core/sorted-map, read-line #'clojure.core/read-line, re-pattern #'clojure.core/re-pattern, keyword? #'clojure.core/keyword?, ClassVisitor clojure.asm.ClassVisitor, asm-type #'clojure.core/asm-type, val #'clojure.core/val, ...chop...}","created-at":1288074955000,"updated-at":1288074955000,"_id":"542692cec026201cdc326d75"},{"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"editors":[],"body":";; See also http://clojure.org/namespaces for information on namespaces in Clojure and how to inspect and manipulate them","created-at":1348479374000,"updated-at":1348479374000,"_id":"542692d4c026201cdc327019"},{"author":{"login":"xiepan","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c278acb4a5a933c93a68f87cbe95e16c?r=PG&default=identicon"},"editors":[],"body":";; ns-map = ns-refers + ns-interns + ns-imports\nuser=\u003E (count (ns-imports *ns*))\n;;=\u003E 96\n\nuser=\u003E (count (ns-interns *ns*))\n;;=\u003E 2\n\nuser=\u003E (count (ns-refers *ns*))\n;;=\u003E 590\n\nuser=\u003E (+ *1 *2 *3)\n;;=\u003E 688\n\nuser=\u003E (count (ns-map *ns*))\n;;=\u003E 688","created-at":1356702864000,"updated-at":1356702864000,"_id":"542692d4c026201cdc32701a"}],"notes":null,"arglists":["ns"],"doc":"Returns a map of all the mappings for the namespace.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/ns-map"},{"added":"1.0","ns":"clojure.core","name":"set-validator!","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1364873765000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"atom","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ea4"},{"created-at":1364873772000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"agent","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ea5"},{"created-at":1364873776000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ref","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ea6"}],"line":2406,"examples":[{"author":{"login":"nickbauman","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4b9f5878e727c1bc92648eef74b99c85?r=PG&default=identicon"},"editors":[{"login":"nickbauman","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4b9f5878e727c1bc92648eef74b99c85?r=PG&default=identicon"},{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"}],"body":"user=\u003E (def atm (atom [2])\n#'user/atm\n\nuser=\u003E (set-validator! atm #(every? even? %))\nnil\n\nuser=\u003E (swap! atm into [5])\n#\u003CCompilerException java.lang.IllegalStateException: Invalid reference state (NO_SOURCE_FILE:0)\u003E\n\nuser=\u003E (set-validator! atm nil)\nnil\n\nuser=\u003E (swap! atm into [5]))\n[2 5]","created-at":1326874022000,"updated-at":1337721107000,"_id":"542692d5c026201cdc327081"}],"notes":[{"updated-at":1330569448000,"body":"If you want your validator to throw an exception with a useful message, make sure it is a RuntimeException (or subclass), otherwise ARef#validate will throw an IllegalStateException with a generic message.","created-at":1330569448000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fd9"}],"arglists":["iref validator-fn"],"doc":"Sets the validator-fn for a var/ref/agent/atom. validator-fn must be nil or a\n side-effect-free fn of one argument, which will be passed the intended\n new state on any state change. If the new state is unacceptable, the\n validator-fn should return false or throw an exception. If the current state (root\n value if var) is not acceptable to the new validator, an exception\n will be thrown and the validator will not be changed.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/set-validator!"},{"added":"1.9","ns":"clojure.core","name":"ident?","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":1627,"examples":null,"notes":null,"arglists":["x"],"doc":"Return true if x is a symbol or keyword","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/ident_q"},{"added":"1.2","ns":"clojure.core","name":"defprotocol","file":"clojure/core_deftype.clj","type":"macro","column":1,"see-alsos":[{"created-at":1289830442000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"reify","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bbd"},{"created-at":1289830461000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"extend-type","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bbe"},{"created-at":1289830466000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"extend-protocol","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bbf"},{"created-at":1302045794000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"extends?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bc0"},{"created-at":1345918777000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"satisfies?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bc1"}],"line":716,"examples":[{"author":{"login":"Kototama","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a54a4dc204925d397ca010b9a332e74d?r=PG&default=identicon"},"editors":[{"login":"Kototama","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a54a4dc204925d397ca010b9a332e74d?r=PG&default=identicon"},{"login":"Kototama","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a54a4dc204925d397ca010b9a332e74d?r=PG&default=identicon"},{"login":"Kototama","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a54a4dc204925d397ca010b9a332e74d?r=PG&default=identicon"},{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},{"login":"maacl","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8ff89765136c38707e0f57cf48679a13?r=PG&default=identicon"},{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},{"login":"pjlegato","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4ce55cfd8b3ae2f63f5ecbc8fc1c05d4?r=PG&default=identicon"}],"body":"(defprotocol Fly\n \"A simple protocol for flying\"\n (fly [this] \"Method to fly\"))\n\n(defrecord Bird [name species]\n Fly\n (fly [this] (str (:name this) \" flies...\")))\n\n(extends? Fly Bird)\n-\u003E true\n\n(def crow (Bird. \"Crow\" \"Corvus corax\"))\n\n(fly crow)\n-\u003E \"Crow flies...\"","created-at":1286490281000,"updated-at":1348996644000,"_id":"542692cfc026201cdc326e14"},{"author":{"login":"Kototama","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a54a4dc204925d397ca010b9a332e74d?r=PG&default=identicon"},"editors":[{"login":"Ljos","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/45b996a79abca465acaf6c0f10b0437?r=PG&default=identicon"}],"body":";; from Stuart Halloway's examples:\n\n(defprotocol Player\n (choose [p])\n (update-strategy [p me you]))\n\n(defrecord Stubborn [choice]\n Player\n (choose [_] choice)\n (update-strategy [this _ _] this))\n\n(defrecord Mean [last-winner]\n Player\n (choose [_]\n (if last-winner\n last-winner\n (random-choice)))\n (update-strategy [_ me you]\n (-\u003EMean (when (iwon? me you) me))))\n","created-at":1286490493000,"updated-at":1358536428000,"_id":"542692cfc026201cdc326e1c"},{"author":{"login":"franks42","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b3ee701dd6c481e5d310467ddfe62c48?r=PG&default=identicon"},"editors":[],"body":";; defprotocol does NOT support interfaces with variable argument lists, \n;; like [this & args]\n;; (this is not documented anywhere... )\n\n;; The workaround is to define the interface with the variable arg list in a fn\n;; separately outside of the protocol, which then calls the protocol interface\n;; with a slightly different name and an array in place of the variable list,\n;; like:\n\n(defprotocol MyProtocol\n (-my-fn [this args]))\n\n(defn my-fn [this & args] (-my-fn this args))","created-at":1358608093000,"updated-at":1358608093000,"_id":"542692d2c026201cdc326f80"},{"author":{"login":"bmabey","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b966e0fe46246f9a0641fa2e322fec38?r=PG&default=identicon"},"editors":[],"body":";; Protocols allow you to add new abstractions to existing types in a clean way.\n;; Polymorphic functions are created in namespaces as opposed to\n;; having the polymorphism live on Classes as typically done in OO.\n\n;; example from: \n;; https://speakerdeck.com/bmabey/clojure-plain-and-simple?slide=230\n(ns abstraction-a)\n\n(defprotocol AbstractionA\n (foo [obj]))\n\n(extend-protocol AbstractionA\n nil\n (foo [s] (str \"foo-A!\"))\n String\n (foo [s] (str \"foo-A-\" (.toUpperCase s))))\n\n(ns abstraction-b)\n\n(defprotocol AbstractionB\n (foo [obj]))\n\n(extend-protocol AbstractionB\n nil\n (foo [s] (str \"foo-B!\"))\n String\n (foo [s] (str \"foo-B-\" (.toLowerCase s))))\n\n\nuser=\u003E (require '[abstraction-a :as a])\n\nuser=\u003E (require '[abstraction-b :as b])\n\nuser=\u003E (a/foo \"Bar\")\n\"foo-A-BAR\"\n\nuser=\u003E (b/foo \"Bar\")\n\"foo-B-bar\"\n\nuser=\u003E (a/foo nil)\n\"foo-A!\"\n\nuser=\u003E (b/foo nil)\n\"foo-B!\"\n","created-at":1380075979000,"updated-at":1380075979000,"_id":"542692d2c026201cdc326f81"}],"macro":true,"notes":null,"arglists":["name & opts+sigs"],"doc":"A protocol is a named set of named methods and their signatures:\n (defprotocol AProtocolName\n\n ;optional doc string\n \"A doc string for AProtocol abstraction\"\n\n ;options\n :extend-via-metadata true\n\n ;method signatures\n (bar [this a b] \"bar docs\")\n (baz [this a] [this a b] [this a b c] \"baz docs\"))\n\n No implementations are provided. Docs can be specified for the\n protocol overall and for each method. The above yields a set of\n polymorphic functions and a protocol object. All are\n namespace-qualified by the ns enclosing the definition The resulting\n functions dispatch on the type of their first argument, which is\n required and corresponds to the implicit target object ('this' in \n Java parlance). defprotocol is dynamic, has no special compile-time \n effect, and defines no new types or classes. Implementations of \n the protocol methods can be provided using extend.\n\n When :extend-via-metadata is true, values can extend protocols by\n adding metadata where keys are fully-qualified protocol function\n symbols and values are function implementations. Protocol\n implementations are checked first for direct definitions (defrecord,\n deftype, reify), then metadata definitions, then external\n extensions (extend, extend-type, extend-protocol)\n\n defprotocol will automatically generate a corresponding interface,\n with the same name as the protocol, i.e. given a protocol:\n my.ns/Protocol, an interface: my.ns.Protocol. The interface will\n have methods corresponding to the protocol functions, and the\n protocol will automatically work with instances of the interface.\n\n Note that you should not use this interface with deftype or\n reify, as they support the protocol directly:\n\n (defprotocol P \n (foo [this]) \n (bar-me [this] [this y]))\n\n (deftype Foo [a b c] \n P\n (foo [this] a)\n (bar-me [this] b)\n (bar-me [this y] (+ c y)))\n \n (bar-me (Foo. 1 2 3) 42)\n =\u003E 45\n\n (foo \n (let [x 42]\n (reify P \n (foo [this] 17)\n (bar-me [this] x)\n (bar-me [this y] x))))\n =\u003E 17","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/defprotocol"},{"added":"1.0","ns":"clojure.core","name":"swap!","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1285759338000,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.core","name":"atom","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e05"},{"created-at":1289908501000,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.core","name":"reset!","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e06"}],"line":2362,"examples":[{"author":{"login":"Kototama","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a54a4dc204925d397ca010b9a332e74d?r=PG&default=identicon"},"editors":[{"login":"jamieorc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ad647269ea91f1d48b3e76624d89f1d0?r=PG&default=identicon"}],"body":"user\u003E (def players (atom ()))\n#'user/players\n\nuser\u003E (swap! players conj :player1)\n(:player1)\n\nuser\u003E (swap! players conj :player2)\n(:player2 :player1)\n\nuser\u003E (deref players)\n(:player2 :player1)","created-at":1286491687000,"updated-at":1335844185000,"_id":"542692cdc026201cdc326d54"},{"author":{"login":"Kototama","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a54a4dc204925d397ca010b9a332e74d?r=PG&default=identicon"},"editors":[{"login":"jamieorc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ad647269ea91f1d48b3e76624d89f1d0?r=PG&default=identicon"}],"body":"user\u003E (def counter (atom 0))\n#'user/counter\n\nuser\u003E (swap! counter inc)\n1\n\nuser\u003E (swap! counter inc)\n2","created-at":1286491725000,"updated-at":1335844215000,"_id":"542692cdc026201cdc326d56"},{"author":{"login":"esumitra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d3df4ff6342ed6fba898021bf2d19a6d?r=PG&default=identicon"},"editors":[],"body":";; swap map values\nuser\u003E (def m1 (atom {:a \"A\" :b \"B\"}))\natom\n\nuser\u003E @m1\n{:a \"A\", :b \"B\"}\n\nuser\u003E (swap! m1 assoc :a \"Aaay\")\n{:a \"Aaay\", :b \"B\"}","created-at":1408514586000,"updated-at":1408514586000,"_id":"542692d5c026201cdc32709f"}],"notes":null,"arglists":["atom f","atom f x","atom f x y","atom f x y & args"],"doc":"Atomically swaps the value of atom to be:\n (apply f current-value-of-atom args). Note that f may be called\n multiple times, and thus should be free of side effects. Returns\n the value that was swapped in.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/swap!"},{"added":"1.0","ns":"clojure.core","name":"vals","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1318590020000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"val","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521aa9"},{"created-at":1359517156000,"author":{"login":"Dmitry Kakurin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/85b70be5da433a6adf5112e7140848da?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"keys","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521aaa"}],"line":1576,"examples":[{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (vals {:a \"foo\", :b \"bar\"})\n(\"foo\" \"bar\")\n","created-at":1280776235000,"updated-at":1285495785000,"_id":"542692c8c026201cdc326a08"}],"notes":[{"updated-at":1385457081000,"body":"Functions keys and vals return sequences such that\r\n\u003Cpre\u003E\r\n(= (zipmap (keys m) (vals m)) m)\r\n\u003C/pre\u003E","created-at":1385457081000,"author":{"login":"akhudek","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/aaf21f137b69cc5154c8afb29b793e18?r=PG&default=identicon"},"_id":"542692edf6e94c6970522011"}],"arglists":["map"],"doc":"Returns a sequence of the map's values, in the same order as (seq map).","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/vals"},{"added":"1.0","ns":"clojure.core","name":"unchecked-subtract","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1289216526000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unchecked-add","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b98"},{"created-at":1289216530000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unchecked-dec","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b99"},{"created-at":1289216535000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unchecked-inc","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b9a"},{"created-at":1289216540000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unchecked-negate","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b9b"},{"created-at":1289216544000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unchecked-divide","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b9c"},{"created-at":1289216549000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unchecked-subtract","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b9d"},{"created-at":1289216555000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unchecked-multiply","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b9e"},{"created-at":1289216559000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unchecked-remainder","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b9f"}],"line":1226,"examples":[{"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; can't interchange INTs with LONGs, only F(int, int) or F(long, long)\n;; F is a function, not an\n;; overflow very easily as shown below.\n\n(unchecked-subtract Long/MIN_VALUE 5555555554)\nuser=\u003E 9223372031299220254\n\n(unchecked-subtract Long/MIN_VALUE 1)\nuser=\u003E java.lang.IllegalArgumentException: No matching method found: unchecked_subtract (NO_SOURCE_FILE:0)\n\n(unchecked-subtract Long/MIN_VALUE Long/MIN_VALUE)\nuser=\u003E 0\n\n(unchecked-subtract Integer/MIN_VALUE Long/MIN_VALUE)\nuser=\u003E java.lang.IllegalArgumentException: No matching method found: unchecked_subtract (NO_SOURCE_FILE:0)\n\n(unchecked-subtract Integer/MIN_VALUE Integer/MIN_VALUE)\nuser=\u003E 0\n\n(unchecked-subtract Integer/MIN_VALUE 0)\nuser=\u003E -2147483648\n\n(unchecked-subtract Integer/MIN_VALUE 1)\nuser=\u003E 2147483647\n\n(unchecked-subtract Integer/MIN_VALUE 54444444)\nuser=\u003E 2093039204\n\n(unchecked-subtract 123456 654321)\nuser=\u003E -530865","created-at":1289216520000,"updated-at":1289267876000,"_id":"542692cac026201cdc326b46"}],"notes":null,"arglists":["x y"],"doc":"Returns the difference of x and y, both long.\n Note - uses a primitive operator subject to overflow.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/unchecked-subtract"},{"added":"1.10","ns":"clojure.core","name":"tap\u003E","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":8124,"examples":null,"notes":null,"arglists":["x"],"doc":"sends x to any taps. Will not block. Returns true if there was room in the queue,\n false if not (dropped).","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/tap\u003E"},{"added":"1.0","ns":"clojure.core","name":"*warn-on-reflection*","type":"var","see-alsos":null,"examples":[{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"}],"body":";; define two variables then set *warn-on-reflection* to true and try to call\n;; one of their Java methods. Warnings are generated in both cases\n;; set *warn-on-reflection* to false and note that you can call both functions\n;; without a warning\n\nuser=\u003E (def i 23)\n#'user/i\nuser=\u003E (def s \"123\")\n#'user/s\nuser=\u003E (set! *warn-on-reflection* true)\ntrue\nuser=\u003E (.toString i)\nReflection warning, NO_SOURCE_PATH:4 - reference to field toString can't be resolved.\n\"23\"\nuser=\u003E (.toString s)\nReflection warning, NO_SOURCE_PATH:5 - reference to field toString can't be resolved.\n\"123\"\nuser=\u003E (set! *warn-on-reflection* false)\nfalse\nuser=\u003E (.toString i)\n\"23\"\nuser=\u003E (.toString s)\n\"123\"\nuser=\u003E","created-at":1313969775000,"updated-at":1313969812000,"_id":"542692c9c026201cdc326a80"}],"notes":null,"arglists":[],"doc":"When set to true, the compiler will emit warnings when reflection is\n needed to resolve Java method calls or field accesses.\n\n Defaults to false.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/*warn-on-reflection*"},{"added":"1.1","ns":"clojure.core","name":"sorted-set-by","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1317095652000,"author":{"login":"pauldoo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5cb916d3c8abc9f45a093209e72489fb?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"sorted-set","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e50"},{"created-at":1353458232000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"sorted-map-by","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e51"},{"created-at":1353822010000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"compare","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e52"}],"line":427,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[],"body":"user\u003E (sorted-set-by \u003E 3 5 8 2 1)\n#{8 5 3 2 1}","created-at":1286955847000,"updated-at":1286955847000,"_id":"542692cdc026201cdc326ccc"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[],"body":";; Be cautious about comparison functions that only compare part of\n;; the objects:\nuser=\u003E (defn second-\u003C [x y]\n (\u003C (second x) (second y)))\nuser=\u003E (sorted-set-by second-\u003C [:a 1] [:b 1] [:c 1])\n#{[:a 1]}\n\n;; Where did the other elements go?\n\n;; Replacing \u003C with \u003C= might look like a fix, but doesn't work,\n;; either:\nuser=\u003E (defn second-\u003C= [x y]\n (\u003C= (second x) (second y)))\nuser=\u003E (def s2 (sorted-set-by second-\u003C= [:a 1] [:b 1] [:c 1]))\n#'user/s2\nuser=\u003E s2\n#{[:c 1] [:b 1] [:a 1]}\n;; So far, so good, but set membership tests can't find the elements.\nuser=\u003E (contains? s2 [:b 1])\nfalse\nuser=\u003E (s2 [:c 1])\nnil\n\n;; Here is one way to write a good comparison function. When the two\n;; objects are equal in the parts we care about, use the tie-breaker\n;; 'compare' on the whole values to give them a consistent order that\n;; is only equal if the entire values are equal.\nuser=\u003E (defn second-\u003C-with-tie-break [x y]\n (let [c (compare (second x) (second y))]\n (if (not= c 0)\n c\n ;; Otherwise we don't care as long as ties are broken\n ;; consistently.\n (compare x y))))\nuser=\u003E (def s3 (sorted-set-by second-\u003C-with-tie-break [:a 1] [:b 1] [:c 1]))\n#'user/s3\nuser=\u003E s3\n#{[:a 1] [:b 1] [:c 1]}\nuser=\u003E (contains? s3 [:b 1])\ntrue\nuser=\u003E (s3 [:c 1])\n[:c 1]\n;; All good now!","created-at":1353462397000,"updated-at":1353462397000,"_id":"542692d5c026201cdc327096"}],"notes":null,"arglists":["comparator & keys"],"doc":"Returns a new sorted set with supplied keys, using the supplied\n comparator. Any equal keys are handled as if by repeated uses of\n conj.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/sorted-set-by"},{"added":"1.0","ns":"clojure.core","name":"sync","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1285922313000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"dosync","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c4a"}],"line":2515,"examples":null,"macro":true,"notes":[{"updated-at":1285922372000,"body":"Same as dosync but allows for extra options (which are not currently supported). Probably best to use dosync instead at the moment.","created-at":1285922372000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521f97"}],"arglists":["flags-ignored-for-now & body"],"doc":"transaction-flags =\u003E TBD, pass nil for now\n\n Runs the exprs (in an implicit do) in a transaction that encompasses\n exprs and any nested calls. Starts a transaction if none is already\n running on this thread. Any uncaught exception will abort the\n transaction and flow out of sync. The exprs may be run more than\n once, but any effects on Refs will be atomic.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/sync"},{"added":"1.9","ns":"clojure.core","name":"qualified-ident?","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":1637,"examples":null,"notes":null,"arglists":["x"],"doc":"Return true if x is a symbol or keyword with a namespace","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/qualified-ident_q"},{"added":"1.0","ns":"clojure.core","name":"assert","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":null,"line":4866,"examples":[{"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (assert true)\nnil\n\nuser=\u003E (assert false)\njava.lang.AssertionError: Assert failed: false (NO_SOURCE_FILE:0)\n\nuser=\u003E (assert nil)\njava.lang.AssertionError: Assert failed: nil (NO_SOURCE_FILE:0)\n\nuser=\u003E (assert 0)\nnil\n\nuser=\u003E (assert [1 2 3])\nnil\n\nuser=\u003E (assert \"foo\")\nnil","created-at":1280547946000,"updated-at":1285496150000,"_id":"542692cac026201cdc326aff"}],"macro":true,"notes":[{"updated-at":1372297439000,"body":"The documentation (\"... and throws an exception if ...\") is incorrect. It throws AssertionError which an Error and not an Exception. They both extend Throwable but Error is not an Exception.","created-at":1372297439000,"author":{"login":"Steve Kuo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/160d6580f280b5e9e5a1188b32c4ef2d?r=PG&default=identicon"},"_id":"542692edf6e94c6970522007"}],"arglists":["x","x message"],"doc":"Evaluates expression x and throws an AssertionError with optional\n message if x does not evaluate to logical true.\n\n Assertion checks are omitted from compiled code if '*assert*' is\n false.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/assert"},{"added":"1.0","ns":"clojure.core","name":"*compile-path*","type":"var","see-alsos":null,"examples":null,"notes":null,"arglists":[],"doc":"Specifies the directory where 'compile' will write out .class\n files. This directory must be in the classpath for 'compile' to\n work.\n\n Defaults to \"classes\"","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/*compile-path*"},{"added":"1.0","ns":"clojure.core","name":"true?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1303250769000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"false?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521da5"}],"line":514,"examples":[{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (true? true)\ntrue\nuser=\u003E (true? 1)\nfalse\nuser=\u003E (true? (= 1 1))\ntrue","created-at":1279075280000,"updated-at":1332951307000,"_id":"542692c7c026201cdc32699f"}],"notes":null,"tag":"java.lang.Boolean","arglists":["x"],"doc":"Returns true if x is the value true, false otherwise.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/true_q"},{"added":"1.0","ns":"clojure.core","name":"release-pending-sends","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":2150,"examples":null,"notes":null,"arglists":[""],"doc":"Normally, actions sent directly or indirectly during another action\n are held until the action completes (changes the agent's\n state). This function can be used to dispatch any pending sent\n actions immediately. This has no impact on actions sent during a\n transaction, which are still held until commit. If no action is\n occurring, does nothing. Returns the number of actions dispatched.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/release-pending-sends"},{"added":"1.0","ns":"clojure.core","name":"print","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1290672979000,"author":{"login":"dale","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a7a1eca257c6cea943fea41e5cc3e9a3?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"pr","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ca4"},{"created-at":1374264324000,"author":{"login":"lbeschastny","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/416170465e4045f810f09a9300dda4dd?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"println","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ca5"},{"created-at":1374264330000,"author":{"login":"lbeschastny","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/416170465e4045f810f09a9300dda4dd?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"print-str","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ca6"}],"line":3750,"examples":[{"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"editors":[],"body":";; same as println, but without a newline\nuser\u003E (print \"foo\") (print \"foo\")\nfoofoo","created-at":1293674014000,"updated-at":1293674014000,"_id":"542692c8c026201cdc326a67"}],"notes":null,"arglists":["& more"],"doc":"Prints the object(s) to the output stream that is the current value\n of *out*. print and println produce output for human consumption.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/print"},{"added":"1.0","ns":"clojure.core","name":"empty","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1311798862000,"author":{"login":"OnesimusUnbound","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fa4c391db0d2d1744cc2cd0d787dd3d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"not-empty","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521caf"}],"line":5294,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"OnesimusUnbound","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fa4c391db0d2d1744cc2cd0d787dd3d?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"steloflute","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fc0969cd0910a427052f0f6281967392?r=PG&default=identicon"},{"login":"pmbauer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/65f765955a0a25d112d33528ae6f811b?r=PG&default=identicon"},{"login":"rafmagana","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/40bd727b22d74930f292b63d45a71b07?r=PG&default=identicon"}],"body":"user=\u003E (empty [1 2 3])\n[]\n\nuser=\u003E (empty (list 1 2 3))\n()\n\nuser=\u003E (map empty [[\\a \\b] {1 2} (range 4)])\n([] {} ())\n\nuser=\u003E (swap! (atom (range 10)) empty) \n()","created-at":1280319600000,"updated-at":1406096605000,"_id":"542692c6c026201cdc326901"},{"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"editors":[{"login":"rafmagana","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/40bd727b22d74930f292b63d45a71b07?r=PG&default=identicon"}],"body":";; The output will not necessarily be of the same JVM class as the input\nuser=\u003E (class (seq [1]))\nclojure.lang.PersistentVector$ChunkedSeq\n\nuser=\u003E (class (empty (seq [1])))\nclojure.lang.PersistentList$EmptyList\n","created-at":1349755361000,"updated-at":1406096618000,"_id":"542692d2c026201cdc326f9a"}],"notes":null,"arglists":["coll"],"doc":"Returns an empty collection of the same category as coll, or nil","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/empty"},{"added":"1.0","ns":"clojure.core","name":"remove-method","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1337585035000,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"get-method","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521abc"},{"created-at":1337585038000,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"methods","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521abd"},{"created-at":1337585113000,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"remove-all-methods","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521abe"},{"created-at":1341270408000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"prefers","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521abf"},{"created-at":1341270413000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"defmulti","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ac0"},{"created-at":1341270415000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"defmethod","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ac1"}],"line":1813,"examples":[{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[],"body":";; long example showing setting up a multi-method, then removing one of the \n;; methods, showing the multi-method has been removed\n\nuser=\u003E (defmulti tos :Ob)\nnil\nuser=\u003E (defn line [p1 p2] {:Ob :line :p1 p1 :p2 p2})\n#'user/line\nuser=\u003E (defn circle [cent rad] {:Ob :circle :cent cent :rad rad})\n#'user/circle\nuser=\u003E (defmethod tos :line [l] (str \"Line:\" (l :p1) (l :p2)))\n#\u003CMultiFn clojure.lang.MultiFn@73aecc3a\u003E\nuser=\u003E (defmethod tos :circle [c] (str \"Circle:\" (c :cent) (c :rad)))\n#\u003CMultiFn clojure.lang.MultiFn@73aecc3a\u003E\nuser=\u003E (def cc (circle [2 3] 3.3))\n#'user/cc\nuser=\u003E (def ll (line [1 1][0 0]))\n#'user/ll\nuser=\u003E (tos cc)\n\"Circle:[2 3]3.3\"\nuser=\u003E (tos ll)\n\"Line:[1 1][0 0]\"\nuser=\u003E (remove-method tos :line)\n#\u003CMultiFn clojure.lang.MultiFn@73aecc3a\u003E\nuser=\u003E (tos ll)\njava.lang.IllegalArgumentException: No method in multimethod 'tos' for dispatch\nvalue: :line (NO_SOURCE_FILE:0)\nuser=\u003E\n","created-at":1313919038000,"updated-at":1313919038000,"_id":"542692c6c026201cdc32690a"}],"notes":null,"arglists":["multifn dispatch-val"],"doc":"Removes the method of multimethod associated with dispatch-value.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/remove-method"},{"added":"1.0","ns":"clojure.core","name":"*in*","type":"var","see-alsos":[{"created-at":1302912160000,"author":{"login":"hoornet","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5834f829a9def19620d4014c46642172?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"*out*","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f55"}],"examples":null,"notes":null,"arglists":[],"doc":"A java.io.Reader object representing standard input for read operations.\n\n Defaults to System/in, wrapped in a LineNumberingPushbackReader","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/*in*"},{"ns":"clojure.core","name":"print-ctor","file":"clojure/core_print.clj","type":"function","column":1,"see-alsos":null,"line":97,"examples":null,"notes":null,"arglists":["o print-args w"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core/print-ctor"},{"added":"1.0","ns":"clojure.core","name":"letfn","special-form":true,"file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1290671346000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"let","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d4f"}],"line":6622,"examples":[{"author":{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"maciek","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/44d451ffa4fe640f2a0f6ec05bf5d962?r=PG&default=identicon"},{"login":"maciek","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/44d451ffa4fe640f2a0f6ec05bf5d962?r=PG&default=identicon"},{"login":"maciek","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/44d451ffa4fe640f2a0f6ec05bf5d962?r=PG&default=identicon"}],"body":"user=\u003E (letfn [(twice [x]\n (* x 2))\n (six-times [y]\n (* (twice y) 3))]\n (println \"Twice 15 =\" (twice 15))\n (println \"Six times 15 =\" (six-times 15)))\nTwice 15 = 30\nSix times 15 = 90\nnil\n\n;; Unable to resolve symbol: twice in this context\nuser=\u003E (twice 4)\n; Evaluation aborted.\n\n;; Unable to resolve symbol: six-times in this context\nuser=\u003E (six-times 100)\n; Evaluation aborted.\n","created-at":1279163187000,"updated-at":1300646610000,"_id":"542692c7c026201cdc32694c"}],"macro":true,"notes":[{"updated-at":1315519060000,"body":"Using `letfn` allows you to create local functions that reference each other whereas `(let myfunc #(...)]...)` wouldn't because it executes its bindings serially.","created-at":1315519060000,"author":{"login":"Justinus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1d9575e413b2eb108a35552b7cc0b54f?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fca"}],"url":null,"arglists":["fnspecs & body"],"doc":"fnspec ==\u003E (fname [params*] exprs) or (fname ([params*] exprs)+)\n\n Takes a vector of function specs and a body, and generates a set of\n bindings of functions to their names. All of the names are available\n in all of the definitions of the functions, as well as the body.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/letfn","forms":["(letfn [fnspecs*] exprs*)"]},{"added":"1.7","ns":"clojure.core","name":"volatile!","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":2542,"examples":null,"notes":null,"tag":"clojure.lang.Volatile","arglists":["val"],"doc":"Creates and returns a Volatile with an initial value of val.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/volatile!"},{"added":"1.0","ns":"clojure.core","name":"/","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1330259296000,"author":{"login":"frangio","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/646001f0ba2b7df47a16c0a1d5b62225?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"quot","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dc8"}],"line":1022,"examples":[{"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"editors":[{"login":"replore","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e7869fe1a48cb1814c657eaca6bea3eb?r=PG&default=identicon"},{"login":"replore","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e7869fe1a48cb1814c657eaca6bea3eb?r=PG&default=identicon"},{"login":"jmglov","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/67e9a6f766dc4b30bd5e9ff3e77c1777?r=PG&default=identicon"}],"body":"\u003Cpre\u003E\nuser=\u003E (/ 6 3)\n2\n\nuser=\u003E (/ 6 3 2)\n1\n\nuser=\u003E (/ 10)\n1/10\n\nuser=\u003E (/ 1 3)\n1/3\n\nuser=\u003E (/)\nArityException Wrong number of args (0) passed to: core$-SLASH-\n\nuser=\u003E (/ 1 0)\njava.lang.ArithmeticException\n\nuser=\u003E (/ 0)\njava.lang.ArithmeticException\n\u003C/pre\u003E","created-at":1279992021000,"updated-at":1392659435000,"_id":"542692c9c026201cdc326ac5"},{"author":{"login":"rebcabin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/880b0bb3a4be9237326dd69565444dee?r=PG&default=identicon"},"editors":[],"body":";;; Automatically handles floating point:\n\nuser=\u003E (/ 43.0 2)\n21.5","created-at":1387152003000,"updated-at":1387152003000,"_id":"542692d1c026201cdc326f44"}],"notes":null,"arglists":["x","x y","x y & more"],"doc":"If no denominators are supplied, returns 1/numerator,\n else returns numerator divided by all of the denominators.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/_fs"},{"added":"1.0","ns":"clojure.core","name":"read-line","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":3822,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (read-line)\nline to be read ;Type text into console\n\"line to be read\"\n","created-at":1282634673000,"updated-at":1285494406000,"_id":"542692c6c026201cdc3268c5"}],"notes":null,"arglists":[""],"doc":"Reads the next line from stream that is the current value of *in* .","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/read-line"},{"added":"1.7","ns":"clojure.core","name":"reader-conditional?","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":7970,"examples":null,"notes":null,"arglists":["value"],"doc":"Return true if the value is the data representation of a reader conditional","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/reader-conditional_q"},{"added":"1.0","ns":"clojure.core","name":"bit-or","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":1316,"examples":[{"author":{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},"editors":[{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},{"login":"adeel","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd14b215b86d93682addd69690ece881?r=PG&default=identicon"}],"body":"user=\u003E (bit-or 2r1100 2r1001)\n13\n;; 13 = 2r1101\n\n;; the same in decimal\nuser=\u003E (bit-or 12 9)\n13\n","created-at":1280337691000,"updated-at":1303117577000,"_id":"542692c6c026201cdc326929"}],"notes":null,"arglists":["x y","x y & more"],"doc":"Bitwise or","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/bit-or"},{"added":"1.0","ns":"clojure.core","name":"clear-agent-errors","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1282643269000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"restart-agent","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f32"}],"line":2263,"examples":null,"deprecated":"1.2","notes":null,"arglists":["a"],"doc":"DEPRECATED: Use 'restart-agent' instead.\n Clears any exceptions thrown during asynchronous actions of the\n agent, allowing subsequent actions to occur.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/clear-agent-errors"},{"added":"1.0","ns":"clojure.core","name":"vector","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1291953313000,"author":{"login":"alimoeeny","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e8dd06976ead4082d2181f3807117e1?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"vec","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d25"},{"created-at":1291953319000,"author":{"login":"alimoeeny","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e8dd06976ead4082d2181f3807117e1?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"vector?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d26"},{"created-at":1291953324000,"author":{"login":"alimoeeny","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e8dd06976ead4082d2181f3807117e1?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"vector-of","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d27"},{"created-at":1291953354000,"author":{"login":"alimoeeny","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e8dd06976ead4082d2181f3807117e1?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"pop","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d28"},{"created-at":1343081413000,"author":{"login":"john.r.woodward","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/22b6fbc4a386291e45b1cb4449377086?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"into","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d29"}],"line":355,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},{"login":"rafmagana","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/40bd727b22d74930f292b63d45a71b07?r=PG&default=identicon"}],"body":";; create an empty vector the long way\nuser=\u003E (vector)\n[]\n\n;; create an empty vector the short way\nuser=\u003E []\n[]\n\n;; you can even create vectors with nil values\nuser=\u003E (vector nil)\n[nil]\n\n;; create a vector the long way\nuser=\u003E (vector 1 2 3)\n[1 2 3]\n\n;; create a vector the short way\nuser=\u003E [1 2 3]\n[1 2 3]\n\n;; checking for the 2 results above\nuser=\u003E (class (vector 1 2 3))\nclojure.lang.PersistentVector\n\nuser=\u003E (class [1 2 3])\nclojure.lang.PersistentVector\n\nuser=\u003E (= (vector 1 2 3) [1 2 3])\ntrue\n\n","created-at":1281948660000,"updated-at":1340285477000,"_id":"542692c9c026201cdc326aa6"},{"author":{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},"editors":[{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; Destructuring with a vector, inside a \"let\" form, a simple case (a symbol\n;; for each element):\n\n;; destructuring with an inline vector\nuser=\u003E (let [[first-element second-element third-element fourth-element] \n [10 20 30 40]] \n (str \"first=\" first-element \" second=\" second-element \n \" third=\" third-element \" fourth=\" fourth-element))\n\"first=10 second=20 third=30 fourth=40\"\n;; notice how 4 symbols were created pointing to the scalars 10, 20, 30 and 40\n\n\n;; destructuring with a symbol to a vector\nuser=\u003E (def my-vector [1 2 3 4])\n#'user/my-vector\n\nuser=\u003E (let [[first-element second-element third-element fourth-element] my-vector] \n (str \"first=\" first-element \" second=\" second-element \n \" third=\" third-element \" fourth=\" fourth-element))\n\"first=1 second=2 third=3 fourth=4\"","created-at":1285529828000,"updated-at":1285725388000,"_id":"542692c9c026201cdc326aaa"},{"author":{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},"editors":[{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":";; Destructuring with a vector, inside a \"let\" form, more complex cases:\n\nuser=\u003E (let [[first-element second-element & the-rest] my-vector] \n (str \"first=\" first-element \" second=\" second-element \" \n the-rest=\" the-rest))\n\"first=1 second=2 the-rest=(3 4)\"\n;; notice how \"the-rest\" is a sequence\n\nuser=\u003E (let [[first-element second-element third-element fourth-element \n :as everything] \n my-vector] \n (str \"first=\" first-element \" second=\" second-element \" \n third=\" third-element \" fourth=\" fourth-element \" \n everything=\" everything))\n\"first=1 second=2 third=3 fourth=4 everything=[1 2 3 4]\"\n;; notice how \"everything\" is the whole vector","created-at":1285529834000,"updated-at":1331682689000,"_id":"542692c9c026201cdc326ab3"}],"notes":null,"arglists":["","a","a b","a b c","a b c d","a b c d e","a b c d e f","a b c d e f & args"],"doc":"Creates a new vector containing the args.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/vector"},{"added":"1.0","ns":"clojure.core","name":"proxy-super","file":"clojure/core_proxy.clj","type":"macro","column":1,"see-alsos":[{"created-at":1354011410000,"author":{"login":"juan.facorro","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d6f59d93cc17c698f16e550034a2d1ad?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"proxy","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d30"}],"line":396,"examples":[{"author":{"login":"juan.facorro","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d6f59d93cc17c698f16e550034a2d1ad?r=PG&default=identicon"},"editors":[{"login":"juan.facorro","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d6f59d93cc17c698f16e550034a2d1ad?r=PG&default=identicon"},{"login":"juan.facorro","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d6f59d93cc17c698f16e550034a2d1ad?r=PG&default=identicon"},{"login":"juan.facorro","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d6f59d93cc17c698f16e550034a2d1ad?r=PG&default=identicon"}],"body":";; Create a proxy for java.util.ArrayList that overrides the add() \n;; method and calls the super class implementation using proxy-super.\n(def lst (proxy [java.util.ArrayList] []\n (add [x]\n (println \"Adding some stuff:\" x)\n (proxy-super add x))))\n\nuser=\u003E (.add lst 1)\nAdding some stuff: 1\ntrue\n\nuser=\u003E (.add lst 2)\nAdding some stuff: 2\ntrue\n\nuser=\u003E (.add lst [:this :is :some :other :stuff])\nAdding some stuff: [:this :is :some :other :stuff]\ntrue\n\nuser=\u003E (.size lst)\n3\n\n\n ","created-at":1354011876000,"updated-at":1354012030000,"_id":"542692d4c026201cdc327042"}],"macro":true,"notes":[{"updated-at":1401348603000,"body":"Note that proxy-super calls are not reentrant. If calling the base method results in another call to the virtual method you are overriding (before the proxy-super call has returned), your proxy's code will not be invoked. Instead, the call will go directly to the base class's method.\r\n","created-at":1401348603000,"author":{"login":"glchapman","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a5176d5d971ba68c15f4afe376aeaf18?r=PG&default=identicon"},"_id":"542692edf6e94c6970522027"}],"arglists":["meth & args"],"doc":"Use to call a superclass method in the body of a proxy method. \n Note, expansion captures 'this","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/proxy-super"},{"added":"1.0","ns":"clojure.core","name":"\u003E=","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":1087,"examples":[{"author":{"login":"mattdw","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ee24aacb65359196b0a1bad050f9a62f?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (\u003E= 2 1)\ntrue\nuser=\u003E (\u003E= 2 2)\ntrue\nuser=\u003E (\u003E= 1 2)\nfalse\nuser=\u003E (\u003E= 6 5 4 3 2)\ntrue","created-at":1280321990000,"updated-at":1332950567000,"_id":"542692ccc026201cdc326cae"}],"notes":null,"arglists":["x","x y","x y & more"],"doc":"Returns non-nil if nums are in monotonically non-increasing order,\n otherwise false.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/\u003E="},{"added":"1.0","ns":"clojure.core","name":"drop-last","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1298747615000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"drop","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f41"},{"created-at":1298747622000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"drop-while","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f42"}],"line":2957,"examples":[{"author":{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (drop-last [1 2 3 4])\n(1 2 3) \n\nuser=\u003E (drop-last -1 [1 2 3 4])\n(1 2 3 4) \n\nuser=\u003E (drop-last 0 [1 2 3 4])\n(1 2 3 4) \n\nuser=\u003E (drop-last 2 [1 2 3 4])\n(1 2)\n\nuser=\u003E (drop-last 5 [1 2 3 4])\n()","created-at":1280344984000,"updated-at":1332951616000,"_id":"542692cbc026201cdc326bc8"}],"notes":null,"arglists":["coll","n coll"],"doc":"Return a lazy sequence of all but the last n (default 1) items in coll","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/drop-last"},{"added":"1.0","ns":"clojure.core","name":"not-empty","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1311798738000,"author":{"login":"OnesimusUnbound","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fa4c391db0d2d1744cc2cd0d787dd3d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"empty","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d87"}],"line":5590,"examples":[{"author":{"login":"OnesimusUnbound","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fa4c391db0d2d1744cc2cd0d787dd3d?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (not-empty [])\nnil\nuser=\u003E (not-empty [1])\n[1]\nuser=\u003E (not-empty [1 3 5])\n[1 3 5]","created-at":1311798802000,"updated-at":1311798802000,"_id":"542692cfc026201cdc326e48"}],"notes":null,"arglists":["coll"],"doc":"If coll is empty, returns nil, else coll","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/not-empty"},{"added":"1.0","ns":"clojure.core","name":"distinct","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1396938593000,"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"distinct?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c04"}],"line":5082,"examples":[{"author":{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},"editors":[{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (distinct [1 2 1 3 1 4 1 5])\n(1 2 3 4 5)","created-at":1280343931000,"updated-at":1332949923000,"_id":"542692c7c026201cdc3269aa"},{"author":{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (def fractions \n (for [n (range 1 100) d (range (inc n) 100)] \n (let [gcd (clojure.contrib.math/gcd n d)] \n (/ (/ n gcd) (/ d gcd)))))\n;; all irreducible fractions with denominator \u003C 100\n;; (1/2 1/3 ... 1/99 2/3 1/2 2/5 1/3 ...)\n\nuser=\u003E (count fractions)\n4851\n\nuser=\u003E (count (distinct fractions))\n3003\n","created-at":1280343971000,"updated-at":1285496532000,"_id":"542692c7c026201cdc3269ad"}],"notes":[{"updated-at":1285266859000,"body":"If you do not need the lazyness of distinct, set can be faster. Like: (count (set some-coll)).","created-at":1285266859000,"author":{"login":"morphling","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/90ffa70a579c3e0c398b7523ecdc6a87?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521f96"},{"updated-at":1389130101000,"body":"Use this function if you want to remove only consequtive duplicates\r\n\r\n (defn distinct-consequtive [sequence] (map first (partition-by identity sequence)))\r\n\r\n (distinct-consequtive [1 1 2 3 3 2 2 3])\r\n ;=\u003E (1 2 3 2 3)","created-at":1389130101000,"author":{"login":"vshatsky","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/20b6441a990cf524f4ce73f67f3a56d8?r=PG&default=identicon"},"_id":"542692edf6e94c6970522018"}],"arglists":["","coll"],"doc":"Returns a lazy sequence of the elements of coll with duplicates removed.\n Returns a stateful transducer when no collection is provided.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/distinct"},{"added":"1.0","ns":"clojure.core","name":"partition","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1297761042000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"partition-all","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521da0"},{"created-at":1314290633000,"author":{"login":"Havvy","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e799a79441c7543be48562403411cd13?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"split-at","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521da1"},{"created-at":1324097144000,"author":{"login":"rjack","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7a561494c10e6fd3367f7a0bbc18da27?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"partition-by","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521da2"}],"line":3202,"examples":[{"author":{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (partition 4 (range 20))\n((0 1 2 3) (4 5 6 7) (8 9 10 11) (12 13 14 15) (16 17 18 19))\n\nuser=\u003E (partition 4 (range 22))\n((0 1 2 3) (4 5 6 7) (8 9 10 11) (12 13 14 15) (16 17 18 19))\n\nuser=\u003E (partition 4 6 (range 20))\n((0 1 2 3) (6 7 8 9) (12 13 14 15))\n\nuser=\u003E (partition 4 6 [\"a\"] (range 20))\n((0 1 2 3) (6 7 8 9) (12 13 14 15) (18 19 \"a\"))\n\nuser=\u003E (partition 4 6 [\"a\" \"b\" \"c\" \"d\"] (range 20))\n((0 1 2 3) (6 7 8 9) (12 13 14 15) (18 19 \"a\" \"b\"))\n","created-at":1279644356000,"updated-at":1285497752000,"_id":"542692cdc026201cdc326d23"},{"author":{"login":"uvtc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/34f159f89cbd1d9beac0276f5a7af552?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (partition 3 1 [:a :b :c :d :e :f])\n((:a :b :c) (:b :c :d) (:c :d :e) (:d :e :f))\n","created-at":1340078697000,"updated-at":1340078697000,"_id":"542692d4c026201cdc327027"},{"author":{"login":"Parijat Mishra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e3aba44539a78ea92373418456f090e3?r=PG&default=identicon"},"editors":[],"body":";; When there are less than n items in the coll, partition's behaviour\n;; depends on whether there is a pad or not\n\n;; without pad\nuser\u003E (partition 10 [1 2 3 4])\n()\n;; again, without pad\nuser\u003E (partition 10 10 [1 2 3 4])\n()\n;; with a pad this time (note: the pad is an empty sequence)\nuser\u003E (partition 10 10 nil [1 2 3 4])\n((1 2 3 4))\n;; or, explicit empty sequence instead of nil\nuser\u003E (partition 10 10 [] [1 2 3 4])\n((1 2 3 4))\n","created-at":1340625444000,"updated-at":1340625444000,"_id":"542692d4c026201cdc327028"}],"notes":null,"arglists":["n coll","n step coll","n step pad coll"],"doc":"Returns a lazy sequence of lists of n items each, at offsets step\n apart. If step is not supplied, defaults to n, i.e. the partitions\n do not overlap. If a pad collection is supplied, use its elements as\n necessary to complete last partition upto n items. In case there are\n not enough padding elements, return a partition with less than n items.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/partition"},{"added":"1.0","ns":"clojure.core","name":"loop","special-form":true,"file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1289617722000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"recur","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d7a"},{"created-at":1289618043000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"trampoline","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d7b"},{"created-at":1342652485000,"author":{"login":"john.r.woodward","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/22b6fbc4a386291e45b1cb4449377086?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"when","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d7c"},{"created-at":1360216647000,"author":{"login":"Phalphalak","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a684c0fd4f27597437de953e92a15d4b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"while","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d7d"}],"line":4624,"examples":[{"author":{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},"editors":[{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"}],"body":";looping is recursive in Clojure, the loop construct is a hack so that something like tail-recursive-optimization works in clojure.\nuser=\u003E (defn my-re-seq [re string]\n \"Something like re-seq\"\n (let [matcher (re-matcher re string)]\n\n (loop [match (re-find matcher) ;loop starts with 2 set arguments\n result []]\n (if-not match\n result\n (recur (re-find matcher) ;loop with 2 new arguments\n (conj result match))))))\n\n#'user/my-re-seq\n\nuser=\u003E (my-re-seq #\"\\d\" \"0123456789\")\n[\"0\" \"1\" \"2\" \"3\" \"4\" \"5\" \"6\" \"7\" \"8\" \"9\"]\n\n","created-at":1279054191000,"updated-at":1289797326000,"_id":"542692c8c026201cdc3269f4"},{"author":{"login":"devijvers","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/81018e4231ac1ce8b7a9e6d377092656?r=PG&default=identicon"},"editors":[{"login":"devijvers","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/81018e4231ac1ce8b7a9e6d377092656?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; Read decoded MP3 data in loop (requires mp3plugin.jar on class path)\n;; http://java.sun.com/javase/technologies/desktop/media/jmf/mp3/download.html \n\n(import '(javax.sound.sampled AudioSystem AudioFormat$Encoding))\n\n(let [mp3-file (java.io.File. \"tryout.mp3\")\n audio-in (AudioSystem/getAudioInputStream mp3-file)\n audio-decoded-in (AudioSystem/getAudioInputStream AudioFormat$Encoding/PCM_SIGNED audio-in)\n buffer (make-array Byte/TYPE 1024)]\n (loop []\n (let [size (.read audio-decoded-in buffer)]\n (when (\u003E size 0)\n ;do something with PCM data\n\t(recur)))))\n","created-at":1279556129000,"updated-at":1285499929000,"_id":"542692c8c026201cdc3269f8"},{"author":{"login":"john.r.woodward","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/22b6fbc4a386291e45b1cb4449377086?r=PG&default=identicon"},"editors":[],"body":"(loop [x 10]\n (when (\u003E x 1)\n (println x)\n (recur (- x 2))))","created-at":1342652380000,"updated-at":1342652380000,"_id":"542692d4c026201cdc326ff6"},{"author":{"login":"dansalmo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e33ee460f5f61bc5ba9b598934766215?r=PG&default=identicon"},"editors":[],"body":"(defn find-needle [needle haystack]\n ;loop binds initial values once,\n ;then binds values from each recursion call\n (loop [needle needle\n maybe-here haystack\n not-here '()]\n\n (let [needle? (first maybe-here)]\n\n ;test for return or recur\n (if (or (= (str needle?) (str needle))\n (empty? maybe-here))\n\n ;return results\n [needle? maybe-here not-here]\n\n ;recur calls loop with new values\n (recur needle\n (rest maybe-here)\n (concat not-here (list (first maybe-here))))))))\n\nuser=\u003E(find-needle \"|\" \"hay|stack\")\n[\\| (\\| \\s \\t \\a \\c \\k) (\\h \\a \\y)]","created-at":1345453816000,"updated-at":1345453816000,"_id":"542692d4c026201cdc326ff7"},{"author":{"login":"bartq","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b434a6540e72bcb335a026eb370da200?r=PG&default=identicon"},"editors":[],"body":"; makes a simple template function that can be used in mustache way: http://mustache.github.com/\n(defn template [tpl env]\n (loop [tpl tpl\n env env]\n (cond (empty? env)\n tpl\n :else\n (let [[key value] (first env)]\n (recur (try (clojure.string/replace tpl \n (re-pattern (str \"\\\\{\\\\{\" (name key) \"\\\\}\\\\}\")) \n value)\n (catch Exception e tpl)) \n (rest env))))))","created-at":1363378523000,"updated-at":1363378523000,"_id":"542692d4c026201cdc326ff8"}],"macro":true,"notes":[{"updated-at":1279842159000,"body":"\"Acts as a recur target.\"\r\n\r\nWhat's a recur target? A recurring target? A recursive target? I'm not a big fan of abbreviations or ambiguous terms.\r\n\r\nWouldn't it be awesome if a script could annotate all occurrences of glossary terms? Or automatically wrap glossary terms in anchor tags linking to their definition?","created-at":1279842116000,"author":{"login":"Jacolyte","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1703a0c3ed358b787f4b1bf3b2799472?r=PG&default=identicon"},"_id":"542692ebf6e94c6970521f83"},{"updated-at":1279870294000,"body":"The problem `loop` is trying to solve is that recursively calling the same function on the JVM is expensive and doesn't scale. It might work if your data structure is a thousand levels deep but it will fail badly with a depth of millions of levels.\r\n\r\nWhat is not possible on the JVM is what is called \"tail-call optimization\". `loop` is like a `while` loop in java, except that if you don't call `recur` (with the correct number of arguments) the loop will exit. In while-loop terms, `recur` avoids that a `break` statement is executed.\r\n\r\n\u003Cpre\u003Eint counter = 0;\r\nwhile (true) {\r\n if (counter < 10) {\r\n // recur\r\n counter = inc(counter);\r\n } else {\r\n break;\r\n }\r\n}\r\n\u003C/pre\u003E\r\n\r\nIn that sense `loop` is a recur target as in \"target for recursion\".","created-at":1279847110000,"author":{"login":"devijvers","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/81018e4231ac1ce8b7a9e6d377092656?r=PG&default=identicon"},"_id":"542692ebf6e94c6970521f84"},{"updated-at":1279866045000,"body":"I wish the word recur in this document linked to the recur function. That'd be... awesome.","created-at":1279866045000,"author":{"login":"Jacolyte","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1703a0c3ed358b787f4b1bf3b2799472?r=PG&default=identicon"},"_id":"542692ebf6e94c6970521f85"},{"updated-at":1279892164000,"body":"It really should (and will) show up in the 'vars in' section. \r\n\r\nThe problem is that recur is a special form, and is not parsed out correctly like other vars. This will be fixed in the future.","created-at":1279892142000,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"_id":"542692ebf6e94c6970521f86"}],"arglists":["bindings & body"],"doc":"Evaluates the exprs in a lexical context in which the symbols in\n the binding-forms are bound to their respective init-exprs or parts\n therein. Acts as a recur target.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/loop","forms":["(loop [bindings*] exprs*)"]},{"added":"1.0","ns":"clojure.core","name":"add-classpath","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":5205,"examples":null,"deprecated":"1.1","notes":null,"arglists":["url"],"doc":"DEPRECATED \n\n Adds the url (String or URL object) to the classpath per\n URLClassLoader.addURL","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/add-classpath"},{"added":"1.0","ns":"clojure.core","name":"bit-flip","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":1357,"examples":[{"author":{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (bit-flip 2r1011 2)\n15 \n;; 15 = 2r1111\n\n(bit-flip 2r1111 2)\n11 \n;; 11 = 2r1011","created-at":1280339556000,"updated-at":1332952408000,"_id":"542692c8c026201cdc326a6b"}],"notes":null,"arglists":["x n"],"doc":"Flip bit at index n","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/bit-flip"},{"added":"1.0","ns":"clojure.core","name":"long-array","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1342917397000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"longs","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ea2"}],"line":5393,"examples":[{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"}],"body":";; create a long array using long-array and show it can be used\n;; with the standard Java Arrays functions binarySearch and fill\n;; note the needed coercions\n\nuser=\u003E (def is (long-array (range 3 20)))\n#'user/is\nuser=\u003E (vec is)\n[3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19]\nuser=\u003E (java.util.Arrays/binarySearch is (long 10))\n7\nuser=\u003E (java.util.Arrays/fill is 3 8 (long 99))\nnil\nuser=\u003E (vec is)\n[3 4 5 99 99 99 99 99 11 12 13 14 15 16 17 18 19]\nuser=\u003E","created-at":1313907019000,"updated-at":1313963219000,"_id":"542692c7c026201cdc326962"}],"notes":null,"arglists":["size-or-seq","size init-val-or-seq"],"doc":"Creates an array of longs","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/long-array"},{"added":"1.0","ns":"clojure.core","name":"descendants","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1400492134000,"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ancestors","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ead"}],"line":5667,"examples":[{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[],"body":";; simple example a toy poodle is a poodle is a dog is an animal\n\nuser=\u003E (derive ::dog ::animal)\nnil\nuser=\u003E (derive ::poodle ::dog)\nnil\nuser=\u003E (derive ::toy_poodle ::poodle)\nnil\nuser=\u003E (descendants ::animal)\n#{:user/toy_poodle :user/poodle :user/dog}\nuser=\u003E","created-at":1313968073000,"updated-at":1313968073000,"_id":"542692c8c026201cdc326a24"}],"notes":null,"arglists":["tag","h tag"],"doc":"Returns the immediate and indirect children of tag, through a\n relationship established via derive. h must be a hierarchy obtained\n from make-hierarchy, if not supplied defaults to the global\n hierarchy. Note: does not work on Java type inheritance\n relationships.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/descendants"},{"added":"1.11","ns":"clojure.core","name":"iteration","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":7910,"examples":null,"notes":null,"arglists":["step & {:keys [somef vf kf initk], :or {vf identity, kf identity, somef some?, initk nil}}"],"doc":"Creates a seqable/reducible via repeated calls to step,\n a function of some (continuation token) 'k'. The first call to step\n will be passed initk, returning 'ret'. Iff (somef ret) is true,\n (vf ret) will be included in the iteration, else iteration will\n terminate and vf/kf will not be called. If (kf ret) is non-nil it\n will be passed to the next step call, else iteration will terminate.\n\n This can be used e.g. to consume APIs that return paginated or batched data.\n\n step - (possibly impure) fn of 'k' -\u003E 'ret'\n\n :somef - fn of 'ret' -\u003E logical true/false, default 'some?'\n :vf - fn of 'ret' -\u003E 'v', a value produced by the iteration, default 'identity'\n :kf - fn of 'ret' -\u003E 'next-k' or nil (signaling 'do not continue'), default 'identity'\n :initk - the first value passed to step, default 'nil'\n\n It is presumed that step with non-initk is unreproducible/non-idempotent.\n If step with initk is unreproducible it is on the consumer to not consume twice.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/iteration"},{"added":"1.0","ns":"clojure.core","name":"merge","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1294676416000,"author":{"login":"Nebulus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/61aa4140c24b0cded6b20d88200e7f16?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"merge-with","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ad7"},{"created-at":1317787765000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"hash-map","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ad8"}],"line":3065,"examples":[{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[{"login":"srid","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bd3a68d670372cd09876c26270a4299a?r=PG&default=identicon"},{"login":"srid","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bd3a68d670372cd09876c26270a4299a?r=PG&default=identicon"},{"login":"srid","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bd3a68d670372cd09876c26270a4299a?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (merge {:a 1 :b 2 :c 3} {:b 9 :d 4})\n{:d 4, :a 1, :b 9, :c 3}","created-at":1279071769000,"updated-at":1332952367000,"_id":"542692cfc026201cdc326e73"},{"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"editors":[{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"}],"body":"user=\u003E (merge {:a 1} nil)\n{:a 1}\n\nuser=\u003E (merge nil {:a 1})\n{:a 1}\n\nuser\u003E (merge nil nil)\nnil\n","created-at":1401310493000,"updated-at":1401357155000,"_id":"542692d4c026201cdc32700c"}],"notes":null,"arglists":["& maps"],"doc":"Returns a map that consists of the rest of the maps conj-ed onto\n the first. If a key occurs in more than one map, the mapping from\n the latter (left-to-right) will be the mapping in the result.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/merge"},{"added":"1.0","ns":"clojure.core","name":"accessor","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":4097,"examples":[{"author":{"login":"tormaroe","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8bc7bb10bee96efb190053fe92ffd250?r=PG&default=identicon"},"editors":[],"body":"(defstruct car-struct :make :model :year :color)\n\n(def car (struct car-struct \"Toyota\" \"Prius\" 2010))\n\n(def make (accessor car-struct :make))\n\nuser=\u003E (make car) ; Same as both (car :make) and (:make car)\n\"Toyota\" \n\n","created-at":1289603045000,"updated-at":1289603045000,"_id":"542692cac026201cdc326b11"}],"notes":null,"arglists":["s key"],"doc":"Returns a fn that, given an instance of a structmap with the basis,\n returns the value at the key. The key must be in the basis. The\n returned function should be (slightly) more efficient than using\n get, but such use of accessors should be limited to known\n performance-critical areas.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/accessor"},{"added":"1.0","ns":"clojure.core","name":"integer?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":1388,"examples":[{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (integer? 1)\ntrue\nuser=\u003E (integer? 1.0)\nfalse","created-at":1279074074000,"updated-at":1332950732000,"_id":"542692c8c026201cdc326a30"}],"notes":null,"arglists":["n"],"doc":"Returns true if n is an integer","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/integer_q"},{"added":"1.4","ns":"clojure.core","name":"mapv","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":7050,"examples":null,"notes":null,"arglists":["f coll","f c1 c2","f c1 c2 c3","f c1 c2 c3 & colls"],"doc":"Returns a vector consisting of the result of applying f to the\n set of first items of each coll, followed by applying f to the set\n of second items in each coll, until any one of the colls is\n exhausted. Any remaining items in other colls are ignored. Function\n f should accept number-of-colls arguments.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/mapv"},{"added":"1.11","ns":"clojure.core","name":"infinite?","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":8223,"examples":null,"notes":null,"arglists":["num"],"doc":"Returns true if num is negative or positive infinity, else false","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/infinite_q"},{"added":"1.2","ns":"clojure.core","name":"partition-all","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1313710375000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"partition","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c74"},{"created-at":1313710383000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"partition-by","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c75"}],"line":7388,"examples":[{"author":{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (partition 4 [0 1 2 3 4 5 6 7 8 9])\n((0 1 2 3) (4 5 6 7))\n\nuser=\u003E (partition-all 4 [0 1 2 3 4 5 6 7 8 9])\n((0 1 2 3) (4 5 6 7) (8 9))\n","created-at":1279643883000,"updated-at":1285497767000,"_id":"542692ccc026201cdc326c8e"},{"author":{"login":"Tap","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/925c5d43b739098e6f16f804f5dc4868?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (partition-all 2 4 [0 1 2 3 4 5 6 7 8 9])\n((0 1) (4 5) (8 9))","created-at":1349617127000,"updated-at":1349617127000,"_id":"542692d4c026201cdc327029"},{"author":{"login":"gerritjvv","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ee33873c26c4a6b7e1daa3ebb777d58c?r=PG&default=identicon"},"editors":[],"body":"Caution: Partitioning lazy sequence code freeze\n\n(def l [1 2 3 4 5])\n;create a simple lazy sequence function testing only\n;(rdr l) returns a lazy sequence from l\n(def rdr (fn reader[x] (cons (first x) (lazy-seq (reader (rest x))))))\n\n;the line below will freeze\n(doall (partition-all 2 (rdr l)) )\n\n;add-in a take-while statement do exit the lazy sequence on nil\n(doall (partition-all 2 (take-while (complement nil?) (rdr l))))","created-at":1373311985000,"updated-at":1373311985000,"_id":"542692d4c026201cdc32702a"}],"notes":null,"arglists":["n","n coll","n step coll"],"doc":"Returns a lazy sequence of lists like partition, but may include\n partitions with fewer than n items at the end. Returns a stateful\n transducer when no collection is provided.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/partition-all"},{"added":"1.2","ns":"clojure.core","name":"partition-by","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1313710412000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"partition","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ee1"},{"created-at":1313710420000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"partition-all","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ee2"},{"created-at":1331014947000,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"group-by","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ee3"}],"line":7308,"examples":[{"author":{"login":"wilkes","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/20a7eb5b792999d37386ddf622543c71?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (partition-by #(= 3 %) [1 2 3 4 5])\n((1 2) (3) (4 5))","created-at":1279936678000,"updated-at":1332949621000,"_id":"542692c7c026201cdc3269da"},{"author":{"login":"wilkes","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/20a7eb5b792999d37386ddf622543c71?r=PG&default=identicon"},"editors":[{"login":"wilkes","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/20a7eb5b792999d37386ddf622543c71?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (partition-by odd? [1 1 1 2 2 3 3])\n((1 1 1) (2 2) (3 3))\n\nuser=\u003E (partition-by even? [1 1 1 2 2 3 3])\n((1 1 1) (2 2) (3 3))\n","created-at":1279936736000,"updated-at":1285497469000,"_id":"542692c7c026201cdc3269dc"},{"author":{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},"editors":[{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":";; (this is part of a solution from 4clojure.com/problem 30)\nuser=\u003E (partition-by identity \"Leeeeeerrroyyy\")\n((\\L) (\\e \\e \\e \\e \\e \\e) (\\r \\r \\r) (\\o) (\\y \\y \\y))","created-at":1318525613000,"updated-at":1323074893000,"_id":"542692d4c026201cdc32702b"},{"body":";; Note that previously created 'bins' are not used when same value is seen again\nuser=\u003E (partition-by identity \"ABBA\")\n((\\A) (\\B \\B) (\\A))","author":{"login":"martinhynar","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/1698238?v=2"},"created-at":1412082807145,"updated-at":1412082807145,"_id":"542aac77e4b0df9bb778a599"}],"notes":[{"updated-at":1338786617000,"body":"It's worth mentioning that `(partition-by identity …)` is equivalent to the `Data.List.group` function in Haskell:\r\n\r\n\u003Cpre\u003E \r\n(defn group [coll]\r\n (partition-by identity coll))\r\n\u003C/pre\u003E\r\n\r\nWhich proves to be an interesting idiom:\r\n\r\n\u003Cpre\u003Euser=> (apply str \r\n (for [ch (group \"fffffffuuuuuuuuuuuu\")] \r\n (str (first ch) (count ch))))\r\n⇒ \"f7u12\"\r\n\u003C/pre\u003E","created-at":1338782914000,"author":{"login":"Iceland_jack","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c889e0a95a3bb07f90ab28ad442f1127?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fe1"}],"arglists":["f","f coll"],"doc":"Applies f to each value in coll, splitting it each time f returns a\n new value. Returns a lazy seq of partitions. Returns a stateful\n transducer when no collection is provided.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/partition-by"},{"added":"1.2","ns":"clojure.core","name":"numerator","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1314000040000,"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"denominator","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c62"}],"line":3608,"examples":[{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[],"body":";; note that the function always returns the numerator of the reduced fraction\n\nuser=\u003E (map numerator [(/ 2 4) (/ 4 6) (/ 6 8)])\n(1 2 3)\n","created-at":1313999955000,"updated-at":1313999955000,"_id":"542692cbc026201cdc326be1"}],"notes":null,"tag":"java.math.BigInteger","arglists":["r"],"doc":"Returns the numerator part of a Ratio.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/numerator"},{"added":"1.2","ns":"clojure.core","name":"object-array","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":5378,"examples":[{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[],"body":";; create an array of Java Objects using object-array\n;; and demonstrate that it can be used with the Java fill function\n\nuser=\u003E (def os (object-array [nil 23.2 \"abc\" 33]))\n#'user/os\nuser=\u003E (vec os)\n[nil 23.2 \"abc\" 33]\nuser=\u003E (java.util.Arrays/fill os 31415)\nnil\nuser=\u003E (vec os)\n[31415 31415 31415 31415]\nuser=\u003E","created-at":1313961890000,"updated-at":1313961890000,"_id":"542692c6c026201cdc3268d2"}],"notes":null,"arglists":["size-or-seq"],"doc":"Creates an array of objects","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/object-array"},{"added":"1.0","ns":"clojure.core","name":"with-out-str","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1398723561000,"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"with-in-str","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e63"}],"line":4765,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; Instead of printing the following will place the output normally\n;; sent to standard out to a string.\nuser=\u003E (with-out-str (println \"this should return as a string\"))\n\"this should return as a string\\n\"\n","created-at":1280928491000,"updated-at":1285495273000,"_id":"542692c8c026201cdc326a43"}],"macro":true,"notes":null,"arglists":["& body"],"doc":"Evaluates exprs in a context in which *out* is bound to a fresh\n StringWriter. Returns the string created by any nested printing\n calls.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/with-out-str"},{"added":"1.0","ns":"clojure.core","name":"condp","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1289183336000,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.core","name":"cond","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b46"},{"created-at":1334294023000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"if","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b47"}],"line":6430,"examples":[{"author":{"login":"jneira","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2c8ecc24181d171df85a26458b9cd5f?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; Taken from the excellent clojure tutorial:\n;; http://java.ociweb.com/mark/clojure/article.html\n\nuser=\u003E (print \"Enter a number: \")\nuser=\u003E (flush) ; stays in a buffer otherwise\nuser=\u003E (let [reader (java.io.BufferedReader. *in*) ; stdin\n line (.readLine reader)\n value (try\n (Integer/parseInt line)\n (catch NumberFormatException e line))] ;use string val if not int\n (println\n (condp = value\n 1 \"one\"\n 2 \"two\"\n 3 \"three\"\n (str \"unexpected value, \\\"\" value \\\")))\n (println\n (condp instance? value\n Number (* value 2)\n String (* (count value) 2))))\n","created-at":1278989834000,"updated-at":1285503166000,"_id":"542692cbc026201cdc326be2"},{"author":{"login":"kotarak","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5db30f607f0b5fa70d690311aa3bfd3b?r=PG&default=identicon"},"editors":[{"login":"kotarak","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5db30f607f0b5fa70d690311aa3bfd3b?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (condp some [1 2 3 4]\n #{0 6 7} :\u003E\u003E inc\n #{4 5 9} :\u003E\u003E dec\n #{1 2 3} :\u003E\u003E #(+ % 3))\n\n3","created-at":1279027225000,"updated-at":1332950852000,"_id":"542692cbc026201cdc326be4"},{"author":{"login":"kotarak","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5db30f607f0b5fa70d690311aa3bfd3b?r=PG&default=identicon"},"editors":[{"login":"kotarak","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5db30f607f0b5fa70d690311aa3bfd3b?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (condp some [1 2 3 4]\n #{0 6 7} :\u003E\u003E inc\n #{5 9} :\u003E\u003E dec)\n\njava.lang.IllegalArgumentException: No matching clause: [1 2 3 4]","created-at":1279027251000,"updated-at":1332950899000,"_id":"542692cbc026201cdc326be7"},{"author":{"login":"kotarak","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5db30f607f0b5fa70d690311aa3bfd3b?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (condp (comp seq re-seq) \"foo=bar\"\n #\"[+](\\w+)\" :\u003E\u003E #(vector (-\u003E % first (nth 1) keyword) true)\n #\"[-](\\w+)\" :\u003E\u003E #(vector (-\u003E % first (nth 1) keyword) false)\n #\"(\\w+)=(\\S+)\" :\u003E\u003E #(let [x (first %)]\n [(keyword (nth x 1)) (nth x 2)]))\n\n[:foo \"bar\"]","created-at":1279027512000,"updated-at":1332950916000,"_id":"542692cbc026201cdc326bea"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[],"body":";; See examples for \"if\" explaining Clojure's idea of logical true\n;; and logical false.","created-at":1334294027000,"updated-at":1334294027000,"_id":"542692d2c026201cdc326f69"},{"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"editors":[],"body":";;this is with liberator\n;;branching on request method\n(defresource my-resource\n :exists? (fn [{:keys [db] {query-params :query-params \n body :body \n method :request-method} \n :request}]\n \n (condp = method\n :get (my-get-exists-fn)\n :post (my-post-exists-fn))))","created-at":1367366404000,"updated-at":1367366404000,"_id":"542692d2c026201cdc326f6a"},{"author":{"login":"leesper","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/f150e0f851c74d1b9c001b901b29a287?r=PG&default=identicon"},"editors":[],"body":";; a recursive function to calculate length\n;; same as 'count'\n(defn length [lst]\n (condp = lst\n (list) 0 ; if empty list result 0\n (+ 1 (length (rest lst))))) ; default expression\n\nuser=\u003E (length '(1 2 3))\n\nuser=\u003E 3","created-at":1375971960000,"updated-at":1375971960000,"_id":"542692d2c026201cdc326f6b"},{"author":{"login":"vee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/f2fad9c9c81cfdf191f10265371f1d72?r=PG&default=identicon"},"editors":[],"body":"(condp #(%1 2 %2) 3\n = \"eq\"\n \u003C \"lt\"\n \u003E \"gt\")\n\"lt\"","created-at":1402793361000,"updated-at":1402793361000,"_id":"542692d2c026201cdc326f6c"}],"macro":true,"notes":null,"arglists":["pred expr & clauses"],"doc":"Takes a binary predicate, an expression, and a set of clauses.\n Each clause can take the form of either:\n\n test-expr result-expr\n\n test-expr :\u003E\u003E result-fn\n\n Note :\u003E\u003E is an ordinary keyword.\n\n For each clause, (pred test-expr expr) is evaluated. If it returns\n logical true, the clause is a match. If a binary clause matches, the\n result-expr is returned, if a ternary clause matches, its result-fn,\n which must be a unary function, is called with the result of the\n predicate as its argument, the result of that call being the return\n value of condp. A single default expression can follow the clauses,\n and its value will be returned if no clause matches. If no default\n expression is provided and no clause matches, an\n IllegalArgumentException is thrown.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/condp"},{"added":"1.0","ns":"clojure.core","name":"derive","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1308310489000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"parents","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c78"},{"created-at":1308310496000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ancestors","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c79"},{"created-at":1308310502000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"descendants","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c7a"},{"created-at":1308310508000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"isa?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c7b"},{"created-at":1332885397000,"author":{"login":"luskwater","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/f3b2650c3d4aa47c9e22bf9ba5596a9f?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"make-hierarchy","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c7c"},{"created-at":1341101591000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"underive","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c7d"}],"line":5679,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[],"body":";; derive let you build a hierarchy but parents/ancestors/descendants and isa? let you query the hierarchy\n(derive ::rect ::shape)\n(derive ::square ::rect)\n","created-at":1308310469000,"updated-at":1308310469000,"_id":"542692c7c026201cdc3269d0"},{"author":{"login":"OnesimusUnbound","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fa4c391db0d2d1744cc2cd0d787dd3d?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (derive ::Cat ::Feline)\nnil\n\nuser=\u003E (derive ::Lion ::Feline)\nnil\n\nuser=\u003E (isa? ::Lion ::Feline)\ntrue\n\nuser=\u003E (isa? ::Tuna ::Feline)\nfalse","created-at":1313009794000,"updated-at":1313009794000,"_id":"542692c7c026201cdc3269d1"}],"notes":null,"arglists":["tag parent","h tag parent"],"doc":"Establishes a parent/child relationship between parent and\n tag. Parent must be a namespace-qualified symbol or keyword and\n child can be either a namespace-qualified symbol or keyword or a\n class. h must be a hierarchy obtained from make-hierarchy, if not\n supplied defaults to, and modifies, the global hierarchy.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/derive"},{"added":"1.12","ns":"clojure.core","name":"partitionv-all","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":7451,"examples":null,"notes":null,"arglists":["n","n coll","n step coll"],"doc":"Returns a lazy sequence of vector partitions, but may include\n partitions with fewer than n items at the end.\n Returns a stateful transducer when no collection is provided.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/partitionv-all"},{"added":"1.0","ns":"clojure.core","name":"load-string","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1334883949000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"read-string","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f04"}],"line":4115,"examples":null,"notes":null,"arglists":["s"],"doc":"Sequentially read and evaluate the set of forms contained in the\n string","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/load-string"},{"added":"1.0","ns":"clojure.core","name":"special-symbol?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":5021,"examples":[{"author":{"login":"franks42","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b3ee701dd6c481e5d310467ddfe62c48?r=PG&default=identicon"},"editors":[{"login":"franks42","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b3ee701dd6c481e5d310467ddfe62c48?r=PG&default=identicon"}],"body":"user=\u003E (clojure-version)\n\"1.4.0\"\n;; the set of special symbols for this clojure-version are the following:\nuser=\u003E (keys (. clojure.lang.Compiler specials))\n(deftype* new quote & var set! monitor-enter recur . case* clojure.core/import* reify* do fn* throw monitor-exit letfn* finally let* loop* try catch if def)\n\n;; for example, \"def\" is not a function, not a macro, not even a var, but a special form:\nuser=\u003E (fn? 'def)\nfalse\nuser=\u003E (:macro (meta (find-var 'clojure.core/def)))\nnil\nuser=\u003E (find-var 'clojure.core/def)\nnil\nuser=\u003E (special-symbol? 'def)\ntrue\n\n;; while \"defn\" is not a special form but a macro:\nuser=\u003E (special-symbol? 'defn)\nfalse\nuser=\u003E (:macro (meta (find-var 'clojure.core/defn)))\ntrue\n","created-at":1353815386000,"updated-at":1353815535000,"_id":"542692d5c026201cdc327099"}],"notes":null,"arglists":["s"],"doc":"Returns true if s names a special form","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/special-symbol_q"},{"added":"1.0","ns":"clojure.core","name":"ancestors","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1341101490000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"parents","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cd2"},{"created-at":1341101493000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"derive","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cd3"},{"created-at":1341101496000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"underive","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cd4"},{"created-at":1341101502000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"descendants","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cd5"},{"created-at":1341101507000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"make-hierarchy","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cd6"},{"created-at":1341101672000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"isa?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cd7"},{"created-at":1374150921000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"supers","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cd8"}],"line":5651,"examples":[{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"}],"body":";; make up a hierarchy a beagle is a sporting breed is a dog is a quadraped is an \n;; animal\n\nuser=\u003E (derive ::quadruped ::animal)\nnil\nuser=\u003E (derive ::dog ::quadruped)\nnil\nuser=\u003E (derive ::sporting_breed ::dog)\nnil\nuser=\u003E (derive ::beagle ::sporting_breed)\nnil\nuser=\u003E (ancestors ::beagle)\n#{:user/dog :user/sporting_breed :user/animal :user/quadruped}\nuser=\u003E","created-at":1313896987000,"updated-at":1313968195000,"_id":"542692cdc026201cdc326d1b"},{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[],"body":";; use ancestors to show which classes ArrayList derives from and which\n;; interfaces it implements\n\nuser=\u003E (ancestors java.util.ArrayList)\n#{java.util.Collection java.util.AbstractList java.io.Serializable java.lang.Cloneable java.util.List java.lang.Object java.util.AbstractCollection java.util.RandomAccess java.lang.Iterable}\nuser=\u003E","created-at":1313968946000,"updated-at":1313968946000,"_id":"542692cdc026201cdc326d1d"}],"notes":null,"arglists":["tag","h tag"],"doc":"Returns the immediate and indirect parents of tag, either via a Java type\n inheritance relationship or a relationship established via derive. h\n must be a hierarchy obtained from make-hierarchy, if not supplied\n defaults to the global hierarchy","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/ancestors"},{"added":"1.0","ns":"clojure.core","name":"subseq","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1330671591000,"author":{"login":"Chouser","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7a0192050ed6488670acfd3f59405c10?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"rsubseq","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e25"},{"created-at":1330671627000,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"sorted-map","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e26"},{"created-at":1330671638000,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"sorted-set","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e27"},{"created-at":1330671646000,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"sorted-map-by","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e28"},{"created-at":1330671652000,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"sorted-set-by","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e29"}],"line":5162,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; Note, that collection passed to subseq must implement Sorted. \n;; Just passing a collection that has been sorted is not enough.\n\nuser=\u003E (subseq [1 2 3 4] \u003E 2)\njava.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to clojure.lang.Sorted (NO_SOURCE_FILE:0)\n\nuser=\u003E (subseq (sorted-set 1 2 3 4) \u003E 2)\n(3 4)\n","created-at":1281618432000,"updated-at":1285494695000,"_id":"542692cfc026201cdc326e78"}],"notes":null,"arglists":["sc test key","sc start-test start-key end-test end-key"],"doc":"sc must be a sorted collection, test(s) one of \u003C, \u003C=, \u003E or\n \u003E=. Returns a seq of those entries with keys ek for\n which (test (.. sc comparator (compare ek key)) 0) is true","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/subseq"},{"added":"1.2","ns":"clojure.core","name":"error-handler","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":2221,"examples":null,"notes":null,"arglists":["a"],"doc":"Returns the error-handler of agent a, or nil if there is none.\n See set-error-handler!","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/error-handler"},{"added":"1.0","ns":"clojure.core","name":"gensym","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":606,"examples":[{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (gensym \"foo\")\nfoo2020\n\nuser=\u003E (gensym \"foo\")\nfoo2027\n\nuser=\u003E (gensym \"foo\")\n;; ...\n","created-at":1280776789000,"updated-at":1285495689000,"_id":"542692c6c026201cdc32690b"},{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (gensym)\nG__2034\n\nuser=\u003E (let [my-unique-sym (gensym)]\n my-unique-sym)\nG__2075\n","created-at":1280776909000,"updated-at":1285495715000,"_id":"542692c6c026201cdc32690d"},{"author":{"login":"gdavis","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ae253eacd4cab9fb2580b8192351b641?r=PG&default=identicon"},"editors":[],"body":";; syntax-reader uses gensym for non-namespace-qualified symbols ending with '#'\n;; http://clojure.org/reader\n\nuser=\u003E `(name0#) ; gensym, form is useful in defmacro\n(name0__1206__auto__)\n\nuser=\u003E `(user/name1#) ; no gensym, namespace-qualified\n(user/name1#)\n\nuser=\u003E `(:key0#) ; no gensym, keyword\n(:key0#)\n\nuser=\u003E `(::key1#) ; no gensym, keyword\n(:user/key1#)\n","created-at":1394152357000,"updated-at":1394152357000,"_id":"542692d3c026201cdc326fbc"}],"notes":[{"updated-at":1383198787000,"body":"The \u003Cpre\u003E(. clojure.lang.RT (nextID))\u003C/pre\u003E present gensym's source code (https://github.com/clojure/clojure/blob/clojure-1.5.1/src/jvm/clojure/lang/RT.java#L468) uses java.util.concurrent.atomic.AtomicInteger (and has for the past 6 years, if you trust the Git history).","created-at":1383198787000,"author":{"login":"mlb","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/11104d872c2bae6e0e98b7533818530a?r=PG&default=identicon"},"_id":"542692edf6e94c697052200c"}],"arglists":["","prefix-string"],"doc":"Returns a new symbol with a unique name. If a prefix string is\n supplied, the name is prefix# where # is some unique number. If\n prefix is not supplied, the prefix is 'G__'.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/gensym"},{"added":"1.0","ns":"clojure.core","name":"cond","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1289183323000,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.core","name":"condp","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ee8"},{"created-at":1290574959000,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.core","name":"case","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ee9"},{"created-at":1302510857000,"author":{"login":"Havvy","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e799a79441c7543be48562403411cd13?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"if","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521eea"}],"line":576,"examples":[{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},{"login":"bhenry","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4bc423f6653d93f9185a5cdc9f5cd84f?r=PG&default=identicon"},{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"(defn pos-neg-or-zero\n \"Determines whether or not n is positive, negative, or zero\"\n [n]\n (cond\n (\u003C n 0) \"negative\"\n (\u003E n 0) \"positive\"\n :else \"zero\"))\n\nuser=\u003E (pos-neg-or-zero 5)\n\"positive\"\nuser=\u003E (pos-neg-or-zero -1)\n\"negative\"\nuser=\u003E (pos-neg-or-zero 0)\n\"zero\"\n","created-at":1279070736000,"updated-at":1285501471000,"_id":"542692c7c026201cdc326966"},{"author":{"login":"bhenry","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4bc423f6653d93f9185a5cdc9f5cd84f?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"TheJoe","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2789ff7d993fbf621e86768b3cce19d4?r=PG&default=identicon"}],"body":"user=\u003E (let [grade 85]\n (cond\n (\u003E= grade 90) \"A\"\n (\u003E= grade 80) \"B\"\n (\u003E= grade 70) \"C\"\n (\u003E= grade 60) \"D\"\n :else \"F\"))\n\"B\"","created-at":1279071870000,"updated-at":1365525514000,"_id":"542692c7c026201cdc32696c"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[],"body":";; See examples for \"if\" explaining Clojure's idea of logical true\n;; and logical false.","created-at":1334293315000,"updated-at":1334293315000,"_id":"542692d2c026201cdc326f67"},{"author":{"login":"Omer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/dae0f434afde5246ccb030cdec81fb71?r=PG&default=identicon"},"editors":[],"body":";; Generates a random number compares it to user input\n(let [rnd (rand-int 10)\n guess (Integer/parseInt (read-line))]\n (cond\n (= rnd guess) (println \"You got my guess right!\")\n :else (println \"Sorry... guess again!\")))","created-at":1338273335000,"updated-at":1338273335000,"_id":"542692d2c026201cdc326f68"}],"macro":true,"notes":[{"updated-at":1288294778000,"body":"We should add a comment in the docstring for the final usage of :else.","created-at":1288294778000,"author":{"login":"blais","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9142fc3ffa18ebeddbb03fe575199742?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fa0"}],"arglists":["& clauses"],"doc":"Takes a set of test/expr pairs. It evaluates each test one at a\n time. If a test returns logical true, cond evaluates and returns\n the value of the corresponding expr and doesn't evaluate any of the\n other tests or exprs. (cond) returns nil.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/cond"},{"added":"1.0","ns":"clojure.core","name":"ratio?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":3602,"examples":[{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[],"body":"\u003Cpre\u003Euser=> (ratio? 22/7)\r\ntrue\r\nuser=> (ratio? 22)\r\nfalse\u003C/pre\u003E","created-at":1279074828000,"updated-at":1279074828000,"_id":"542692c9c026201cdc326a96"}],"notes":null,"arglists":["n"],"doc":"Returns true if n is a Ratio","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/ratio_q"},{"added":"1.0","ns":"clojure.core","name":"delay?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1325375628000,"author":{"login":"moumar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8fae5b9c9ffd332a24ff71a339fa6310?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"delay","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ca7"}],"line":757,"examples":[{"author":{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"},"editors":[{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"}],"body":"user=\u003E (def v (delay (do (println \"start sleeping\") \n (Thread/sleep 1000) \n 10)))\n#'user/v\nuser=\u003E (delay? v)\ntrue\nuser=\u003E (force v)\nstart sleeping\n10\nuser=\u003E (delay? v)\ntrue\nuser=\u003E (force v)\n10\nuser=\u003E ","created-at":1308628940000,"updated-at":1308629066000,"_id":"542692cec026201cdc326dc1"}],"notes":null,"arglists":["x"],"doc":"returns true if x is a Delay created with delay","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/delay_q"},{"added":"1.0","ns":"clojure.core","name":"intern","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1360641943000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"alter-var-root","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b72"}],"line":6388,"examples":[{"author":{"login":"Miles","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bbb26d2a5e856c4fba0f72c3f7250f3f?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"Miles","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bbb26d2a5e856c4fba0f72c3f7250f3f?r=PG&default=identicon"}],"body":"user=\u003E (intern 'user 'x \"Foobar\")\n#'user/x\n\nuser=\u003E x\n\"Foobar\"\n","created-at":1283820694000,"updated-at":1287791800000,"_id":"542692cac026201cdc326b56"}],"notes":null,"arglists":["ns name","ns name val"],"doc":"Finds or creates a var named by the symbol name in the namespace\n ns (which can be a symbol or a namespace), setting its root binding\n to val if supplied. The namespace must exist. The var will adopt any\n metadata from the name symbol. Returns the var.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/intern"},{"ns":"clojure.core","name":"print-simple","file":"clojure/core_print.clj","type":"function","column":1,"see-alsos":null,"line":83,"examples":null,"notes":null,"arglists":["o w"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core/print-simple"},{"added":"1.2","ns":"clojure.core","name":"flatten","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":7284,"examples":[{"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"editors":[{"login":"pkolloch","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/10b2fd3c0a4cc46dc241a48468dc551?r=PG&default=identicon"},{"login":"tonsky","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4188c62c28a196e3e82363217c56fca5?r=PG&default=identicon"}],"body":"user=\u003E (flatten [1 [2 3]])\n(1 2 3)\n\nuser=\u003E (flatten '(1 2 3))\n(1 2 3)\n\nuser=\u003E (flatten '(1 2 [3 (4 5)])) \n(1 2 3 4 5)\n\nuser=\u003E (flatten nil)\n()\n\n; Attention with stuff which is not a sequence\n\nuser=\u003E (flatten 5)\n()\n\nuser=\u003E (flatten {:name \"Hubert\" :age 23})\n()\n\n; Workaround for maps\n\nuser=\u003E (flatten (seq {:name \"Hubert\" :age 23}))\n(:name \"Hubert\" :age 23)","created-at":1279274687000,"updated-at":1341327489000,"_id":"542692cfc026201cdc326e49"}],"notes":[{"updated-at":1335141716000,"body":"(flatten nil) actually returns an empty sequence, not nil. The doc string is fixed in 1.4.","created-at":1335141716000,"author":{"login":"steveminer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d28543d134185d12d4006a74738d233e?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fde"},{"updated-at":1336946114000,"body":"As shown in the example, flatten will return an empty sequence when given any non-sequential thing. That can sometimes hide a bug. \r\n\r\nHere's another version that doesn't have that problem, and is faster as well.\r\n\r\n\r\n (defn flatten2\r\n \"Like `clojure.core/flatten` but better, stronger, faster.\r\n Takes any nested combination of sequential things (lists, vectors,\r\n etc.) and returns their contents as a single, flat, lazy sequence.\r\n If the argument is non-sequential (numbers, maps, strings, nil, \r\n etc.), returns the original argument.\"\r\n {:static true}\r\n [x]\r\n (letfn [(flat [coll] \r\n (lazy-seq \r\n (when-let [c (seq coll)] \r\n (let [x (first c)] \r\n (if (sequential? x) \r\n (concat (flat x) (flat (rest c))) \r\n (cons x (flat (rest c))))))))]\r\n (if (sequential? x) (flat x) x)))\r\n","created-at":1335142077000,"author":{"login":"steveminer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d28543d134185d12d4006a74738d233e?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fdf"},{"updated-at":1341327474000,"body":"Actually, flatten on a vector returns list, not a collection:\r\n\r\n user=\u003E (flatten [1 [2 3]])\r\n (1 2 3)\r\n","created-at":1341327474000,"author":{"login":"tonsky","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4188c62c28a196e3e82363217c56fca5?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fe4"},{"updated-at":1398620003000,"body":"lazy version is much slower than this one:\r\n\r\n\u003Cpre\u003E(defn my-flatten [l] \r\n \"free of StackOverflow problem, not lazy and much faster version of flatten.\"\r\n(loop [l1 l, l2 `()]\r\n (cond\r\n (sequential? (first l1)) (recur (concat (first l1) (rest l1)) l2)\r\n (empty? l1) (reverse l2)\r\n :else (recur (rest l1) (cons (first l1) l2)))))\r\n\u003C/pre\u003E\r\n\r\nfor complicated construction genereted by:\r\n\u003Cpre\u003E(defn gen-list-wird [c] (reduce (fn [a b] (list a b)) (map vector (range c) (map str (range c (* 2 c))))))\u003C/pre\u003E\r\ntimes are:\r\ncore/flatten (260 msec)\r\nsteveminer/flatten (135 msec)\r\nmy-flatten (2 msec). This version is slower than steveminder`s version for flat and very nested structures with small number of items.","created-at":1398617756000,"author":{"login":"slovic","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b39b58f117a52d4f8ef3f388afb4554a?r=PG&default=identicon"},"_id":"542692edf6e94c6970522025"}],"arglists":["x"],"doc":"Takes any nested combination of sequential things (lists, vectors,\n etc.) and returns their contents as a single, flat lazy sequence.\n (flatten nil) returns an empty sequence.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/flatten"},{"added":"1.0","ns":"clojure.core","name":"doubles","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":5431,"examples":null,"notes":[{"updated-at":1313877730000,"body":"Anybody know what this is used for?\r\nAll I could find is that you can cast an existing double-array to another \r\ndouble-array???\r\n\r\n\u003Cpre\u003Euser=> (doubles [1 2 3 4 5])\r\njava.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to [D (NO_SOURCE_FILE:0)\r\nuser=> (doubles (int-array [2 3 2]))\r\njava.lang.ClassCastException: [I cannot be cast to [D (NO_SOURCE_FILE:0)\r\nuser=> (doubles (float-array [2 3 2]))\r\njava.lang.ClassCastException: [F cannot be cast to [D (NO_SOURCE_FILE:0)\r\nuser=> (doubles (double-array [2 3 2]))\r\n#\u003Cdouble[] [d@3c1fc1a6=\"\"\u003E\r\nuser=> (type (double-array [2 3 2]))\r\n[D\r\nuser=> (type (doubles (double-array [2 3 2])))\r\n[D\r\nuser=>\r\n\u003C/pre\u003E\r\n","created-at":1313877675000,"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fc6"}],"arglists":["xs"],"doc":"Casts to double[]","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/doubles"},{"added":"1.9","ns":"clojure.core","name":"halt-when","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":7823,"examples":null,"notes":null,"arglists":["pred","pred retf"],"doc":"Returns a transducer that ends transduction when pred returns true\n for an input. When retf is supplied it must be a fn of 2 arguments -\n it will be passed the (completed) result so far and the input that\n triggered the predicate, and its return value (if it does not throw\n an exception) will be the return value of the transducer. If retf\n is not supplied, the input that triggered the predicate will be\n returned. If the predicate never returns true the transduction is\n unaffected.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/halt-when"},{"added":"1.0","ns":"clojure.core","name":"with-in-str","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1398723552000,"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"with-out-str","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f33"}],"line":4776,"examples":[{"author":{"login":"tormaroe","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8bc7bb10bee96efb190053fe92ffd250?r=PG&default=identicon"},"editors":[{"login":"tormaroe","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8bc7bb10bee96efb190053fe92ffd250?r=PG&default=identicon"}],"body":";; Given you have a function that will read from *in*\n(defn prompt [question]\n (println question)\n (read-line))\n\nuser=\u003E (prompt \"How old are you?\")\nHow old are you?\n34 ; \u003C== This is what you enter\n\"34\" ; \u003C== This is returned by the function\n\n;; You can now simulate entering your age at the prompt by using with-in-str\n\nuser=\u003E (with-in-str \"34\" (prompt \"How old are you?\"))\nHow old are you?\n\"34\" ; \u003C== The function now returns immediately \n","created-at":1289600189000,"updated-at":1289600648000,"_id":"542692c7c026201cdc3269d8"}],"macro":true,"notes":null,"arglists":["s & body"],"doc":"Evaluates body in a context in which *in* is bound to a fresh\n StringReader initialized with the string s.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/with-in-str"},{"added":"1.0","ns":"clojure.core","name":"remove-watch","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1331136355000,"author":{"login":"pjlegato","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4ce55cfd8b3ae2f63f5ecbc8fc1c05d4?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"add-watch","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c2f"}],"line":2179,"examples":null,"notes":null,"arglists":["reference key"],"doc":"Removes a watch (set by add-watch) from a reference","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/remove-watch"},{"added":"1.4","ns":"clojure.core","name":"ex-info","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":4832,"examples":null,"notes":null,"arglists":["msg map","msg map cause"],"doc":"Create an instance of ExceptionInfo, a RuntimeException subclass\n that carries a map of additional data.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/ex-info"},{"added":"1.0","ns":"clojure.core","name":"ifn?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1321052090000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"fn?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c09"}],"line":6286,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":";; An anonymous function is a function as you'd expect\nuser=\u003E (ifn? #(\"my anonymous function\"))\ntrue\n\n;; Is a vector a function?\nuser=\u003E (ifn? [1 2 3])\ntrue\n\n;; Sure is, lets call it.\nuser=\u003E ([1 2 3] 0)\n1\n\n;; Maps and sets are functions, too.\n\n;; a number is definitely not a function\nuser=\u003E (ifn? 1)\nfalse\n\n;; but a symbol is\nuser=\u003E (ifn? 'foo)\ntrue\n\n;; and so is a keyword\nuser=\u003E (ifn? :foo)\ntrue","created-at":1281077011000,"updated-at":1329991142000,"_id":"542692cdc026201cdc326d38"}],"notes":null,"arglists":["x"],"doc":"Returns true if x implements IFn. Note that many data structures\n (e.g. sets and maps) implement IFn","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/ifn_q"},{"added":"1.5","ns":"clojure.core","name":"some-\u003E","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1412083935441,"author":{"login":"jw-00000","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/2936?v=2"},"to-var":{"ns":"clojure.core","name":"some-\u003E\u003E","library-url":"https://github.com/clojure/clojure"},"_id":"542ab0dfe4b0df9bb778a59b"},{"created-at":1412083945874,"author":{"login":"jw-00000","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/2936?v=2"},"to-var":{"ns":"clojure.core","name":"-\u003E","library-url":"https://github.com/clojure/clojure"},"_id":"542ab0e9e4b0df9bb778a59c"},{"created-at":1412268640070,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"cond-\u003E","library-url":"https://github.com/clojure/clojure"},"_id":"542d8260e4b05f4d257a298e"},{"created-at":1412268648681,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"cond-\u003E\u003E","library-url":"https://github.com/clojure/clojure"},"_id":"542d8268e4b05f4d257a298f"},{"created-at":1412268658944,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"as-\u003E","library-url":"https://github.com/clojure/clojure"},"_id":"542d8272e4b05f4d257a2990"},{"created-at":1412268673788,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"-\u003E\u003E","library-url":"https://github.com/clojure/clojure"},"_id":"542d8281e4b05f4d257a2991"}],"line":7776,"examples":null,"macro":true,"notes":null,"arglists":["expr & forms"],"doc":"When expr is not nil, threads it into the first form (via -\u003E),\n and when that result is not nil, through the next etc","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/some-\u003E"},{"added":"1.9","ns":"clojure.core","name":"nat-int?","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":1434,"examples":null,"notes":null,"arglists":["x"],"doc":"Return true if x is a non-negative fixed precision integer","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/nat-int_q"},{"ns":"clojure.core","name":"proxy-name","file":"clojure/core_proxy.clj","type":"function","column":1,"see-alsos":null,"line":37,"examples":null,"notes":null,"tag":"java.lang.String","arglists":["super interfaces"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core/proxy-name"},{"added":"1.0","ns":"clojure.core","name":"ns-interns","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1288055138000,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.core","name":"ns-map","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ae9"},{"created-at":1298556643000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ns-publics","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521aea"},{"created-at":1348479295000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ns-aliases","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521aeb"},{"created-at":1348479323000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ns-refers","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521aec"}],"line":4233,"examples":[{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (take 2 (ns-interns `clojure.core))\n([sorted-map #'clojure.core/sorted-map] [read-line #'clojure.core/read-line])\n\nuser=\u003E (take 5 (sort (keys (ns-interns `clojure.java.io))))\n(Coercions IOFactory append? as-file as-relative-path)\n\nuser=\u003E (count (ns-interns `clojure.core)) ; only 621 functions to learn :-)\n621\nuser=\u003E","created-at":1313988495000,"updated-at":1313988495000,"_id":"542692c8c026201cdc3269ea"},{"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"editors":[],"body":";; See also http://clojure.org/namespaces for information on namespaces in Clojure and how to inspect and manipulate them","created-at":1348479359000,"updated-at":1348479359000,"_id":"542692d4c026201cdc327018"}],"notes":null,"arglists":["ns"],"doc":"Returns a map of the intern mappings for the namespace.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/ns-interns"},{"added":"1.0","ns":"clojure.core","name":"all-ns","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":4173,"examples":[{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (all-ns)\n(#\u003CNamespace clojure.set\u003E #\u003CNamespace clojure.pprint\u003E #\u003CNamespace cake.contrib.server-socket\u003E #\u003CNamespace user\u003E #\u003CNamespace clojure.main\u003E #\u003CNamespace useful.io\u003E #\u003CNamespace clojure.core\u003E #\u003CNamespace clojure.java.shell\u003E #\u003CNamespace cake.tasks.help\u003E #\u003CNamespace clojure.zip\u003E #\u003CNamespace clojure.java.browse\u003E #\u003CNamespace clojure.repl\u003E #\u003CNamespace cake.tasks.new\u003E #\u003CNamespace cake.server\u003E #\u003CNamespace cake.ant\u003E #\u003CNamespace cake.contrib.find-namespaces\u003E #\u003CNamespace clojure.java.io\u003E #\u003CNamespace clojure.stacktrace\u003E #\u003CNamespace clojure.core.protocols\u003E #\u003CNamespace cake.project\u003E #\u003CNamespace clojure.xml\u003E #\u003CNamespace clojure.java.javadoc\u003E #\u003CNamespace useful\u003E #\u003CNamespace complete\u003E #\u003CNamespace cake\u003E)","created-at":1281460579000,"updated-at":1332953063000,"_id":"542692c7c026201cdc326990"}],"notes":null,"arglists":[""],"doc":"Returns a sequence of all namespaces.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/all-ns"},{"ns":"clojure.core","name":"find-protocol-method","file":"clojure/core_deftype.clj","type":"function","column":1,"see-alsos":null,"line":548,"examples":null,"notes":null,"arglists":["protocol methodk x"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core/find-protocol-method"},{"added":"1.0","ns":"clojure.core","name":"subvec","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1291975197000,"author":{"login":"alimoeeny","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e8dd06976ead4082d2181f3807117e1?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"vector","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dee"},{"created-at":1291975205000,"author":{"login":"alimoeeny","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e8dd06976ead4082d2181f3807117e1?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"vector?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521def"}],"line":3844,"examples":[{"author":{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"rafmagana","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/40bd727b22d74930f292b63d45a71b07?r=PG&default=identicon"},{"login":"rafmagana","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/40bd727b22d74930f292b63d45a71b07?r=PG&default=identicon"},{"login":"rafmagana","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/40bd727b22d74930f292b63d45a71b07?r=PG&default=identicon"}],"body":";; not supplying 'end' returns vector from 'start' to (count vector)\nuser=\u003E (subvec [12 3 4 5 6 7] 2)\n[4 5 6 7]\n\n;; supplying 'end' returns vector from 'start' to element (- end 1)\nuser=\u003E (subvec [12 3 4 5 6 7] 2 4)\n[4 5]\n\n\n\n\n","created-at":1281558954000,"updated-at":1340286231000,"_id":"542692cec026201cdc326d62"}],"notes":null,"arglists":["v start","v start end"],"doc":"Returns a persistent vector of the items in vector from\n start (inclusive) to end (exclusive). If end is not supplied,\n defaults to (count vector). This operation is O(1) and very fast, as\n the resulting vector shares structure with the original and no\n trimming is done.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/subvec"},{"added":"1.0","ns":"clojure.core","name":"for","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1318594692000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"doseq","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c7f"},{"created-at":1338714786000,"author":{"login":"Dmitry Kakurin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/85b70be5da433a6adf5112e7140848da?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"doall","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c80"},{"created-at":1360362825000,"author":{"login":"ViljamiPeltola","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1535c08820796d57a212a46a6bdd4cca?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"recur","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c81"}],"line":4673,"examples":[{"author":{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (for [x [0 1 2 3 4 5]\n :let [y (* x 3)]\n :when (even? y)]\n y)\n(0 6 12)\n","created-at":1279388402000,"updated-at":1285488338000,"_id":"542692c7c026201cdc326952"},{"author":{"login":"Jacolyte","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1703a0c3ed358b787f4b1bf3b2799472?r=PG&default=identicon"},"editors":[{"login":"Jacolyte","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1703a0c3ed358b787f4b1bf3b2799472?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (def digits (seq [1 2 3]))\nuser=\u003E (for [x1 digits x2 digits] (* x1 x2))\n(1 2 3 2 4 6 3 6 9)","created-at":1279947290000,"updated-at":1332950111000,"_id":"542692c7c026201cdc326954"},{"author":{"login":"james","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4b163432c99a124feee4be046a3f9d66?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (for [x ['a 'b 'c] \n y [1 2 3]] \n [x y])\n\n([a 1] [a 2] [a 3] [b 1] [b 2] [b 3] [c 1] [c 2] [c 3])","created-at":1283713265000,"updated-at":1332950129000,"_id":"542692c7c026201cdc326957"},{"author":{"login":"james","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4b163432c99a124feee4be046a3f9d66?r=PG&default=identicon"},"editors":[{"login":"james","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4b163432c99a124feee4be046a3f9d66?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (for [x (range 1 6) \n :let [y (* x x) \n z (* x x x)]] \n [x y z])\n\n([1 1 1] [2 4 8] [3 9 27] [4 16 64] [5 25 125])\n","created-at":1283713566000,"updated-at":1285497405000,"_id":"542692c7c026201cdc326959"},{"author":{"login":"alimoeeny","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e8dd06976ead4082d2181f3807117e1?r=PG&default=identicon"},"editors":[{"login":"pashields","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/6ff7e838d2c47adf942be6df4d22b452?r=PG&default=identicon"}],"body":"(for [x (range 3 7)] \n (* x x))\n\n(9 16 25 36)","created-at":1292101988000,"updated-at":1295069356000,"_id":"542692c7c026201cdc32695d"},{"author":{"login":"huahaiy","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/889685?v=2"},"editors":[],"body":"user=\u003E (for [[x y] '([:a 1] [:b 2] [:c 0]) :when (= y 0)] x)\n(:c)\n","created-at":1305076075000,"updated-at":1305076075000,"_id":"542692c7c026201cdc32695f"},{"author":{"login":"Dmitry Kakurin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/85b70be5da433a6adf5112e7140848da?r=PG&default=identicon"},"editors":[],"body":"; Demonstrating difference between :when and :while\n\nuser=\u003E (time (dorun (for [x (range 1000) y (range 10000) :when (\u003E x y)] [x y])))\n\"Elapsed time: 2898.908 msecs\"\nnil\n\nuser=\u003E (time (dorun (for [x (range 1000) y (range 10000) :while (\u003E x y)] [x y])))\n\"Elapsed time: 293.677 msecs\"\nnil","created-at":1338313241000,"updated-at":1338313241000,"_id":"542692d3c026201cdc326fa6"},{"author":{"login":"bzhou","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5ea589e907c3d7da52e3c76924fbe3f7?r=PG&default=identicon"},"editors":[],"body":"; Demonstrating difference between :when and :while\nuser=\u003E (for [x (range 3) y (range 3) :when (not= x y)] [x y])\n([0 1] [0 2] [1 0] [1 2] [2 0] [2 1])\nuser=\u003E (for [x (range 3) y (range 3) :while (not= x y)] [x y])\n([1 0] [2 0] [2 1])","created-at":1340260912000,"updated-at":1340260912000,"_id":"542692d3c026201cdc326fa7"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[],"body":";; More examples illustrating the difference between :when and :while\n\n;; Simple but inefficient method of checking whether a number is\n;; prime.\nuser=\u003E (defn prime? [n]\n (not-any? zero? (map #(rem n %) (range 2 n))))\n#'user/prime?\n\nuser=\u003E (range 3 33 2)\n(3 5 7 9 11 13 15 17 19 21 23 25 27 29 31)\n\n;; :when continues through the collection even if some have the\n;; condition evaluate to false, like filter\nuser=\u003E (for [x (range 3 33 2) :when (prime? x)]\n x)\n(3 5 7 11 13 17 19 23 29 31)\n\n;; :while stops at the first collection element that evaluates to\n;; false, like take-while\nuser=\u003E (for [x (range 3 33 2) :while (prime? x)]\n x)\n(3 5 7)\n\n;; The examples above can easily be rewritten with filter or\n;; take-while. When you have a for with multiple binding forms, so\n;; that the iteration occurs in a nested fashion, it becomes possible\n;; to write something briefly with 'for' that would be more verbose or\n;; unwieldy with nested filter or take-while expressions.\n\nuser=\u003E (for [x (range 3 17 2) :when (prime? x)\n y (range 3 17 2) :when (prime? y)]\n [x y])\n([ 3 3] [ 3 5] [ 3 7] [ 3 11] [ 3 13]\n [ 5 3] [ 5 5] [ 5 7] [ 5 11] [ 5 13]\n [ 7 3] [ 7 5] [ 7 7] [ 7 11] [ 7 13]\n [11 3] [11 5] [11 7] [11 11] [11 13]\n [13 3] [13 5] [13 7] [13 11] [13 13])\n\nuser=\u003E (for [x (range 3 17 2) :while (prime? x)\n y (range 3 17 2) :while (prime? y)]\n [x y])\n([3 3] [3 5] [3 7]\n [5 3] [5 5] [5 7]\n [7 3] [7 5] [7 7])\n\n;; This example only gives a finite result because of the :while\n;; expressions.\nuser=\u003E (for [x (range) :while (\u003C x 10) \n y (range) :while (\u003C= y x)]\n [x y])\n\n([0 0]\n [1 0] [1 1]\n [2 0] [2 1] [2 2]\n [3 0] [3 1] [3 2] [3 3]\n [4 0] [4 1] [4 2] [4 3] [4 4]\n [5 0] [5 1] [5 2] [5 3] [5 4] [5 5]\n [6 0] [6 1] [6 2] [6 3] [6 4] [6 5] [6 6]\n [7 0] [7 1] [7 2] [7 3] [7 4] [7 5] [7 6] [7 7]\n [8 0] [8 1] [8 2] [8 3] [8 4] [8 5] [8 6] [8 7] [8 8]\n [9 0] [9 1] [9 2] [9 3] [9 4] [9 5] [9 6] [9 7] [9 8] [9 9])\n","created-at":1345760672000,"updated-at":1345760672000,"_id":"542692d3c026201cdc326fa8"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[],"body":";; Here are a couple of examples where the only difference is where\n;; the :while is placed, but it makes a significant difference in the\n;; behavior.\n\n;; When x=2 y=1 is reached, :while (\u003C= x y) evaluates false, so all\n;; further items in the y collection are skipped. When x=3 y=1 is\n;; reached, the same thing happens.\n\nuser=\u003E (for [x [1 2 3]\n y [1 2 3]\n :while (\u003C= x y)\n z [1 2 3]]\n [x y z])\n([1 1 1] [1 1 2] [1 1 3]\n [1 2 1] [1 2 2] [1 2 3]\n [1 3 1] [1 3 2] [1 3 3])\n\n;; This is different. When x=2 y=1 z=1 is reached, :while (\u003C= x y)\n;; evaluates false, but since the :while is after the binding for z,\n;; all further items in the z collection are skipped. Then x=2 y=2\n;; z=1 is tried, where the while expresssion evaluates true.\n\nuser=\u003E (for [x [1 2 3]\n y [1 2 3]\n z [1 2 3]\n :while (\u003C= x y)]\n [x y z])\n([1 1 1] [1 1 2] [1 1 3]\n [1 2 1] [1 2 2] [1 2 3]\n [1 3 1] [1 3 2] [1 3 3]\n [2 2 1] [2 2 2] [2 2 3]\n [2 3 1] [2 3 2] [2 3 3]\n [3 3 1] [3 3 2] [3 3 3])\n","created-at":1345760698000,"updated-at":1345760698000,"_id":"542692d3c026201cdc326fa9"},{"author":{"login":"octopusgrabbus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fd31b8bcea99fa7b0711fbc424587774?r=PG&default=identicon"},"editors":[],"body":"(defn all-files-present?\n\"Takes a list of real file names, and returns a map of files present 1\nand not present 0.\"\n[file-seq]\n(for [fnam file-seq\n :let [stat-map {(keyword fnam) (look-for fnam \"f\")}]]\n stat-map))\n\n(into {} (all-files-present? '(\"Makefile\" \"build.sh\" \"real-estate.csv\")))\n\n{:Makefile 1, :build.sh 1, :real-estate.csv 0}","created-at":1356651292000,"updated-at":1356651292000,"_id":"542692d3c026201cdc326faa"}],"macro":true,"notes":[{"updated-at":1279948874000,"body":"My English parser was choking on the description of this function.\r\n\r\n[This SO question](http://stackoverflow.com/questions/3322552/how-do-i-multiply-all-elements-in-one-collection-with-all-the-elements-in-another) has helped clarify how this function works.","created-at":1279948874000,"author":{"login":"Jacolyte","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1703a0c3ed358b787f4b1bf3b2799472?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521f87"},{"updated-at":1279949964000,"body":"Example 1 can be rewritten without using the for macro. Pure functional should be preferred if possible:\r\n\u003Cpre\u003E\r\n(filter even? (map (partial * 3) [0 1 2 3 4 5]))\r\n\u003C/pre\u003E","created-at":1279949964000,"author":{"login":"juergenhoetzel","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2736dfffc803c704dcf25b45ff63cede?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521f88"},{"updated-at":1313975247000,"body":"On juergenhoetzel's comment:\r\n\r\nAll the examples could be re-written in some combination of map and filter, but they are still valid examples of using the for comprehension, AFAIK:\r\n\r\nExamples:\r\n\u003Cpre\u003Euser=> (mapcat (fn [e] (map (fn [x] (* x e)) [1 2 3])) [1 2 3])\r\n(1 2 3 2 4 6 3 6 9)\r\nuser=> (mapcat (fn [e] (map (fn [x] [e x]) [1 2 3])) ['a 'b 'c])\r\n([a 1] [a 2] [a 3] [b 1] [b 2] [b 3] [c 1] [c 2] [c 3])\r\nuser=> (map (fn [e] [e (* e e)(* e e e)]) (range 1 6))\r\n([1 1 1] [2 4 8] [3 9 27] [4 16 64] [5 25 125])\r\nuser=> (map (fn [e] (* e e)) (range 3 7))\r\n(9 16 25 36)\r\nuser=> (map first (filter (fn [[x y]] (= y 0)) '([:a 1] [:b 2] [:c 0])))\r\n(:c)\r\nuser=>\r\n\u003C/pre\u003E\r\n\r\n","created-at":1313973784000,"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fc7"},{"updated-at":1356553692000,"body":"Take careful note of the description's wording:\r\n\r\n binding-form/collection-expr pairs, \r\n each followed by zero or more modifiers\r\n\r\nA consequence is that the binding list may *not* begin with a modifier, i.e a `:let`, `:when` or `:while`!\r\n\r\nThe following example is **illegal** syntax:\r\n\r\n (for [:let [a 1] b (range 5)] \r\n {a b})\r\n\r\nWhile it might sometimes be convenient to start a `for` with a `:let` to reduce code clutter, the \"correct\" procedure is to nest the `for` in a \"proper\" `let`, like this:\r\n\r\n (let [a 1]\r\n (for [b (range 5)] \r\n {a b}))\r\n\r\nSimilarly, a `:when` is better represented by nesting in an `if`.\r\n\r\n","created-at":1356553540000,"author":{"login":"csmotricz","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/6c620615dfb537dbd5325380bd2eaa07?r=PG&default=identicon"},"_id":"542692edf6e94c6970521ffa"},{"updated-at":1375377539000,"body":"The fifth example should probably be shown in first position, it's the most straightforward and readable for a beginner : \r\n\r\n(for [x (range 3 7)] (* x x))","created-at":1375377539000,"author":{"login":"Joan Charmant","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/75a5fdba1a164425d43d3b9c4b830287?r=PG&default=identicon"},"_id":"542692edf6e94c6970522009"},{"updated-at":1395006875000,"body":"\"**Sequence** comprehension\", not \"list comprehension\". ","created-at":1395006875000,"author":{"login":"Thumbnail","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/db68e51797a2382e185b42ce6534b7a4?r=PG&default=identicon"},"_id":"542692edf6e94c6970522021"}],"arglists":["seq-exprs body-expr"],"doc":"List comprehension. Takes a vector of one or more\n binding-form/collection-expr pairs, each followed by zero or more\n modifiers, and yields a lazy sequence of evaluations of expr.\n Collections are iterated in a nested fashion, rightmost fastest,\n and nested coll-exprs can refer to bindings created in prior\n binding-forms. Supported modifiers are: :let [binding-form expr ...],\n :while test, :when test.\n\n (take 100 (for [x (range 100000000) y (range 1000000) :while (\u003C y x)] [x y]))","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/for"},{"added":"1.0","ns":"clojure.core","name":"binding","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1322088130000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"with-redefs","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e9a"},{"created-at":1374313487000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"with-bindings","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e9b"},{"created-at":1374512208000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"with-local-vars","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e9c"}],"line":1964,"examples":[{"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"editors":[{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; Here are the definitions.\n(defn mymax [x y]\n (min x y))\n\n(defn find-max [x y]\n (max x y))\n\nuser=\u003E (let [max mymax]\n (find-max 10 20))\n\n20 ;let is ineffective outside current lexical scope\n\n\nuser=\u003E (binding [max mymax]\n (find-max 10 20))\n\n10 ;because max is now acting as min","created-at":1281546900000,"updated-at":1287628874000,"_id":"542692cfc026201cdc326e66"},{"author":{"login":"onlyafly","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cab456ee2c30d86ce89400390ad812c6?r=PG&default=identicon"},"editors":[],"body":";; As of Clojure 1.3, vars need to be explicitly marked as ^:dynamic in order for\n;; them to be dynamically rebindable:\n\nuser=\u003E (def ^:dynamic x 1)\nuser=\u003E (def ^:dynamic y 1)\nuser=\u003E (+ x y)\n2\n\n;; Within the scope of the binding, x = 2 and y = 3\n\nuser=\u003E (binding [x 2 y 3]\n (+ x y))\n5\n\n;; But once you leave the binding's scope, x and y maintain their original\n;; bindings:\n\nuser=\u003E (+ x y)\n2","created-at":1321652674000,"updated-at":1321652674000,"_id":"542692d2c026201cdc326f54"},{"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"editors":[{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"}],"body":";;Use t like a \"template\"\n\n(declare ^:dynamic t)\n\n(defn addt [] \n (+ t 10))\n\n(binding [t 1]\n (addt))\n=\u003E 11","created-at":1326330032000,"updated-at":1326330097000,"_id":"542692d2c026201cdc326f55"}],"macro":true,"notes":[{"updated-at":1409723156000,"body":"The first example (binding mymax to max) appears to be broken. The last line generates the error:\r\n\u003Cpre\u003E\r\n IllegalStateException Can't dynamically bind non-dynamic var: clojure.core/max\r\n\u003C/pre\u003E\r\n\r\nI tried inserting (.setDynamic #'max) at the top, and it got rid of the error, but the binding didn't seem to actually happen. I.e. the last line prints 20.\r\n\r\n\u003Cbr\u003EThe only way I could get it to work is by redefining max from scratch as dynamic:\r\n\r\n\u003Cpre\u003E\r\n(defn ^:dynamic max\r\n ([x] x)\r\n ([x y] (. clojure.lang.Numbers (max x y)))\r\n ([x y & more]\r\n (reduce max (max x y) more)))\r\n\u003C/pre\u003E\r\n\r\nAfter THIS the first example succeeds.\r\n\r\n\u003Cbr\u003EThe moral of the story - I guess you can't easily bind built-in functions. You need to write your functions with the intention of them being bindable. And I guess the first example should simply be removed?","created-at":1409723015000,"author":{"login":"fordsfords","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ab6989cb3f3a81269d91a003d45dab25?r=PG&default=identicon"},"_id":"542692edf6e94c697052202f"}],"arglists":["bindings & body"],"doc":"binding =\u003E var-symbol init-expr\n\n Creates new bindings for the (already-existing) vars, with the\n supplied initial values, executes the exprs in an implicit do, then\n re-establishes the bindings that existed before. The new bindings\n are made in parallel (unlike let); all init-exprs are evaluated\n before the vars are bound to their new values.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/binding"},{"added":"1.0","ns":"clojure.core","name":"partial","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1358904778000,"author":{"login":"Ljos","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/45b996a79abca465acaf6c0f10b0437?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"comp","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ccb"},{"created-at":1358904783000,"author":{"login":"Ljos","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/45b996a79abca465acaf6c0f10b0437?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"juxt","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ccc"}],"line":2631,"examples":[{"author":{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},"editors":[{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (def to-english (partial clojure.pprint/cl-format nil \"~@(~@[~R~]~^ ~A.~)\"))\n#'user/to-english\n\nuser=\u003E (to-english 1234567890)\n\"One billion, two hundred thirty-four million, five hundred sixty-seven thousand, eight hundred ninety\"\n","created-at":1279053300000,"updated-at":1285501907000,"_id":"542692cdc026201cdc326ceb"},{"author":{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},"editors":[{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"}],"body":"user=\u003E (def hundred-times (partial * 100))\n#'user/hundred-times\n\nuser=\u003E (hundred-times 5)\n500\n\nuser=\u003E (hundred-times 4 5 6)\n12000\n\nuser=\u003E (def add-hundred (partial + 100))\n#'user/add-hundred\n\nuser=\u003E (add-hundred 5)\n105\n","created-at":1279053544000,"updated-at":1310120171000,"_id":"542692cdc026201cdc326cee"},{"author":{"login":"philos99","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1de5617efb013ca7c9cf8e5646818ffa?r=PG&default=identicon"},"editors":[{"login":"philos99","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1de5617efb013ca7c9cf8e5646818ffa?r=PG&default=identicon"},{"login":"philos99","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1de5617efb013ca7c9cf8e5646818ffa?r=PG&default=identicon"}],"body":"(def subtract-from-hundred (partial - 100))\n\nuser=\u003E (subtract-from-hundred 10) ; same as (- 100 10)\n90\n\nuser=\u003E (subtract-from-hundred 10 20) ; same as (- 100 10 20)\n70","created-at":1317743830000,"updated-at":1318431084000,"_id":"542692d4c026201cdc327023"},{"author":{"login":"mihirmp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a8fd3b9768ad2d1fe09405348276705c?r=PG&default=identicon"},"editors":[],"body":"; Maps exponent to coefficient\n; x^3 + 2x + 1\n(def poly (fn [n]\n\t\t\t(cond\n\t\t\t\t(= 0 n) 1\n\t\t\t\t(= 1 n) 2\n\t\t\t\t(= 3 n) 1\n\t\t\t\t:else 0)\n\t\t\t)\n)\n\n; Differentiates input by returning a polynomial that is curried\n; 3x^2 + 2\n(defn diff [p]\n\t\t(partial (fn [p n] (* (+ 1 n) (p (+ 1 n)))) p)\n\t)\n\n(poly 3)\n;=\u003E 1\n((diff poly) 3)\n;=\u003E 0\n((diff poly) 2)\n;=\u003E 3\n","created-at":1339255851000,"updated-at":1339255851000,"_id":"542692d4c026201cdc327026"}],"notes":[{"updated-at":1385283247000,"body":"This function implements the concept of “[currying](http://en.wikipedia.org/wiki/Currying)�.","created-at":1385283247000,"author":{"login":"roryokane","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5b2b185c814bb25f2f95a1152e58f033?r=PG&default=identicon"},"_id":"542692edf6e94c697052200e"}],"arglists":["f","f arg1","f arg1 arg2","f arg1 arg2 arg3","f arg1 arg2 arg3 & more"],"doc":"Takes a function f and fewer than the normal arguments to f, and\n returns a fn that takes a variable number of additional args. When\n called, the returned function calls f with args + additional args.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/partial"},{"ns":"clojure.core","name":"chunked-seq?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":717,"examples":[{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (chunked-seq? (range 1000))\nfalse\n\nuser=\u003E (chunked-seq? (seq (range 1000)))\ntrue\n\nuser=\u003E (chunked-seq? (iterate inc 10))\nfalse\n\nuser=\u003E (chunked-seq? (seq (iterate inc 10)))\nfalse","created-at":1335431382000,"updated-at":1335431382000,"_id":"542692d2c026201cdc326f60"}],"notes":null,"arglists":["s"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core/chunked-seq_q"},{"added":"1.3","ns":"clojure.core","name":"find-keyword","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":627,"examples":null,"notes":null,"tag":"clojure.lang.Keyword","arglists":["name","ns name"],"doc":"Returns a Keyword with the given namespace and name if one already\n exists. This function will not intern a new keyword. If the keyword\n has not already been interned, it will return nil. Do not use :\n in the keyword strings, it will be added automatically.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/find-keyword"},{"added":"1.0","ns":"clojure.core","name":"replicate","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1385848235000,"author":{"login":"Alexey Tarasevich","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/43e0398b89022d32b43de4c968069312?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"repeat","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d08"}],"line":3029,"examples":[{"author":{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (apply str (replicate 7 \\space))\n ; 7 spaces\n\nuser=\u003E (replicate 7 (rand-int 10))\n(3 3 3 3 3 3 3) ; the same number","created-at":1281549294000,"updated-at":1332950215000,"_id":"542692c9c026201cdc326a82"}],"deprecated":"1.3","notes":[{"updated-at":1281553461000,"body":"Note that `replicate` is obsolete. It's functionality is now available via the two-arg arity form of [`repeat`](http://clojuredocs.org/v/1578).","created-at":1281553461000,"author":{"login":"kotarak","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5db30f607f0b5fa70d690311aa3bfd3b?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521f94"}],"arglists":["n x"],"doc":"DEPRECATED: Use 'repeat' instead.\n Returns a lazy seq of n xs.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/replicate"},{"added":"1.0","ns":"clojure.core","name":"min-key","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1371841141000,"author":{"login":"adereth","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5ad11b4e208a6cdb3bd45fe01dea59b7?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"min","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521df4"},{"created-at":1371841145000,"author":{"login":"adereth","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5ad11b4e208a6cdb3bd45fe01dea59b7?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"max-key","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521df5"}],"line":5062,"examples":[{"author":{"login":"lozh","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/583358786e336bb14a400ca17722ec3b?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; we have a list of key colours\n;; We want to find the one closest to a supplied colour\n;; We're storing rgb values as [r g b]\n;; use min-key to find colour that minimizes \n;; the euclidean distance between the supplied colour \n;; and each key colour\n;; thanks to rhudson, raek and mfex on #clojure\n\n(defn distance-squared [c1 c2]\n \"Euclidean distance between two collections considered as coordinates\"\n (-\u003E\u003E (map - c1 c2) (map #(* % %)) (reduce +)))\n\n(def key-colours\n {[224 41 224] :purple\n [24 180 46] :green\n [12 129 245] :blue\n [254 232 23] :yellow\n [233 233 233] :white\n [245 27 55] :red\n [231 119 41] :orange\n })\n\n(defn rgb-to-key-colour\n \"Find colour in colour map closest to the supplied [r g b] triple\"\n [rgb-triple colour-map]\n (colour-map\n (apply min-key (partial distance-squared rgb-triple) (keys colour-map))))\n\nuser=\u003E (rgb-to-key-colour [255 0 0] key-colours)\n:red\n","created-at":1280009320000,"updated-at":1285497071000,"_id":"542692ccc026201cdc326ca7"},{"author":{"login":"jamesqiu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bc1268deaa7f2e78fe2b5ea76e6481d8?r=PG&default=identicon"},"editors":[{"login":"jamesqiu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bc1268deaa7f2e78fe2b5ea76e6481d8?r=PG&default=identicon"}],"body":"; \"min-key\"/\"max-key\" to \"min\"/\"max\" like \"sort-by\" to \"sort\"\n(min-key #(Math/abs %) -3 1 4)\n; 1\n\n(apply min-key #(Math/abs %) [-3 1 4])\n; 1\n","created-at":1311522786000,"updated-at":1328006403000,"_id":"542692ccc026201cdc326ca9"}],"notes":null,"arglists":["k x","k x y","k x y & more"],"doc":"Returns the x for which (k x), a number, is least.\n\n If there are multiple such xs, the last one is returned.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/min-key"},{"added":"1.5","ns":"clojure.core","name":"reduced","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":2853,"examples":[{"body":";; Suppose you want to short-circuit a sum like:\n(reduce (fn [a v] (+ a v)) (range 10))\n;;=\u003E 45\n\n;; So that it either returns the sum of the integers if less than 100:\n(reduce (fn [a v] (if (\u003C a 100) (+ a v) (reduced :big))) (range 10))\n;;=\u003E 45\n\n;; But the keyword :big otherwise:\n(reduce (fn [a v] (if (\u003C a 100) (+ a v) (reduced :big))) (range 20))\n;;=\u003E :big\n\n;; The value returned by (reduced :big) short-circuits the reduction so that \n;; it returns the wrapped value without ranging over the entire sequence.\n;; This is useful for infinite lazy sequences:\n(reduce (fn [a v] (if (\u003C a 100) (+ a v) (reduced :big))) (range))\n;;=\u003E:big\n\n;; Which would otherwise not terminate.","author":{"login":"silasdavis","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/99715?v=2"},"created-at":1412246795536,"updated-at":1412246795536,"_id":"542d2d0be4b05f4d257a2985"}],"notes":null,"arglists":["x"],"doc":"Wraps x in a way such that a reduce will terminate with the value x","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/reduced"},{"added":"1.0","ns":"clojure.core","name":"char-escape-string","file":"clojure/core_print.clj","type":"var","column":1,"see-alsos":[{"created-at":1375209851000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"char-name-string","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cd9"}],"line":200,"examples":[{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[],"body":";; simple examples\n\nuser=\u003E (char-escape-string \\newline)\n\"\\\\n\"\nuser=\u003E (char-escape-string \\c) ; no escape sequence for 'c'\nnil\nuser=\u003E (char-escape-string \\tab)\n\"\\\\t\"\nuser=\u003E (char-escape-string \\backspace)\n\"\\\\b\"\nuser=\u003E","created-at":1313928437000,"updated-at":1313928437000,"_id":"542692c7c026201cdc3269b6"}],"notes":null,"tag":"java.lang.String","arglists":[],"doc":"Returns escape string for char or nil if none","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/char-escape-string"},{"added":"1.0","ns":"clojure.core","name":"re-matches","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1324028223000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"re-find","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d06"},{"created-at":1379040151000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"subs","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d07"}],"line":4939,"examples":[{"author":{"login":"ysph","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/eed512f3595f1baa31fd91f3b297ebbf?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":";; The distinction is that re-find tries to find _any part_ of the string\n;; that matches the pattern, but re-matches only matches if the _entire_\n;; string matches the pattern.\nuser=\u003E (re-matches #\"hello\" \"hello, world\")\nnil\n\nuser=\u003E (re-matches #\"hello.*\" \"hello, world\")\n\"hello, world\"\n\nuser=\u003E (re-matches #\"hello, (.*)\" \"hello, world\")\n[\"hello, world\" \"world\"]\n","created-at":1294394717000,"updated-at":1324028606000,"_id":"542692c8c026201cdc3269eb"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[],"body":";; Note: See clojure.core/subs for discussion of behavior of substrings\n;; holding onto references of the original strings, which can\n;; significantly affect your memory usage in some cases.","created-at":1379040148000,"updated-at":1379040148000,"_id":"542692d4c026201cdc32704f"},{"author":{"login":"cloojure","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1ad3de25d00d953de6e8c82f554cdbf5?r=PG&default=identicon"},"editors":[{"login":"cloojure","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1ad3de25d00d953de6e8c82f554cdbf5?r=PG&default=identicon"},{"login":"cloojure","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1ad3de25d00d953de6e8c82f554cdbf5?r=PG&default=identicon"},{"login":"cloojure","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1ad3de25d00d953de6e8c82f554cdbf5?r=PG&default=identicon"}],"body":"; Regex match flags can be embedded in the regex string. So, we can convert the normal case-sensitive matching into case-insensitive matching.\n\nuser=\u003E (re-matches #\"hello\" \"HELLO\") ; case-sensitive\nnil\n\nuser=\u003E (re-matches #\"(?i)hello\" \"hello\") ; case-insensitive\n\"hello\"\nuser=\u003E (re-matches #\"(?i)hello\" \"HELLO\") ; case-insensitive\n\"HELLO\"\nuser=\u003E (re-matches #\"(?i)HELLO\" \"heLLo\") ; case-insensitive\n\"heLLo\"\n","created-at":1399524098000,"updated-at":1399524286000,"_id":"542692d4c026201cdc327050"}],"notes":null,"arglists":["re s"],"doc":"Returns the match, if any, of string to pattern, using\n java.util.regex.Matcher.matches(). Uses re-groups to return the\n groups.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/re-matches"},{"added":"1.0","ns":"clojure.core","name":"array-map","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1283650361000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"assoc","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c4c"},{"created-at":1397668962000,"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"hash-map","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c4d"},{"created-at":1397668975000,"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"sorted-map","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c4e"}],"line":4405,"examples":[{"author":{"login":"Jacolyte","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1703a0c3ed358b787f4b1bf3b2799472?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (array-map [1 2] [3 4 5])\n{[1 2] [3 4 5]}","created-at":1280205415000,"updated-at":1332949878000,"_id":"542692cec026201cdc326d8c"},{"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"editors":[{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (array-map :a 10)\n{:a 10}\n\nuser=\u003E (array-map :a 10 :b 20)\n{:a 10 :b 20}\n\nuser=\u003E (apply array-map [:a 10 :b 20 :c 30])\n{:a 10 :b 20 :c 30}\n\nuser=\u003E (apply assoc {} [:a 10 :b 20 :c 30]) ;same result using assoc\n{:a 10 :b 20 :c 30}\n","created-at":1283649638000,"updated-at":1285492106000,"_id":"542692cec026201cdc326d8e"},{"author":{"login":"steveminer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d28543d134185d12d4006a74738d233e?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (keys (assoc (array-map :foo 10 :bar 20) :baz 30))\n(:baz :foo :bar)\n; baz is first; :foo and :bar follow the order given to array-map","created-at":1303524077000,"updated-at":1303524077000,"_id":"542692cec026201cdc326d93"}],"notes":[{"updated-at":1280205606000,"body":"The definition is kind of short, IMO. More descriptively, `array-map` creates a mapping with arrays being the keys and the values. It doesn't seem like `array-map` cares whether or not the keys/values are arrays, although it doesn't seem to like sequences.","created-at":1280205606000,"author":{"login":"Jacolyte","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1703a0c3ed358b787f4b1bf3b2799472?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521f8d"},{"updated-at":1303523878000,"body":"An \u003Ccode\u003Earray-map\u003C/code\u003E maintains the insertion order of the keys. Look up is linear, which is not a problem for small maps (say less than 10 keys). If your map is large, you should use \u003Ccode\u003Ehash-map\u003C/code\u003E instead. \r\n\r\nWhen you \u003Ccode\u003Eassoc\u003C/code\u003E onto an existing array-map, the result is a new array-map with the new key as the first key. The rest of the keys are in the same order as the original. Functions such as \u003Ccode\u003Eseq\u003C/code\u003E and \u003Ccode\u003Ekeys\u003C/code\u003E will respect the key order. \r\n\r\nNote that \u003Ccode\u003Eassoc\u003C/code\u003E will decide to return a hash-map if the result is too big to be efficient.\u003C/p\u003E\r\n","created-at":1303523878000,"author":{"login":"steveminer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d28543d134185d12d4006a74738d233e?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fba"}],"arglists":["","& keyvals"],"doc":"Constructs an array-map. If any keys are equal, they are handled as\n if by repeated uses of assoc.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/array-map"},{"added":"1.3","ns":"clojure.core","name":"unchecked-byte","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":3542,"examples":null,"notes":null,"arglists":["x"],"doc":"Coerce to byte. Subject to rounding or truncation.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/unchecked-byte"},{"added":"1.0","ns":"clojure.core","name":"with-local-vars","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1374310504000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"with-bindings","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cea"}],"line":4366,"examples":[{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[],"body":";; with-local-vars allows you to write more imperative-style code, for cases\n;; where you really want to. factorial isn't a case where it helps, but\n;; it is short and familiar. Note that (var-get acc) can be abbreviated\n;; as @acc\nuser=\u003E (defn factorial [x]\n (with-local-vars [acc 1, cnt x]\n (while (\u003E @cnt 0)\n (var-set acc (* @acc @cnt))\n (var-set cnt (dec @cnt)))\n @acc))\n#'user/factorial\nuser=\u003E (factorial 7)\n5040\n","created-at":1331249053000,"updated-at":1331249053000,"_id":"542692d6c026201cdc3270b9"}],"macro":true,"notes":null,"arglists":["name-vals-vec & body"],"doc":"varbinding=\u003E symbol init-expr\n\n Executes the exprs in a context in which the symbols are bound to\n vars with per-thread bindings to the init-exprs. The symbols refer\n to the var objects themselves, and must be accessed with var-get and\n var-set","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/with-local-vars"},{"added":"1.0","ns":"clojure.core","name":"ns-imports","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1288055178000,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.core","name":"ns-map","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e00"}],"line":4226,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[],"body":"user\u003E (ns-imports 'clojure.core)\n{ClassVisitor clojure.asm.ClassVisitor, ProcessBuilder java.lang.ProcessBuilder, Enum java.lang.Enum, SuppressWarnings java.lang.SuppressWarnings, Throwable java.lang.Throwable, InterruptedException ...chop...}","created-at":1288074884000,"updated-at":1288074884000,"_id":"542692ccc026201cdc326c68"}],"notes":null,"arglists":["ns"],"doc":"Returns a map of the import mappings for the namespace.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/ns-imports"},{"added":"1.0","ns":"clojure.core","name":"send-off","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1282635172000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"send","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e37"},{"created-at":1282635178000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"agent","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e38"},{"created-at":1282635185000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"shutdown-agents","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e39"}],"line":2139,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},{"login":"sfreund","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a288ab5288d2c86c37f8ae3aaa133b1a?r=PG&default=identicon"},{"login":"sfreund","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a288ab5288d2c86c37f8ae3aaa133b1a?r=PG&default=identicon"}],"body":"user=\u003E (def my-agent (agent \"\"))\n#'user/my-agent\nuser=\u003E @my-agent\n\"\"\n\n;; Note the following happens asynchronously in a thread\n;; pool\nuser=\u003E (send my-agent #(slurp %2) \"file.txt\")\n#\u003CAgent@13c6641: \"\"\u003E\n\n;; Assuming the action has been invoked the value will\n;; now be updated when we look at it.\nuser=\u003E @my-agent\n\"file contents\"\n\n","created-at":1285922554000,"updated-at":1349324262000,"_id":"542692c8c026201cdc326a5a"}],"notes":[{"updated-at":1396535611000,"body":"The example uses \"send\", this is supposed to be an example for \"send-off\".","created-at":1396535611000,"author":{"login":"Benissimo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e580eaf74a5f97c7ea01e0c026221a1d?r=PG&default=identicon"},"_id":"542692edf6e94c6970522022"}],"arglists":["a f & args"],"doc":"Dispatch a potentially blocking action to an agent. Returns the\n agent immediately. Subsequently, in a separate thread, the state of\n the agent will be set to the value of:\n\n (apply action-fn state-of-agent args)","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/send-off"},{"added":"1.0","ns":"clojure.core","name":"defmacro","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1336311079000,"author":{"login":"redraiment","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/33087654dbc710e81f51fda5f8241f28?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"macroexpand","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f7d"},{"created-at":1336311088000,"author":{"login":"redraiment","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/33087654dbc710e81f51fda5f8241f28?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"macroexpand-1","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f7e"},{"created-at":1336311122000,"author":{"login":"redraiment","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/33087654dbc710e81f51fda5f8241f28?r=PG&default=identicon"},"to-var":{"ns":"clojure.walk","name":"macroexpand-all","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f7f"}],"line":446,"examples":[{"author":{"login":"Kototama","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a54a4dc204925d397ca010b9a332e74d?r=PG&default=identicon"},"editors":[{"login":"Kototama","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a54a4dc204925d397ca010b9a332e74d?r=PG&default=identicon"}],"body":"(defmacro with-tree [tree & body]\n \"works on a JTree and restores its expanded paths after executing body\"\n `(let [tree# ~tree\n root# (.getRoot (.getModel tree#))\n expanded# (if-let [x# (.getExpandedDescendants\n tree# (TreePath. root#))]\n (enumeration-seq x#)\n ())\n selectionpaths# (. selectionmodel# getSelectionPaths)]\n ~@body\n (doseq [path# expanded#]\n (.expandPath tree# path#))))\n\n;; usage:\n\n(with-tree *one-jtree-instance*\n ;; some code here...\n )","created-at":1286492372000,"updated-at":1286492664000,"_id":"542692ccc026201cdc326c86"},{"author":{"login":"Clinton","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e460563f35b0b25d8671d6ef83f54ce?r=PG&default=identicon"},"editors":[],"body":"(defmacro unless [pred a b]\n `(if (not ~pred) ~a ~b))\n\n;; usage:\n\n(unless false (println \"Will print\") (println \"Will not print\"))","created-at":1327060274000,"updated-at":1327060274000,"_id":"542692d2c026201cdc326f7a"},{"author":{"login":"octopusgrabbus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fd31b8bcea99fa7b0711fbc424587774?r=PG&default=identicon"},"editors":[],"body":"(def dbg 1)\n\n(defmacro chk-flagM\n \"Throws an exception if flag does not resolve; else returns flag's value.\"\n [flag]\n (if (not (resolve flag))\n (throw (Exception. (str 'flag \" is not a valid var.\")))\n flag))\n\n(defn write-csv-file\n \"Writes a csv file using a key and an s-o-s\"\n [out-sos out-file]\n\n (if (\u003E= (chk-flagM dbg) 2)\n (println (first out-sos), \"\\n\", out-file))\n\n (spit out-file \"\" :append false)\n (with-open [out-data (io/writer out-file)]\n (csv/write-csv out-data (map #(concat % [\"\"]) out-sos))))\n\n","created-at":1361941726000,"updated-at":1361941726000,"_id":"542692d2c026201cdc326f7b"}],"macro":true,"notes":[{"updated-at":1332614198000,"body":"The body of a macro has two implicitly bound symbols: \u003Ccode\u003E&form\u003C/code\u003E and \u003Ccode\u003E&env\u003C/code\u003E. They work like two extra unnamed args. The names begin with '&' to avoid name clashes with normal user-defined symbols. The value of \u003Ccode\u003E&form\u003C/code\u003E is the form of the original macro call before macro expansion. There's useful meta-data on \u003Ccode\u003E&form\u003C/code\u003E. The value of \u003Ccode\u003E&env\u003C/code\u003E is the \"environment\", which is basically a map of lexical bindings. The keys of \u003Ccode\u003E&env\u003C/code\u003E are the lexically bound symbols. The values are internal compiler details, and probably aren't useful for user code.\r\n\r\n\r\nSee also:\r\n[http://blog.jayfields.com/2011/02/clojure-and.html](http://blog.jayfields.com/2011/02/clojure-and.html)","created-at":1332559647000,"author":{"login":"steveminer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d28543d134185d12d4006a74738d233e?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fdc"},{"updated-at":1348338864000,"body":"Due to syntax-quote resolving symbols (see the [Clojure reader docs](http://clojure.org/reader)), you won't be able to include a regular `let` statement inside a macro, i.e.:\r\n\r\n\u003Cpre\u003E(defmacro m [] `(let [x 1] x))\r\n(m) ; =\u003E CompilerException java.lang.RuntimeException: Can't let qualified name: user/x, compiling:(NO_SOURCE_PATH:1)\u003C/pre\u003E\r\n\r\nWe can see why:\r\n\r\n\u003Cpre\u003E(macroexpand-1 '(m)) ; =\u003E (clojure.core/let [user/x 1] user/x)\u003C/pre\u003E\r\nThe syntax-quote has resolved `x` to `user/x`—which can't be `let`. This is a good thing, as it's signalling to us that we should use gensyms by appending `#`:\r\n\r\n\u003Cpre\u003E(defmacro m [] `(let [x# 1] x#))\r\n(m) ; =\u003E 1\r\n(macroexpand-1 '(m)) ; =\u003E (clojure.core/let [x__383__auto__ 1] x__383__auto__)\u003C/pre\u003E","created-at":1348338864000,"author":{"login":"Arlen","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8bfb3a1eb9879049b4886cd3f9f321c4?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fe7"},{"updated-at":1396943327000,"body":"@Arlen:\r\nIf you want to capture the local variables, or create a non-locally scoped variable, you can prepend them with ~', allow a namespace capture:\r\n\r\n\u003Cpre\u003E(defmacro m [] `(let [~'x 1] ~'x))\r\n(m) ; => 1\r\n(macroexpand-1 '(m)) ; => (clojure.core/let [x 1] x)\r\n\u003C/pre\u003E\r\nuseful, if you desire it.","created-at":1396943283000,"author":{"login":"travis_rodman","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/988e7de687c27107309bebe02aee1984?r=PG&default=identicon"},"_id":"542692edf6e94c6970522024"}],"arglists":["name doc-string? attr-map? [params*] body","name doc-string? attr-map? ([params*] body) + attr-map?"],"doc":"Like defn, but the resulting function name is declared as a\n macro and will be used as a macro by the compiler when it is\n called.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/defmacro"},{"added":"1.3","ns":"clojure.core","name":"every-pred","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1348529552000,"author":{"login":"hugoduncan","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/80fa2a15219b987664e4d6f5c78b4c27?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"some-fn","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bf2"}],"line":7588,"examples":[{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[],"body":"user=\u003E ((every-pred number? odd?) 3 9 11)\ntrue","created-at":1335431607000,"updated-at":1335431607000,"_id":"542692d2c026201cdc326fa0"}],"notes":null,"arglists":["p","p1 p2","p1 p2 p3","p1 p2 p3 & ps"],"doc":"Takes a set of predicates and returns a function f that returns true if all of its\n composing predicates return a logical true value against all of its arguments, else it returns\n false. Note that f is short-circuiting in that it will stop execution on the first\n argument that triggers a logical false result against the original predicates.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/every-pred"},{"added":"1.0","ns":"clojure.core","name":"keys","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1289979132000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"vals","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cef"},{"created-at":1289979143000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"hash-map","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cf0"},{"created-at":1318592870000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"key","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cf1"},{"created-at":1361267874000,"author":{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"defn","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cf2"}],"line":1570,"examples":[{"author":{"login":"pkolloch","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/10b2fd3c0a4cc46dc241a48468dc551?r=PG&default=identicon"},"editors":[],"body":"\u003Cpre\u003E\r\nuser=\u003E (keys {:keys :and, :some :values})\r\n(:keys :some)\r\n\u003C/pre\u003E","created-at":1280458583000,"updated-at":1280458583000,"_id":"542692c7c026201cdc326951"}],"notes":[{"updated-at":1385457055000,"body":"Functions keys and vals return sequences such that\r\n\u003Cpre\u003E\r\n(= (zipmap (keys m) (vals m)) m)\r\n\u003C/pre\u003E","created-at":1385457055000,"author":{"login":"akhudek","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/aaf21f137b69cc5154c8afb29b793e18?r=PG&default=identicon"},"_id":"542692edf6e94c6970522010"}],"arglists":["map"],"doc":"Returns a sequence of the map's keys, in the same order as (seq map).","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/keys"},{"added":"1.0","ns":"clojure.core","name":"rationalize","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":1291,"examples":[{"author":{"login":"Miles","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bbb26d2a5e856c4fba0f72c3f7250f3f?r=PG&default=identicon"},"editors":[],"body":"\u003Cpre\u003E\r\nuser=\u003E (rationalize 1.5)\r\n3/2\r\n\u003C/pre\u003E","created-at":1283819843000,"updated-at":1283819843000,"_id":"542692cbc026201cdc326c27"},{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (rationalize Math/PI)\n3141592653589793/1000000000000000\n\nuser=\u003E (rationalize (Math/sqrt 2))\n14142135623730951/10000000000000000","created-at":1335430728000,"updated-at":1335430728000,"_id":"542692d4c026201cdc327049"}],"notes":[{"updated-at":1388083523000,"body":"Remember that for irrational numbers, like sqrt 2, this is only an estimate (pretty good one). ","created-at":1388083523000,"author":{"login":"wikopl","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ebf7a80146fda866cb2737cbabf79d63?r=PG&default=identicon"},"_id":"542692edf6e94c6970522017"}],"arglists":["num"],"doc":"returns the rational value of num","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/rationalize"},{"added":"1.0","ns":"clojure.core","name":"load-file","type":"function","see-alsos":[{"created-at":1286271536000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"load","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d3c"},{"created-at":1350073018000,"author":{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"spit","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d3d"}],"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"shawnmorel","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4a701b9e9467b6ccee6b83c698ea6b15?r=PG&default=identicon"},{"login":"Jeff Terrell","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/658b2643cf2a8192286b5bb1ecb62cf8?r=PG&default=identicon"}],"body":";; Very useful from a REPL\n;; Paths are specified as strings using canonical file path notation \n;; (rather than clojure-style namespaces dependent on the JVM classpath).\n;; The working directory is set to wherever you invoked the JVM from, \n;; likely the project root.\n\n(load-file \"src/mylib/core.clj\")\n\n;; now you can go and evaluate vars defined in that file.","created-at":1286271505000,"updated-at":1344912514000,"_id":"542692cdc026201cdc326d3e"},{"author":{"login":"lambder","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1c0c20072f52de3a6335cae183b865f6?r=PG&default=identicon"},"editors":[{"login":"lambder","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1c0c20072f52de3a6335cae183b865f6?r=PG&default=identicon"}],"body":";; file located at src/address_book/core.clj\n;; current dir is src/..\n\n(load-file \"src/address_book/core.clj\")","created-at":1307936530000,"updated-at":1307936548000,"_id":"542692cdc026201cdc326d41"},{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[],"body":";; create a clojure file on the fly using spit\n;; then load it into the REPL and use its function\n\nuser=\u003E (spit \"mycode.clj\" \"(defn doub [x] (* x 2))\")\nnil\nuser=\u003E (load-file \"mycode.clj\")\n#'user/doub\nuser=\u003E (doub 23)\n46\nuser=\u003E","created-at":1313970180000,"updated-at":1313970180000,"_id":"542692cdc026201cdc326d43"}],"notes":[{"updated-at":1350351731000,"body":"\u003Cp\u003EBe aware that this function is intended to load code only. If your data structures or a string in them grow bigger than around 65,535 it crashes.\u003C/p\u003E\r\n\r\n\u003Cp\u003EException similar to:\u003C/p\u003E\r\n\u003Cpre\u003Ejava.lang.ClassFormatError: Unknown constant tag 49 in class file parse$eval13\u003C/pre\u003E\r\n\r\n\u003Cp\u003EPlease use \u003Ca href=\"/clojure_core/clojure.core/read-string\"\u003Eread-string\u003C/a\u003E instead.\u003C/p\u003E\r\n\r\nExample: \u003Cpre\u003E(read-string (slurp \"data.clj\"))\u003C/pre\u003E\r\n\r\nSource: \u003Ca href=\"http://groups.google.com/group/clojure/browse_thread/thread/e556434a382de814/f8183c88db8fa257?lnk=gst&q=string+size#f8183c88db8fa257\"\u003EGoogle Groups\u003C/a\u003E","created-at":1350351731000,"author":{"login":"dedeibel","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e89e54d864f1e584c5ef4102f98bc83?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fee"},{"updated-at":1371613686000,"body":"\u003Cp\u003EThe following marginally helpful error will be thrown if you have a typo in your file:\u003C/p\u003E\r\n\r\n\u003Cpre\u003ECompilerException java.lang.RuntimeException: Unable to resolve symbol: load-file in this context, compiling:(NO_SOURCE_PATH:1:1)\u003C/pre\u003E\r\n\r\n\u003Cp\u003EFix the syntax error(s) in and you'll be able to use load-file again.\u003C/p\u003E\r\n\r\n\r\n","created-at":1371447277000,"author":{"login":"arkh","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1c6ed9b963d758914c2744befd4974ca?r=PG&default=identicon"},"_id":"542692edf6e94c6970522005"}],"arglists":["name"],"doc":"Sequentially read and evaluate the set of forms contained in the file.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/load-file"},{"added":"1.0","ns":"clojure.core","name":"distinct?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1396938477000,"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"distinct","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bf7"}],"line":5738,"examples":[{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[],"body":"\u003Cpre\u003Euser=\u003E (distinct? 1 2 3)\r\ntrue\r\nuser=\u003E (distinct? 1 2 3 3)\r\nfalse\u003C/pre\u003E","created-at":1279073728000,"updated-at":1279073728000,"_id":"542692c9c026201cdc326a8f"}],"notes":null,"tag":"java.lang.Boolean","arglists":["x","x y","x y & more"],"doc":"Returns true if no two of the arguments are =","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/distinct_q"},{"added":"1.9","ns":"clojure.core","name":"pos-int?","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":1422,"examples":null,"notes":null,"arglists":["x"],"doc":"Return true if x is a positive fixed precision integer","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/pos-int_q"},{"added":"1.2","ns":"clojure.core","name":"extenders","file":"clojure/core_deftype.clj","type":"function","column":1,"see-alsos":null,"line":565,"examples":[{"author":{"login":"leifp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d2f37720f063404ef83b987d2824353d?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (defprotocol P (id [this]))\nP\nuser=\u003E (extend-protocol P \n String \n (id [this] this)\n clojure.lang.Symbol \n (id [this] (name this))\n clojure.lang.Keyword\n (id [this] (name this)))\nnil\nuser=\u003E (extenders P)\n(java.lang.String clojure.lang.Symbol clojure.lang.Keyword)\n","created-at":1342531381000,"updated-at":1342531381000,"_id":"542692d3c026201cdc326fa3"}],"notes":null,"arglists":["protocol"],"doc":"Returns a collection of the types explicitly extending protocol","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/extenders"},{"added":"1.3","ns":"clojure.core","name":"unchecked-short","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":3548,"examples":null,"notes":null,"arglists":["x"],"doc":"Coerce to short. Subject to rounding or truncation.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/unchecked-short"},{"added":"1.0","ns":"clojure.core","name":"methods","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1337585063000,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"get-method","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f4f"},{"created-at":1337585066000,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"remove-method","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f50"},{"created-at":1337585074000,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"prefer-method","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f51"},{"created-at":1337585077000,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"prefers","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f52"}],"line":1828,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (methods print-dup) \n \n{nil #\u003Ccore$fn__4813 clojure.core$fn__4813@1e929ba3\u003E, java.lang.Class #\u003Ccore$fn__4905 clojure.core$fn__4905@4d8ef117\u003E, java.lang.Integer #\u003Ccore$fn__4887 clojure.core$fn__4887@699dd97b\u003E, clojure.lang.Symbol #\u003Ccore$fn__4839 clojure.core$fn__4839@3b961a84\u003E, clojure.lang.IPersistentCollection #\u003Ccore$fn__4857 clojure.core$fn__4857@c7f5bf9\u003E, java.util.Collection #\u003Ccore$fn__4853 clojure.core$fn__4853@1286d597\u003E, clojure.lang.ISeq #\u003Ccore$fn__4847 clojure.core$fn__4847@7bfd25ce\u003E, java.util.regex.Pattern #\u003Ccore$fn__4916 clojure.core$fn__4916@1e646bfb\u003E, clojure.lang.Namespace #\u003Ccore$fn__4918 clojure.core$fn__4918@54d1f0ad\u003E, clojure.lang.IPersistentList #\u003Ccore$fn__4849 clojure.core$fn__4849@75f0f8ff\u003E, clojure.lang.IPersistentMap #\u003Ccore$fn__4878 clojure.core$fn__4878@44f1b25e\u003E, clojure.lang.PersistentHashSet #\u003Ccore$fn__4897 clojure.core$fn__4897@2d97d09f\u003E, java.util.Map #\u003Ccore$fn__4874 clojure.core$fn__4874@2c18b492\u003E, clojure.lang.LazilyPersistentVector #\u003Ccore$fn__4901 clojure.core$fn__4901@3403f5a0\u003E, clojure.lang.Var #\u003Ccore$fn__4843 clojure.core$fn__4843@37f808e6\u003E, java.lang.Number #\u003Ccore$fn__4824 clojure.core$fn__4824@3a252a17\u003E, java.lang.Boolean #\u003Ccore$fn__4834 clojure.core$fn__4834@4f65cbd2\u003E, java.math.BigDecimal #\u003Ccore$fn__4893 clojure.core$fn__4893@5b0010ec\u003E, java.lang.String #\u003Ccore$fn__4863 clojure.core$fn__4863@2025b64d\u003E, java.lang.Character #\u003Ccore$fn__4885 clojure.core$fn__4885@7669521\u003E, clojure.lang.Ratio #\u003Ccore$fn__4891 clojure.core$fn__4891@6feb139e\u003E, clojure.lang.Keyword #\u003Ccore$fn__4820 clojure.core$fn__4820@738bf6bf\u003E, clojure.lang.PersistentHashMap #\u003Ccore$fn__4895 clojure.core$fn__4895@3f8771dc\u003E, clojure.lang.PersistentVector #\u003Ccore$fn__4899 clojure.core$fn__4899@74914a0a\u003E, java.lang.Double #\u003Ccore$fn__4889 clojure.core$fn__4889@3b3e3940\u003E, clojure.lang.Fn #\u003Ccore$fn__4828 clojure.core$fn__4828@41d753b7\u003E}\n","created-at":1286272206000,"updated-at":1286272206000,"_id":"542692ccc026201cdc326cc5"}],"notes":[{"updated-at":1286272245000,"body":"Not the most useful output format I've ever seen. :-)","created-at":1286272245000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521f99"}],"arglists":["multifn"],"doc":"Given a multimethod, returns a map of dispatch values -\u003E dispatch fns","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/methods"},{"added":"1.0","ns":"clojure.core","name":"odd?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1354423246000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"even?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d53"}],"line":1408,"examples":[{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (odd? 1)\ntrue\nuser=\u003E (odd? 2)\nfalse\nuser=\u003E (odd? 0)\nfalse","created-at":1279074688000,"updated-at":1332952870000,"_id":"542692c8c026201cdc3269e5"}],"notes":null,"arglists":["n"],"doc":"Returns true if n is odd, throws an exception if n is not an integer","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/odd_q"},{"ns":"clojure.core","name":"-\u003EArrayChunk","file":"clojure/gvec.clj","type":"function","column":1,"see-alsos":null,"line":37,"examples":null,"notes":null,"arglists":["am arr off end"],"doc":"Positional factory function for class clojure.core.ArrayChunk.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/-\u003EArrayChunk"},{"added":"1.0","ns":"clojure.core","name":"float-array","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":5330,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (float-array [1 2 3])\n#\u003Cfloat[] [F@4d8dfa76\u003E","created-at":1281617421000,"updated-at":1332949991000,"_id":"542692c9c026201cdc326ae0"}],"notes":null,"arglists":["size-or-seq","size init-val-or-seq"],"doc":"Creates an array of floats","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/float-array"},{"added":"1.0","ns":"clojure.core","name":"*3","file":"clojure/core.clj","type":"var","column":1,"see-alsos":[{"created-at":1302912219000,"author":{"login":"hoornet","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5834f829a9def19620d4014c46642172?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"*1","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d6a"},{"created-at":1302912225000,"author":{"login":"hoornet","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5834f829a9def19620d4014c46642172?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"*2","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d6b"}],"dynamic":true,"line":6355,"examples":[{"author":{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E \"Hello!\"\n\"Hello!\"\n\nuser=\u003E \"Hello World!\"\n\"Hello World!\"\n\nuser=\u003E \"Hi Everyone!\"\n\"Hi Everyone!\"\n\nuser=\u003E [*1 *2 *3]\n[\"Hi Everyone!\" \"Hello World!\" \"Hello!\"]\n","created-at":1279048146000,"updated-at":1285502085000,"_id":"542692c6c026201cdc326913"},{"author":{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (range 5)\n(0 1 2 3 4)\nuser=\u003E (last *1)\n4\nuser=\u003E (last *2)\n4\nuser=\u003E (last *3)\n4\n","created-at":1279048336000,"updated-at":1285502101000,"_id":"542692c6c026201cdc326915"}],"notes":null,"arglists":[],"doc":"bound in a repl thread to the third most recent value printed","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/*3"},{"added":"1.0","ns":"clojure.core","name":"alias","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1374148345000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ns-aliases","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d62"},{"created-at":1390613584000,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"ns-unalias","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d63"}],"line":4290,"examples":[{"author":{"login":"teyc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bd6e62afb4881ab0f617611b8b65d003?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (require 'clojure.string)\nnil\n\nuser=\u003E (alias 'string 'clojure.string)\nnil\n\nuser=\u003E (string/capitalize \"hONdURas\")\n\"Honduras\"","created-at":1283925470000,"updated-at":1285487529000,"_id":"542692cec026201cdc326e01"}],"notes":null,"arglists":["alias namespace-sym"],"doc":"Add an alias in the current namespace to another\n namespace. Arguments are two symbols: the alias to be used, and\n the symbolic name of the target namespace. Use :as in the ns macro in preference\n to calling this directly.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/alias"},{"added":"1.2","ns":"clojure.core","name":"frequencies","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1325040915000,"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"group-by","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d38"},{"created-at":1396938657000,"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"distinct","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d39"}],"line":7351,"examples":[{"author":{"login":"pkolloch","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/10b2fd3c0a4cc46dc241a48468dc551?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (frequencies ['a 'b 'a 'a])\n{a 3, b 1}","created-at":1282321661000,"updated-at":1332952608000,"_id":"542692cac026201cdc326b14"}],"notes":[{"updated-at":1358885265000,"body":"\u003Cpre\u003E(fn [coll]\r\n (let [gp (group-by identity coll)] \r\n (zipmap (keys gp) (map #(count (second %)) gp))))\u003C/pre\u003E","created-at":1358885188000,"author":{"login":"lispro06","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/20c3faad6f66a434dae42b5ed8ad305?r=PG&default=identicon"},"_id":"542692edf6e94c6970521ffb"},{"updated-at":1370062406000,"body":" (into {} (for [[k v] (group-by identity \"abbbc\")] [k (count v)]))\r\n","created-at":1370062406000,"author":{"login":"danneu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c42635853936e509f76ece9d8187c4aa?r=PG&default=identicon"},"_id":"542692edf6e94c6970522004"}],"arglists":["coll"],"doc":"Returns a map from distinct items in coll to the number of times\n they appear.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/frequencies"},{"added":"1.0","ns":"clojure.core","name":"read-string","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1289454685000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"pr-str","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521a90"},{"created-at":1289454689000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"str","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521a91"},{"created-at":1313054776000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"read","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521a92"},{"created-at":1334883935000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"load-string","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521a93"},{"created-at":1352963672000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"*read-eval*","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521a94"}],"line":3831,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (read-string \"1.1\") \n1.1\n\nuser=\u003E (read-string \"1.1.1 (+ 1 1)\")\njava.lang.RuntimeException: java.lang.NumberFormatException: Invalid number: 1.1.1 (NO_SOURCE_FILE:0)\n\nuser=\u003E (read-string \"(+ 1 1)\")\n(+ 1 1)\n","created-at":1282634798000,"updated-at":1285494370000,"_id":"542692c9c026201cdc326ad6"},{"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"editors":[{"login":"tormaroe","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8bc7bb10bee96efb190053fe92ffd250?r=PG&default=identicon"}],"body":"user=\u003E (eval (read-string \"(+ 1 1)\"))\n2\n\nuser=\u003E (read-string (prn-str (+ 1 1)))\n2\n","created-at":1289408002000,"updated-at":1289710230000,"_id":"542692c9c026201cdc326ad8"},{"author":{"login":"benjiiiiii","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fd1adaf32d9dc6531d6041dbc379efb0?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (+ 11 (read-string \"23\"))\n34\n","created-at":1291246357000,"updated-at":1291246357000,"_id":"542692c9c026201cdc326ada"},{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"}],"body":"user=\u003E (read-string \"; foo\\n5\")\n5\n\nuser=\u003E (read-string \"#^String x\")\nx\n\nuser=\u003E (read-string \"(1)\")\n(1)\n\nuser=\u003E (read-string \"(+ 1 2) (- 3 2)\")\n(+ 1 2)\n\nuser=\u003E (read-string \"@a\")\n(clojure.core/deref a)\n\nuser=\u003E (read-string \"(+ 1 2))))))\")\n(+ 1 2)\n\nuser=\u003E (read-string \"::whatever-namespace-you-are-in\")\n:user/whatever-namespace-you-are-in","created-at":1335430367000,"updated-at":1335430553000,"_id":"542692d5c026201cdc32705f"},{"author":{"login":"dansalmo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e33ee460f5f61bc5ba9b598934766215?r=PG&default=identicon"},"editors":[{"login":"dansalmo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e33ee460f5f61bc5ba9b598934766215?r=PG&default=identicon"}],"body":";convert a string representing a sequence,\n;to the sequence that the string represents\nuser=\u003E (read-string \"(\\\\( \\\\x \\\\y \\\\) \\\\z)\")\n(\\( \\x \\y \\) \\z)\n\n;then you can convert to the string that the string-sequence represents\nuser=\u003E (apply str (read-string \"(\\\\( \\\\x \\\\y \\\\) \\\\z)\"))\n\"(xy)z\"\n\n;which is the inverse of\nuser=\u003E (str (first (list (seq \"(xy)z\"))))\n\"(\\\\( \\\\x \\\\y \\\\) \\\\z)\"","created-at":1345526514000,"updated-at":1345526600000,"_id":"542692c9c026201cdc326adb"},{"author":{"login":"dansalmo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e33ee460f5f61bc5ba9b598934766215?r=PG&default=identicon"},"editors":[],"body":";; you can think of read-string as the inverse of pr-str\n;; turn string into symbols\nuser=\u003E (read-string \"(a b foo :bar)\")\n(a b foo :bar)\n\n;;turn symbols into a string\nuser=\u003E (pr-str '(a b foo :bar))\n\"(a b foo :bar)\"","created-at":1346843994000,"updated-at":1346843994000,"_id":"542692d5c026201cdc327061"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[],"body":";; WARNING: You SHOULD NOT use clojure.core/read-string to read data from\n;; untrusted soures. See the examples for clojure.core/read, because the same\n;; issues exist for both read and read-string.","created-at":1360635743000,"updated-at":1360635743000,"_id":"542692d5c026201cdc327062"}],"notes":[{"updated-at":1289408055000,"body":"read-string is useful for running clojure code from a script or translator.","created-at":1289408055000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fa2"}],"arglists":["s","opts s"],"doc":"Reads one object from the string s. Optionally include reader\n options, as specified in read.\n\n Note that read-string can execute code (controlled by *read-eval*),\n and as such should be used only with trusted sources.\n\n For data structure interop use clojure.edn/read-string","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/read-string"},{"added":"1.0","ns":"clojure.core","name":"proxy","file":"clojure/core_proxy.clj","type":"macro","column":1,"see-alsos":[{"created-at":1360270636000,"author":{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"gen-class","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521c9e"},{"created-at":1360270701000,"author":{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"gen-interface","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521c9f"},{"created-at":1361858921000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"reify","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ca0"}],"line":334,"examples":[{"author":{"login":"Kototama","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a54a4dc204925d397ca010b9a332e74d?r=PG&default=identicon"},"editors":[],"body":";; adding a mouse pressed callback to a Swing component:\n\n(defn add-mousepressed-listener\n [component f & args]\n (let [listener (proxy [MouseAdapter] []\n (mousePressed [event]\n (apply f event args)))]\n (.addMouseListener component listener)\n listener))\n","created-at":1287523639000,"updated-at":1287523639000,"_id":"542692cdc026201cdc326d5c"},{"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"editors":[],"body":";; BUG: proxy dispatches *only* on name, not arity:\nuser=\u003E (let [p (proxy [java.io.InputStream] [] (read [] -1))]\n (println (.read p))\n (println (.read p (byte-array 3) 0 3)))\n\n-1\nArityException Wrong number of args (4) passed to: core$eval213$fn clojure.lang.AFn.throwArity (AFn.java:437)\n","created-at":1336686490000,"updated-at":1336686490000,"_id":"542692d4c026201cdc327040"},{"author":{"login":"craigandera","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/61b4809de147650070a5e209be48fe7f?r=PG&default=identicon"},"editors":[],"body":";; You can, however, provide multiple-arity functions to get some support \n;; for overloading\nuser\u003E (let [p (proxy [java.io.InputStream] []\n (read ([] 1)\n ([^bytes bytes] 2)\n ([^bytes bytes off len] 3)))]\n (println (.read p))\n (println (.read p (byte-array 3)))\n (println (.read p (byte-array 3) 0 3)))\n\n1\n2\n3\nnil","created-at":1363059784000,"updated-at":1363059784000,"_id":"542692d4c026201cdc327041"}],"macro":true,"notes":null,"arglists":["class-and-interfaces args & fs"],"doc":"class-and-interfaces - a vector of class names\n\n args - a (possibly empty) vector of arguments to the superclass\n constructor.\n\n f =\u003E (name [params*] body) or\n (name ([params*] body) ([params+] body) ...)\n\n Expands to code which creates a instance of a proxy class that\n implements the named class/interface(s) by calling the supplied\n fns. A single class, if provided, must be first. If not provided it\n defaults to Object.\n\n The interfaces names must be valid interface types. If a method fn\n is not provided for a class method, the superclass method will be\n called. If a method fn is not provided for an interface method, an\n UnsupportedOperationException will be thrown should it be\n called. Method fns are closures and can capture the environment in\n which proxy is called. Each method fn takes an additional implicit\n first arg, which is bound to 'this. Note that while method fns can\n be provided to override protected methods, they have no other access\n to protected members, nor to super, as these capabilities cannot be\n proxied.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/proxy"},{"added":"1.0","ns":"clojure.core","name":"rsubseq","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1330671605000,"author":{"login":"Chouser","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7a0192050ed6488670acfd3f59405c10?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"subseq","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521efe"}],"line":5179,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[],"body":"user\u003E (rsubseq (sorted-set 1 2 3 4 5) \u003C 3)\n(2 1)","created-at":1286871962000,"updated-at":1286871962000,"_id":"542692c9c026201cdc326af4"}],"notes":null,"arglists":["sc test key","sc start-test start-key end-test end-key"],"doc":"sc must be a sorted collection, test(s) one of \u003C, \u003C=, \u003E or\n \u003E=. Returns a reverse seq of those entries with keys ek for\n which (test (.. sc comparator (compare ek key)) 0) is true","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/rsubseq"},{"added":"1.2","ns":"clojure.core","name":"inc","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1325850434000,"author":{"login":"frangio","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/646001f0ba2b7df47a16c0a1d5b62225?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"dec","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d99"}],"line":924,"examples":[{"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (inc 1)\n2\n\nuser=\u003E (inc 1.0)\n2.0\n\nuser=\u003E (inc 1/2)\n3/2\n\nuser=\u003E (inc -1)\n0","created-at":1279992305000,"updated-at":1411874902968,"_id":"542692cac026201cdc326b45"}],"notes":[{"updated-at":1316509073000,"body":"Is the documentation suppose to be: \"Returns a number one greater than x.\" ? If not what is num?","created-at":1316509073000,"author":{"login":"icefox","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/dc848256f8954abd612cbe7e81859f91?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fcc"}],"arglists":["x"],"doc":"Returns a number one greater than num. Does not auto-promote\n longs, will throw on overflow. See also: inc'","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/inc"},{"added":"1.0","ns":"clojure.core","name":"get-method","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1337585046000,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"remove-method","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e3c"},{"created-at":1337585052000,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"methods","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e3d"}],"line":1834,"examples":[{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[],"body":";; define a multi-method, then demonstrate that you may use \n;; get-method in the same way you can call the method directly\n\nuser=\u003E (defmulti tos :Ob)\n#'user/tos\nuser=\u003E (defn line [p1 p2] {:Ob :line :p1 p1 :p2 p2})\n#'user/line\nuser=\u003E (defn circle [cent rad] {:Ob :circle :cent cent :rad rad})\n#'user/circle\nuser=\u003E (defmethod tos :line [l] (str \"Line:\" (l :p1) (l :p2)))\n#\u003CMultiFn clojure.lang.MultiFn@a0b1cd0\u003E\nuser=\u003E (defmethod tos :circle [c] (str \"Circle:\" (c :cent) (c :rad)))\n#\u003CMultiFn clojure.lang.MultiFn@a0b1cd0\u003E\nuser=\u003E (println (tos (circle [2 3] 3.3)))\nCircle:[2 3]3.3\nnil\nuser=\u003E (println (tos (line [1 1][0 0])))\nLine:[1 1][0 0]\nnil\nuser=\u003E (println ((get-method tos :line) (line [1 2][3 4]) ))\nLine:[1 2][3 4]\nnil\nuser=\u003E","created-at":1313922883000,"updated-at":1313922883000,"_id":"542692cfc026201cdc326e6b"}],"notes":null,"arglists":["multifn dispatch-val"],"doc":"Given a multimethod and a dispatch value, returns the dispatch fn\n that would apply to that value, or nil if none apply and no default","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/get-method"},{"added":"1.3","ns":"clojure.core","name":"with-redefs","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1322088077000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"with-redefs-fn","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b7b"},{"created-at":1322088155000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"alter-var-root","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b7c"},{"created-at":1365637645000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"with-bindings","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b7d"}],"line":7710,"examples":[{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[],"body":"user=\u003E [(type []) (class [])]\n[clojure.lang.PersistentVector clojure.lang.PersistentVector]\n\nuser=\u003E (with-redefs [type (constantly java.lang.String)\n class (constantly 10)]\n [(type [])\n (class [])])\n[java.lang.String 10]","created-at":1335591486000,"updated-at":1335591486000,"_id":"542692d6c026201cdc3270bc"},{"author":{"login":"johnnyluu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1ba99f2dc1064733c7badbb16db9254a?r=PG&default=identicon"},"editors":[{"login":"johnnyluu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1ba99f2dc1064733c7badbb16db9254a?r=PG&default=identicon"},{"login":"rebcabin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/880b0bb3a4be9237326dd69565444dee?r=PG&default=identicon"}],"body":"(ns http)\n\n(defn post [url]\n {:body \"Hello world\"})\n\n(ns app\n (:require [clojure.test :refer [deftest is run-tests]]))\n\n(deftest is-a-macro\n (with-redefs [http/post (fn [url] {:body \"Goodbye world\"})]\n (is (= {:body \"Goodbye world\"} (http/post \"http://service.com/greet\")))))\n\n(run-tests) ;; test is passing","created-at":1350024154000,"updated-at":1366582892000,"_id":"542692d6c026201cdc3270bd"},{"author":{"login":"w01fe","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e6b62d981155b5945a29d84a2e439663?r=PG&default=identicon"},"editors":[],"body":";; be careful, with-redefs can permanently change a var if applied concurrently:\n\nuser\u003E (defn ten [] 10)\n#'user/ten\nuser\u003E (doall (pmap #(with-redefs [ten (fn [] %)] (ten)) (range 20 100)))\n...\nuser\u003E (ten)\n79","created-at":1352471112000,"updated-at":1352471112000,"_id":"542692d6c026201cdc3270c0"},{"author":{"login":"nickzam","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fa5bd71476b9dccce0117808539c8688?r=PG&default=identicon"},"editors":[],"body":";; redefine var\n(def foo 1)\n#'user/foo\n(with-redefs [foo 2] foo)\n2\n\n;; redefine private var\n(ns first)\n(def ^:private foo 1)\n#'first/foo\n\n(ns second)\n(with-redefs [first/foo 2] @#'first/foo)\n2\n\n;; @#' is the macros of (deref (var first/foo))\n(with-redefs [first/foo 2] (deref (var first/foo))\n2","created-at":1405030383000,"updated-at":1405030383000,"_id":"542692d6c026201cdc3270c1"}],"macro":true,"notes":null,"arglists":["bindings & body"],"doc":"binding =\u003E var-symbol temp-value-expr\n\n Temporarily redefines Vars while executing the body. The\n temp-value-exprs will be evaluated and each resulting value will\n replace in parallel the root value of its Var. After the body is\n executed, the root values of all the Vars will be set back to their\n old values. These temporary changes will be visible in all threads.\n Useful for mocking out functions during testing.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/with-redefs"},{"added":"1.9","ns":"clojure.core","name":"uuid?","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":6934,"examples":null,"notes":null,"arglists":["x"],"doc":"Return true if x is a java.util.UUID","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/uuid_q"},{"added":"1.0","ns":"clojure.core","name":"bit-clear","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":1345,"examples":[{"author":{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},"editors":[{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (bit-clear 2r1011 3) ; index is 0-based\n3 \n;; 3 = 2r0011\n\n;; the same in decimal\nuser=\u003E (bit-clear 11 3) \n3","created-at":1280337817000,"updated-at":1332950801000,"_id":"542692cbc026201cdc326bbf"}],"notes":null,"arglists":["x n"],"doc":"Clear bit at index n","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/bit-clear"},{"added":"1.0","ns":"clojure.core","name":"filter","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1282310761000,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.core","name":"remove","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e17"},{"created-at":1399907449000,"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"keep","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e19"}],"line":2810,"examples":[{"author":{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"iwilcox","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2cc6ed44aee2bf3d2d6064c941b1600a?r=PG&default=identicon"}],"body":"user=\u003E (filter even? (range 10))\n(0 2 4 6 8)\nuser=\u003E (filter (fn [x]\n (= (count x) 1))\n [\"a\" \"aa\" \"b\" \"n\" \"f\" \"lisp\" \"clojure\" \"q\" \"\"])\n(\"a\" \"b\" \"n\" \"f\" \"q\")\n\nuser=\u003E (filter #(= (count %) 1)\n [\"a\" \"aa\" \"b\" \"n\" \"f\" \"lisp\" \"clojure\" \"q\" \"\"])\n(\"a\" \"b\" \"n\" \"f\" \"q\")\n\n; When coll is a map, pred is called with key/value\n; pairs.\nuser=\u003E (filter #(\u003E (second %) 100)\n\t {:a 1\n\t :b 2\n\t :c 101\n\t :d 102\n\t :e -1})\n([:c 101] [:d 102])\n\nuser=\u003E (into {} *1)\n{:c 101, :d 102}\n","created-at":1279065921000,"updated-at":1395285268000,"_id":"542692cac026201cdc326b5f"}],"notes":null,"arglists":["pred","pred coll"],"doc":"Returns a lazy sequence of the items in coll for which\n (pred item) returns logical true. pred must be free of side-effects.\n Returns a transducer when no collection is provided.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/filter"},{"added":"1.0","ns":"clojure.core","name":"locking","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1410129605000,"author":{"login":"SQuest","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/14c2b5159bb6d42d41ab04b1c714bd1b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"future","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c76"}],"line":1662,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"Ljos","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/45b996a79abca465acaf6c0f10b0437?r=PG&default=identicon"}],"body":"user=\u003E (def o (Object.))\r\n\r\nuser=\u003E (future (locking o \r\n (Thread/sleep 10000) \r\n (println \"done\")))\r\n\r\n;; Now run this again before 10 seconds is up and you'll \r\n;; find the second instance prints done 10 seconds after the \r\n;; first instance has released the lock\r\n\r\nuser=\u003E (future (locking o \r\n (Thread/sleep 10000) \r\n (println \"done\")))\r\n\r\n;; Operates like the synchronized keyword in Java.\r\n","created-at":1286271996000,"updated-at":1327093918000,"_id":"542692cdc026201cdc326d21"}],"macro":true,"notes":null,"arglists":["x & body"],"doc":"Executes exprs in an implicit do, while holding the monitor of x.\n Will release the monitor of x in all circumstances.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/locking"},{"added":"1.0","ns":"clojure.core","name":"list","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":16,"examples":[{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (list 'a 'b 'c 'd 'e 'f 'g)\n(a b c d e f g)\nuser=\u003E (list 1 2 3)\n(1 2 3)","created-at":1279072062000,"updated-at":1332950370000,"_id":"542692cfc026201cdc326e52"},{"author":{"login":"devijvers","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/81018e4231ac1ce8b7a9e6d377092656?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (let [m {:1 1 :2 2 :3 3 :4 4}] (map list (keys m) (vals m)))\n((:1 1) (:2 2) (:3 3) (:4 4))","created-at":1279557389000,"updated-at":1332950386000,"_id":"542692cfc026201cdc326e54"}],"notes":null,"arglists":["& items"],"doc":"Creates a new list containing the items.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/list"},{"added":"1.2","ns":"clojure.core","name":"+","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1351919360000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"+'","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cb3"},{"created-at":1314343076000,"author":{"login":"Havvy","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e799a79441c7543be48562403411cd13?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"*","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521eaa"},{"created-at":1314343079000,"author":{"login":"Havvy","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e799a79441c7543be48562403411cd13?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"-","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521eab"}],"line":986,"examples":[{"author":{"login":"MrHus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4fa262299223e58030e9062d97224547?r=PG&default=identicon"},"editors":[{"login":"MrHus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4fa262299223e58030e9062d97224547?r=PG&default=identicon"},{"login":"semperos","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/edeae8e7534b3d554e4ec2c35ffc68d?r=PG&default=identicon"},{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},{"login":"csophys","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/611bdccae60c79419a30df0e2d6adc2b?r=PG&default=identicon"},{"login":"BenjyCui","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/60838f7abe2eb311a6e00b10597f34c2?r=PG&default=identicon"}],"body":"user=\u003E (+)\n0\n\nuser=\u003E (+ 1)\n1\n\nuser=\u003E (+ -10)\n-10\n\nuser=\u003E (+ 1 2)\n3\n\nuser=\u003E (+ 1 2 3)\n6\n\nuser=\u003E (apply + (range 10))\n45","created-at":1279418175000,"updated-at":1397054843000,"_id":"542692c8c026201cdc326a18"}],"notes":null,"arglists":["","x","x y","x y & more"],"doc":"Returns the sum of nums. (+) returns 0. Does not auto-promote\n longs, will throw on overflow. See also: +'","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/+"},{"added":"1.0","ns":"clojure.core","name":"split-with","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1314290648000,"author":{"login":"Havvy","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e799a79441c7543be48562403411cd13?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"split-at","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c05"},{"created-at":1314291178000,"author":{"login":"Havvy","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e799a79441c7543be48562403411cd13?r=PG&default=identicon"},"to-var":{"ns":"clojure.string","name":"split","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c06"},{"created-at":1347077825000,"author":{"login":"dansalmo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e33ee460f5f61bc5ba9b598934766215?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"take-while","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c07"},{"created-at":1347077831000,"author":{"login":"dansalmo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e33ee460f5f61bc5ba9b598934766215?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"drop-while","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c08"}],"line":3015,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[],"body":"\u003Cpre\u003E\r\nuser=\u003E (split-with (partial \u003E= 3) [1 2 3 4 5])\r\n[(1 2 3) (4 5)]\r\n\u003C/pre\u003E","created-at":1281512571000,"updated-at":1281512571000,"_id":"542692c8c026201cdc3269ee"}],"notes":null,"arglists":["pred coll"],"doc":"Returns a vector of [(take-while pred coll) (drop-while pred coll)]","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/split-with"},{"added":"1.0","ns":"clojure.core","name":"aset","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":3949,"examples":[{"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (def my-array (into-array Integer/TYPE [1 2 3]))\n#'user/my-array\n\nuser=\u003E (aset my-array 1 10) ; Set the element with index 1 to 10\n10\n\nuser=\u003E (into [] my-array)\n[1 10 3]","created-at":1286508598000,"updated-at":1286508598000,"_id":"542692cbc026201cdc326ba0"}],"notes":null,"arglists":["array idx val","array idx idx2 & idxv"],"doc":"Sets the value at the index/indices. Works on Java arrays of\n reference types. Returns val.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/aset"},{"ns":"clojure.core","name":"-\u003EVecNode","file":"clojure/gvec.clj","type":"function","column":1,"see-alsos":null,"line":18,"examples":null,"notes":null,"arglists":["edit arr"],"doc":"Positional factory function for class clojure.core.VecNode.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/-\u003EVecNode"},{"added":"1.11","ns":"clojure.core","name":"abs","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":1137,"examples":null,"notes":null,"arglists":["a"],"doc":"Returns the absolute value of a.\n If a is Long/MIN_VALUE =\u003E Long/MIN_VALUE\n If a is a double and zero =\u003E +0.0\n If a is a double and ##Inf or ##-Inf =\u003E ##Inf\n If a is a double and ##NaN =\u003E ##NaN","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/abs"},{"added":"1.0","ns":"clojure.core","name":"keyword","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1292127515000,"author":{"login":"bgruber","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b3c2dc1a076ff6e60dfb085ecddcc9f6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"name","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cf9"},{"created-at":1318592819000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"keyword?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cfa"},{"created-at":1331680528000,"author":{"login":"franks42","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b3ee701dd6c481e5d310467ddfe62c48?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"namespace","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cfb"},{"created-at":1331680582000,"author":{"login":"franks42","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b3ee701dd6c481e5d310467ddfe62c48?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"find-keyword","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cfc"},{"created-at":1350410417000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"symbol","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cfd"}],"line":616,"examples":[{"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"editors":[{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},{"login":"Alan","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7567c12df3f5e8f8ca031d4320b476ba?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"rafmagana","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/40bd727b22d74930f292b63d45a71b07?r=PG&default=identicon"}],"body":";; (keyword name): name can be string, symbol, or keyword.\n;; \n;; (keyword ns name): ns and name must both be string.\n;; \n;; A keyword string, like a symbol, begins with a non-numeric\n;; character and can contain alphanumeric characters and *, +, !, -,\n;; _, and ?. (see http://clojure.org/reader for details).\n;; \n;; keyword does not validate input strings for ns and name, and may\n;; return improper keywords with undefined behavior for non-conformant\n;; ns and name.\n\nuser=\u003E (keyword 'foo)\n:foo\n\nuser=\u003E (keyword \"foo\") \n:foo\n\nuser=\u003E (keyword \"user\" \"foo\")\n:user/foo\n\n;; keyword in current namespace\nuser=\u003E (keyword (str *ns*) \"foo\")\n:user/foo","created-at":1280546489000,"updated-at":1406075185000,"_id":"542692cec026201cdc326d70"},{"author":{"login":"franks42","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b3ee701dd6c481e5d310467ddfe62c48?r=PG&default=identicon"},"editors":[{"login":"rafmagana","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/40bd727b22d74930f292b63d45a71b07?r=PG&default=identicon"}],"body":";; some gotchas to be aware of:\n\nuser=\u003E (keyword \"user\" 'abc)\nClassCastException clojure.lang.Symbol cannot be cast to java.lang.String clojure.core/keyword (core.clj:558)\n\nuser=\u003E (keyword *ns* \"abc\")\nClassCastException clojure.lang.Namespace cannot be cast to java.lang.String clojure.core/keyword (core.clj:558)\n\nuser=\u003E (keyword 'user \"abc\")\nClassCastException clojure.lang.Symbol cannot be cast to java.lang.String clojure.core/keyword (core.clj:558)\n\n\n;; Warning - the following generated keywords are non-conformant and may wreak\n;; serious havoc in the near/far future when least expected...\n\nuser=\u003E (keyword \"abc def\")\n:abc def\n\nuser=\u003E (keyword \"123def\")\n:123def\n\nuser=\u003E (keyword \"/abc/def/ghi\")\n:/abc/def/ghi","created-at":1331680488000,"updated-at":1406075527000,"_id":"542692d3c026201cdc326fde"},{"author":{"login":"Phalphalak","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a684c0fd4f27597437de953e92a15d4b?r=PG&default=identicon"},"editors":[{"login":"Phalphalak","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a684c0fd4f27597437de953e92a15d4b?r=PG&default=identicon"},{"login":"Phalphalak","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a684c0fd4f27597437de953e92a15d4b?r=PG&default=identicon"},{"login":"rafmagana","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/40bd727b22d74930f292b63d45a71b07?r=PG&default=identicon"}],"body":";; You can define namespaced keywords using '::'\nuser=\u003E (def a :foo)\n#'user/a\n\nuser=\u003E (def b ::foo)\n#'user/b\n\nuser=\u003E (ns foo)\nfoo=\u003E user/a\n:foo\n\nfoo=\u003E user/b\n:user/foo\n\nfoo=\u003E ::foo\n:foo/foo\n\nfoo=\u003E (= user/a :foo)\ntrue\n\nfoo=\u003E (= user/b ::foo)\nfalse\n\nfoo=\u003E (= user/b :user/foo)\ntrue","created-at":1392677011000,"updated-at":1406075556000,"_id":"542692d3c026201cdc326fe0"}],"notes":null,"tag":"clojure.lang.Keyword","arglists":["name","ns name"],"doc":"Returns a Keyword with the given namespace and name. Do not use :\n in the keyword strings, it will be added automatically.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/keyword"},{"added":"1.0","ns":"clojure.core","name":"*ns*","type":"var","see-alsos":null,"examples":[{"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"editors":[],"body":"user=\u003E *ns*\n#\u003CNamespace user\u003E","created-at":1289039963000,"updated-at":1289039963000,"_id":"542692c7c026201cdc3269c7"},{"author":{"login":"rafmagana","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/40bd727b22d74930f292b63d45a71b07?r=PG&default=identicon"},"editors":[{"login":"rafmagana","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/40bd727b22d74930f292b63d45a71b07?r=PG&default=identicon"}],"body":"user=\u003E (ns foo.bar)\nnil\n\nfoo.bar=\u003E *ns*\n#\u003CNamespace foo.bar\u003E","created-at":1406094577000,"updated-at":1406094613000,"_id":"542692d1c026201cdc326f35"}],"notes":[{"updated-at":1310470085000,"body":"A trap I fell into was that *ns* seems to get assigned to clojure.core when run as a \"gen-class\" compiled class.","created-at":1310470085000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fc4"}],"tag":"clojure.lang.Namespace","arglists":[],"doc":"A clojure.lang.Namespace object representing the current namespace.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/*ns*"},{"ns":"clojure.core","name":"destructure","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":4427,"examples":[{"author":{"login":"reborg","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5b2768c3c24e6e96d838c4c43038de93?r=PG&default=identicon"},"editors":[],"body":"; look ma, no let!\n(map #(intern *ns* (first %) (eval (last %))) (partition 2 (destructure '[[a b] [\"a\" \"b\"]])))\nuser=\u003E a\n\"a\"\nuser=\u003E b\n\"b\"","created-at":1396388229000,"updated-at":1396388229000,"_id":"542692d2c026201cdc326f8d"}],"notes":null,"arglists":["bindings"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core/destructure"},{"added":"1.0","ns":"clojure.core","name":"*assert*","type":"var","see-alsos":[{"created-at":1301778092000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"assert","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d09"}],"examples":null,"notes":[{"updated-at":1406676369000,"body":"A little digging through the RT.java code confirms that this is dynamic, and defaults to true.","created-at":1406676369000,"author":{"login":"hlship","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cb598cc180c2363c093e92e8e87e0493?r=PG&default=identicon"},"_id":"542692edf6e94c697052202e"}],"arglists":[],"doc":"When set to logical false, 'assert' will omit assertion checks in\n compiled code. Defaults to true.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/*assert*"},{"added":"1.0","ns":"clojure.core","name":"defmulti","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1285162568000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"defmethod","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c30"},{"created-at":1341270331000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"remove-method","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c31"},{"created-at":1341270338000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"remove-all-methods","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c32"},{"created-at":1341270344000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"prefers","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c33"},{"created-at":1341270349000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"methods","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c34"},{"created-at":1341270355000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"get-method","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c35"},{"created-at":1351463879000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"defprotocol","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c36"}],"line":1742,"examples":[{"author":{"login":"Victor","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bc41ebab54cc0e0fbe99d753876d45ce?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; Define the multimethod\n(defmulti service-charge (fn [acct] [(account-level acct) (:tag acct)]))\n\n;; Handlers for resulting dispatch values\n(defmethod service-charge [::acc/Basic ::acc/Checking] [_] 25)\n(defmethod service-charge [::acc/Basic ::acc/Savings] [_] 10)\n(defmethod service-charge [::acc/Premium ::acc/Account] [_] 0)","created-at":1290489704000,"updated-at":1412188617638,"_id":"542692cdc026201cdc326d58"},{"author":{"login":"Victor","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bc41ebab54cc0e0fbe99d753876d45ce?r=PG&default=identicon"},"editors":[{"login":"stand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d7f9ed2753f8b3517f1539f6129f0a17?r=PG&default=identicon"}],"body":";this example illustrates that the dispatch type\n;does not have to be a symbol, but can be anything (in this case, it's a string)\n\n(defmulti greeting\n (fn[x] (x \"language\")))\n\n;params is not used, so we could have used [_]\n(defmethod greeting \"English\" [params]\n \"Hello!\")\n\n(defmethod greeting \"French\" [params]\n \"Bonjour!\")\n\n;;default handling\n(defmethod greeting :default [params]\n (throw (IllegalArgumentException. \n (str \"I don't know the \" (params \"language\") \" language\"))))\n\n;then can use this like this:\n(def english-map {\"id\" \"1\", \"language\" \"English\"})\n(def french-map {\"id\" \"2\", \"language\" \"French\"})\n(def spanish-map {\"id\" \"3\", \"language\" \"Spanish\"})\n\n=\u003E(greeting english-map)\n\"Hello!\"\n=\u003E(greeting french-map)\n\"Bounjour!\"\n=\u003E(greeting spanish-map)\n java.lang.IllegalArgumentException: I don't know the Spanish language","created-at":1290492895000,"updated-at":1306831841000,"_id":"542692cdc026201cdc326d59"},{"author":{"login":"OnesimusUnbound","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fa4c391db0d2d1744cc2cd0d787dd3d?r=PG&default=identicon"},"editors":[],"body":";; Implementing factorial using multimethods Note that factorial-like function \n;; is best implemented using `recur` for enable tail-call optimization to avoid \n;; stack overflow error. This is a only a demonstration of clojure's multimethod\n\n;; identity form returns the same value passed\n(defmulti factorial identity)\n\n(defmethod factorial 0 [_] 1)\n(defmethod factorial :default [num] \n (* num (factorial (dec num))))\n\n(factorial 0) ; =\u003E 1\n(factorial 1) ; =\u003E 1\n(factorial 3) ; =\u003E 6\n(factorial 7) ; =\u003E 5040","created-at":1313197324000,"updated-at":1313197324000,"_id":"542692cdc026201cdc326d5b"},{"body":";; defmulti/defmethods support variadic arguments and dispatch functions.\n\n(defmulti bat \n (fn ([x y & xs] \n (mapv class (into [x y] xs)))))\n(defmethod bat [String String] [x y & xs] \n (str \"str: \" x \" and \" y))\n(defmethod bat [String String String] [x y & xs] \n (str \"str: \" x \", \" y \" and \" (first xs)))\n(defmethod bat [String String String String] [x y & xs] \n (str \"str: \" x \", \" y \", \" (first xs) \" and \" (second xs)))\n(defmethod bat [Number Number] [x y & xs] \n (str \"number: \" x \" and \" y))\n\n;; you call it like this...\n\n(bat \"mink\" \"stoat\")\n;; =\u003E \"str: mink and stoat\"\n\n(bat \"bear\" \"skunk\" \"sloth\")\n;; =\u003E \"str: bear, skunk and sloth\"\n\n(bat \"dog\" \"cat\" \"cow\" \"horse\")\n;; =\u003E \"str: dog, cat, cow and horse\"\n\n(bat 1 2)\n;; =\u003E \"number: 1 and 2\"","author":{"login":"phreed","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/211644?v=2"},"created-at":1412178008616,"updated-at":1412178054860,"editors":[{"login":"phreed","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/211644?v=2"}],"_id":"542c2058e4b05f4d257a2966"}],"macro":true,"notes":[{"updated-at":1290493285000,"body":"See also\r\n\r\nhttp://clojure.org/runtime_polymorphism\r\n\r\nhttp://clojure.org/multimethods\r\n\r\n","created-at":1290493285000,"author":{"login":"Victor","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bc41ebab54cc0e0fbe99d753876d45ce?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fa5"}],"arglists":["name docstring? attr-map? dispatch-fn & options"],"doc":"Creates a new multimethod with the associated dispatch function.\n The docstring and attr-map are optional.\n\n Options are key-value pairs and may be one of:\n\n :default\n\n The default dispatch value, defaults to :default\n\n :hierarchy\n\n The value used for hierarchical dispatch (e.g. ::square is-a ::shape)\n\n Hierarchies are type-like relationships that do not depend upon type\n inheritance. By default Clojure's multimethods dispatch off of a\n global hierarchy map. However, a hierarchy relationship can be\n created with the derive function used to augment the root ancestor\n created with make-hierarchy.\n\n Multimethods expect the value of the hierarchy option to be supplied as\n a reference type e.g. a var (i.e. via the Var-quote dispatch macro #'\n or the var special form).","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/defmulti"},{"added":"1.1","ns":"clojure.core","name":"chars","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1342917427000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"char-array","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bcf"}],"line":5411,"examples":null,"notes":null,"arglists":["xs"],"doc":"Casts to chars[]","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/chars"},{"added":"1.0","ns":"clojure.core","name":"str","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1347870090000,"author":{"login":"JR0cket","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1ff5786158c0be54051ef8e5c544555d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"pr","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e5e"},{"created-at":1347870109000,"author":{"login":"JR0cket","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1ff5786158c0be54051ef8e5c544555d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"prn","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e5f"}],"line":546,"examples":[{"author":{"login":"Dmitry Kakurin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/85b70be5da433a6adf5112e7140848da?r=PG&default=identicon"},"editors":[{"login":"Dmitry Kakurin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/85b70be5da433a6adf5112e7140848da?r=PG&default=identicon"},{"login":"Dmitry Kakurin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/85b70be5da433a6adf5112e7140848da?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"}],"body":"user=\u003E \"some string\"\n\"some string\"\n\nuser=\u003E (str)\n\"\"\nuser=\u003E (str nil)\n\"\"\nuser=\u003E (str 1)\n\"1\"\nuser=\u003E (str 1 2 3)\n\"123\"\nuser=\u003E (str 1 'symbol :keyword)\n\"1symbol:keyword\"\n\n;; A very common usage of str is to apply it to an existing collection:\nuser=\u003E (apply str [1 2 3])\n\"123\"\n\n;; compare it with:\nuser=\u003E (str [1 2 3])\n\"[1 2 3]\"\n\n","created-at":1279191631000,"updated-at":1285682135000,"_id":"542692ccc026201cdc326c5f"},{"author":{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},"editors":[{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"}],"body":";; Destructuring with a string, getting just a few characters from it\nuser=\u003E (let [[first-char second-char] \"abcde\"] \n (prn 'first= first-char) \n (prn 'second= second-char))\nfirst= \\a\nsecond= \\b\nnil\n\n;; More destructuring with a string\nuser=\u003E (let [[first-char second-char & rest-of-chars] \"abcde\"] \n (prn 'first= first-char) \n (prn 'second= second-char) \n (prn 'rest= rest-of-chars))\nfirst= \\a\nsecond= \\b\nrest= (\\c \\d \\e)\nnil\n\n;; Destructuring, getting the first character of a string\n;; and then a reference to the entire string\nuser=\u003E (let [[first-char :as all-the-string] \"abcde\"] \n (prn 'first= first-char) \n (prn 'all= all-the-string))\nfirst= \\a\nall= \"abcde\"\nnil","created-at":1285683003000,"updated-at":1285683237000,"_id":"542692ccc026201cdc326c64"}],"notes":null,"tag":"java.lang.String","arglists":["","x","x & ys"],"doc":"With no args, returns the empty string. With one arg x, returns\n x.toString(). (str nil) returns the empty string. With more than\n one arg, returns the concatenation of the str values of the args.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/str"},{"added":"1.0","ns":"clojure.core","name":"next","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1289038123000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"rest","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cc7"},{"created-at":1289038131000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"first","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cc8"},{"created-at":1344490440000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"fnext","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cc9"}],"line":57,"examples":[{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"}],"body":"user=\u003E (next '(:alpha :bravo :charlie))\n(:bravo :charlie)\n\nuser=\u003E (next (next '(:one :two :three)))\n(:three)\n\nuser=\u003E (next (next (next '(:one :two :three))))\nnil","created-at":1279071284000,"updated-at":1289038286000,"_id":"542692c8c026201cdc3269fb"},{"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"editors":[{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},{"login":"steveminer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d28543d134185d12d4006a74738d233e?r=PG&default=identicon"},{"login":"steveminer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d28543d134185d12d4006a74738d233e?r=PG&default=identicon"}],"body":";; next is used in the recursive call. (This is a naive implementation for illustration only. Using `rest` is usually preferred over `next`.)\n\n(defn my-map [func a-list]\n (when a-list\n (cons (func (first a-list))\n (my-map func (next a-list)))))","created-at":1289038112000,"updated-at":1306984795000,"_id":"542692c8c026201cdc3269fd"}],"notes":[{"updated-at":1306987897000,"body":"\u003Cpre\u003E(next aseq) === (seq (rest aseq))\u003C/pre\u003E\r\n\r\nWhen writing lazy sequence functions, you should use [rest](../clojure.core/rest), not \u003Cb\u003Enext\u003C/b\u003E.","created-at":1306984569000,"author":{"login":"steveminer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d28543d134185d12d4006a74738d233e?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fc0"}],"tag":"clojure.lang.ISeq","arglists":["coll"],"doc":"Returns a seq of the items after the first. Calls seq on its\n argument. If there are no more items, returns nil.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/next"},{"added":"1.0","ns":"clojure.core","name":"hash-map","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1317787775000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"merge","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b50"},{"created-at":1320356522000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"assoc","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b51"},{"created-at":1320356532000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"dissoc","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b52"},{"created-at":1397669031000,"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"array-map","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b53"},{"created-at":1397669038000,"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"sorted-map","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b54"}],"line":381,"examples":[{"author":{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},"editors":[{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},{"login":"rafmagana","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/40bd727b22d74930f292b63d45a71b07?r=PG&default=identicon"},{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"}],"body":";; create hash map the long way\nuser=\u003E (hash-map)\n{}\n\n;; create hash map the short way\nuser=\u003E {}\n{}\n\n;; sending a key more times, will remap it to the last value\nuser=\u003E (hash-map :key1 1, :key1 2) \n{:key1 2} \n\nuser=\u003E {:key1 1, :key1 2}\nIllegalArgumentException Duplicate key: :key1 clojure.lang.PersistentArrayMap.createWithCheck (PersistentArrayMap.java:70)\n\n\nuser=\u003E (hash-map :key1 'val1, 'key2 :val2, [:compound :key] nil)\n{[:compound :key] nil, :key1 val1, key2 :val2} \n\n","created-at":1280353272000,"updated-at":1362015949000,"_id":"542692cfc026201cdc326e1f"},{"author":{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (map #(hash-map % 0) (seq \"abcdefgh\"))\n({\\a 0} {\\b 0} {\\c 0} {\\d 0} {\\e 0} {\\f 0} {\\g 0} {\\h 0}) \n\nuser=\u003E (apply hash-map (.split \"a 1 b 2 c 3\" \" \"))\n{\"a\" \"1\", \"b\" \"2\", \"c\" \"3\"}","created-at":1280353365000,"updated-at":1332950168000,"_id":"542692cfc026201cdc326e23"},{"author":{"login":"dipto_sarkar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c1d3141a40d240f0918260201aaa0b01?r=PG&default=identicon"},"editors":[{"login":"dipto_sarkar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c1d3141a40d240f0918260201aaa0b01?r=PG&default=identicon"},{"login":"roryokane","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5b2b185c814bb25f2f95a1152e58f033?r=PG&default=identicon"}],"body":"; a hash map can be stored in a var by using `def`\nuser=\u003E (def person {:name \"Steve\" :age 24 :salary 7886 :company \"Acme\"})\n#'user/person\nuser=\u003E person\n{:age 24, :name \"Steve\", :salary 7886, :company \"Acme\"}","created-at":1341478710000,"updated-at":1388572400000,"_id":"542692d3c026201cdc326fc4"},{"author":{"login":"octopusgrabbus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fd31b8bcea99fa7b0711fbc424587774?r=PG&default=identicon"},"editors":[{"login":"Deadron","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b11cdeef90d84ff8af2a2c5012402939?r=PG&default=identicon"},{"login":"Deadron","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b11cdeef90d84ff8af2a2c5012402939?r=PG&default=identicon"}],"body":"; Take a sequence of sequences (vector of vectors, and create a map\n; using date as the map key.\nuser=\u003E (def csv1 [[\"01/01/2012\" 1 2 3 4][\"06/15/2012\" 38 24 101]])\n\nuser=\u003E (map #(hash-map (keyword (first %1)) (vec (rest %1))) csv1)\n{:01/01/2012 [1 2 3 4]} {:06/15/2012 [38 24 101]}\n\n; merge the list of maps into a single map\nuser=\u003E (apply merge '({\"01/01/2012\" [1 2 3 4]} {\"06/15/2012\" [38 24 101]}))\n{\"06/15/2012\" [38 24 101], \"01/01/2012\" [1 2 3 4]}\n\n","created-at":1342846621000,"updated-at":1384855343000,"_id":"542692d3c026201cdc326fc7"}],"notes":null,"arglists":["","& keyvals"],"doc":"keyval =\u003E key val\n Returns a new hash map with supplied mappings. If any keys are\n equal, they are handled as if by repeated uses of assoc.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/hash-map"},{"added":"1.0","ns":"clojure.core","name":"if-let","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1293436184000,"author":{"login":"0x89","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/56bc4acd59315ed4dc1cb99c3be71102?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"when-let","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d88"},{"created-at":1315004464000,"author":{"login":"srid","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bd3a68d670372cd09876c26270a4299a?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"if","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d89"}],"line":1858,"examples":[{"author":{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (defn sum-even-numbers [nums]\n (if-let [nums (seq (filter even? nums))]\n (reduce + nums)\n \"No even numbers found.\"))\n#'user/sum-even-numbers\n\nuser=\u003E (sum-even-numbers [1 3 5 7 9])\n\"No even numbers found.\"\n\nuser=\u003E (sum-even-numbers [1 3 5 7 9 10 12])\n22\n","created-at":1279379785000,"updated-at":1285499963000,"_id":"542692cdc026201cdc326cf5"},{"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"editors":[{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (if-let [x false y true]\n \"then\"\n \"else\")\njava.lang.IllegalArgumentException: if-let requires exactly 2 forms in binding vector (NO_SOURCE_FILE:1)\n\nuser=\u003E (defn if-let-demo [arg]\n (if-let [x arg]\n \"then\"\n \"else\"))\n\nuser=\u003E (if-let-demo 1) ; anything except nil/false\n\"then\"\nuser=\u003E (if-let-demo nil)\n\"else\"\nuser=\u003E (if-let-demo false)\n\"else\"\n","created-at":1279489140000,"updated-at":1285499985000,"_id":"542692cdc026201cdc326cf7"},{"author":{"login":"MrHus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4fa262299223e58030e9062d97224547?r=PG&default=identicon"},"editors":[{"login":"MrHus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4fa262299223e58030e9062d97224547?r=PG&default=identicon"},{"login":"MrHus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4fa262299223e58030e9062d97224547?r=PG&default=identicon"}],"body":"; This macro is nice when you need to calculate something big. And you need \n; to use the result but only when it's true:\n\n(if-let [life (meaning-of-life 12)]\n life\n (if-let [origin (origin-of-life 1)]\n origin\n (if-let [shot (who-shot-jr 5)]\n block-sol\n\t 42)))\n\n; As you can see in the above example it will return the answer \n; to the question only if the answer is not nil. If the answer\n; is nil it will move to the next question. Until finally it\n; gives up and returns 42.","created-at":1305844049000,"updated-at":1305844102000,"_id":"542692cdc026201cdc326cfa"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[],"body":";; See examples for \"if\" explaining Clojure's idea of logical true\n;; and logical false.","created-at":1334293326000,"updated-at":1334293326000,"_id":"542692d3c026201cdc326fcb"},{"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"editors":[],"body":";;; with distructuring binding\n\n;; successful case\n(if-let [[w n] (re-find #\"a(\\d+)x\" \"aaa123xxx\")]\n [w n]\n :not-found) ;=\u003E [\"a123x\" \"123\"]\n\n;; unsuccessful case\n(if-let [[w n] (re-find #\"a(\\d+)x\" \"bbb123yyy\")]\n [w n]\n :not-found) ;=\u003E :not-found\n\n;; same as above\n(if-let [[w n] nil]\n [w n]\n :not-found) ;=\u003E :not-found\n\n;; on Map\n(if-let [{:keys [a b]} nil]\n [a b]\n :not-found) ;=\u003E :not-found\n","created-at":1399644384000,"updated-at":1399644384000,"_id":"542692d3c026201cdc326fcc"}],"macro":true,"notes":[{"updated-at":1299054285000,"body":"The difference between when-let and if-let is that when-let doesn't have an else clause and and also accepts multiple forms so you don't need to use a (do...).","created-at":1299054285000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fb5"},{"updated-at":1326335082000,"body":"I wonder what motivates the restriction of only one binding, e.g. many Schemes implement an `and-let*` form which allows multiple bindings, evaluating them in order and breaking out on the first binding that evaluates to false. Can somebody shed some light on this?","created-at":1326335082000,"author":{"login":"DerGuteMoritz","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/66bba784787f4f725b1568ec69a616cc?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fd6"}],"arglists":["bindings then","bindings then else & oldform"],"doc":"bindings =\u003E binding-form test\n\n If test is true, evaluates then with binding-form bound to the value of \n test, if not, yields else","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/if-let"},{"added":"1.0","ns":"clojure.core","name":"underive","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":5717,"examples":[{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[],"body":";; create a simple hierarchy using the global hierarchy\n;; and demonstrate how underive is used\n\nuser=\u003E (derive ::dog ::animal)\nnil\nuser=\u003E (derive ::spaniel ::dog)\nnil\nuser=\u003E (derive ::tabby ::dog)\nnil\nuser=\u003E (ancestors ::tabby)\n#{:user/dog :user/animal}\nuser=\u003E (underive ::tabby ::dog)\nnil\nuser=\u003E (ancestors ::tabby)\nnil\nuser=\u003E","created-at":1313962237000,"updated-at":1313962237000,"_id":"542692cdc026201cdc326d0f"}],"notes":null,"arglists":["tag parent","h tag parent"],"doc":"Removes a parent/child relationship between parent and\n tag. h must be a hierarchy obtained from make-hierarchy, if not\n supplied defaults to, and modifies, the global hierarchy.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/underive"},{"added":"1.1","ns":"clojure.core","name":"ref-max-history","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1323973069000,"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ref","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ecf"},{"created-at":1364770314000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ref-min-history","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ed0"},{"created-at":1364770319000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ref-history-count","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ed1"}],"line":2496,"examples":null,"notes":null,"arglists":["ref","ref n"],"doc":"Gets the max-history of a ref, or sets it and returns the ref","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/ref-max-history"},{"added":"1.7","ns":"clojure.core","name":"Throwable-\u003Emap","file":"clojure/core_print.clj","type":"function","column":1,"see-alsos":null,"line":473,"examples":null,"notes":null,"arglists":["o"],"doc":"Constructs a data representation for a Throwable with keys:\n :cause - root cause message\n :phase - error phase\n :via - cause chain, with cause keys:\n :type - exception class symbol\n :message - exception message\n :data - ex-data\n :at - top stack element\n :trace - root cause stack elements","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/Throwable-\u003Emap"},{"added":"1.0","ns":"clojure.core","name":"false?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1375213349000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"not","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521efc"}],"line":507,"examples":[{"author":{"login":"samaaron","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ee3512261f38df2541b9adca77f025cb?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"(false? false) ;=\u003E true\n(false? true) ;=\u003E false\n(false? nil) ;=\u003E false\n(false? \"foo\") ;=\u003E false","created-at":1278738764000,"updated-at":1332950044000,"_id":"542692c7c026201cdc32699d"}],"notes":null,"tag":"java.lang.Boolean","arglists":["x"],"doc":"Returns true if x is the value false, false otherwise.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/false_q"},{"added":"1.0","ns":"clojure.core","name":"*print-readably*","type":"var","see-alsos":null,"examples":null,"notes":null,"arglists":[],"doc":"When set to logical false, strings and characters will be printed with\n non-alphanumeric characters converted to the appropriate escape sequences.\n\n Defaults to true","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/*print-readably*"},{"added":"1.0","ns":"clojure.core","name":"ints","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1299221089000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"int-array","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bc6"}],"line":5426,"examples":null,"notes":null,"arglists":["xs"],"doc":"Casts to int[]","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/ints"},{"added":"1.0","ns":"clojure.core","name":"class","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1281949437000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"type","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521a95"},{"created-at":1325041755000,"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"class?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521a96"},{"created-at":1357883208000,"author":{"login":"Dmitry Kakurin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/85b70be5da433a6adf5112e7140848da?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"instance?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521a97"}],"line":3486,"examples":[{"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (class 1)\njava.lang.Integer\n\nuser=\u003E (class [1 2 3])\nclojure.lang.PersistentVector\n\nuser=\u003E (class (String. \"foo\"))\njava.lang.String","created-at":1280546296000,"updated-at":1332952297000,"_id":"542692cac026201cdc326b68"}],"notes":null,"arglists":["x"],"doc":"Returns the Class of x","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/class"},{"added":"1.3","ns":"clojure.core","name":"some-fn","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1348529537000,"author":{"login":"hugoduncan","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/80fa2a15219b987664e4d6f5c78b4c27?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"every-pred","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ecd"},{"created-at":1374512408000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"some","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ece"}],"line":7628,"examples":[{"author":{"login":"replore","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e7869fe1a48cb1814c657eaca6bea3eb?r=PG&default=identicon"},"editors":[],"body":"\u003Cpre\u003E\nuser=\u003E ((some-fn even?) 1)\nfalse\nuser=\u003E ((some-fn even?) 2)\ntrue\nuser=\u003E ((some-fn even?) 1 2)\ntrue\n\u003C/pre\u003E","created-at":1321364478000,"updated-at":1321364478000,"_id":"542692d5c026201cdc32708b"},{"author":{"login":"uvtc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/34f159f89cbd1d9beac0276f5a7af552?r=PG&default=identicon"},"editors":[],"body":";; `some-fn` is useful for when you'd use `some` (to find out if any\n;; values in a given coll satisfy some predicate), but have more than\n;; one predicate. For example, to check if any values in a coll are\n;; either even or less than 10:\n\n(or (some even? [1 2 3])\n (some #(\u003C % 10) [1 2 3]))\n\n;; but `some-fn` can save you some duplication here:\n\n((some-fn even? #(\u003C % 10)) 1 2 3)\n\n;; Minor note: the former returns nil if it doesn't find\n;; what it's looking for. The latter returns false.","created-at":1343775095000,"updated-at":1343775095000,"_id":"542692d5c026201cdc32708c"},{"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"editors":[],"body":";;; http://en.wikipedia.org/wiki/Fizz_buzz\n(def fizzbuzz\n (some-fn #(and (= (mod % 3) 0) (= (mod % 5) 0) \"FizzBuzz\")\n #(and (= (mod % 3) 0) \"Fizz\")\n #(and (= (mod % 5) 0) \"Buzz\")))\n\n(doseq [n (take 17 (rest (range)))]\n (println (or (fizzbuzz n) n)))\n\n1\n2\nFizz\n4\nBuzz\nFizz\n7\n8\nFizz\nBuzz\n11\nFizz\n13\n14\nFizzBuzz\n16\n17","created-at":1399749753000,"updated-at":1399749753000,"_id":"542692d5c026201cdc32708d"}],"notes":null,"arglists":["p","p1 p2","p1 p2 p3","p1 p2 p3 & ps"],"doc":"Takes a set of predicates and returns a function f that returns the first logical true value\n returned by one of its composing predicates against any of its arguments, else it returns\n logical false. Note that f is short-circuiting in that it will stop execution on the first\n argument that triggers a logical true result against the original predicates.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/some-fn"},{"added":"1.2","ns":"clojure.core","name":"case","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1294148893000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"cond","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d1e"},{"created-at":1294148897000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"condp","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d1f"}],"line":6789,"examples":[{"author":{"login":"jneira","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2c8ecc24181d171df85a26458b9cd5f?r=PG&default=identicon"},"editors":[{"login":"jneira","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2c8ecc24181d171df85a26458b9cd5f?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"dale","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a7a1eca257c6cea943fea41e5cc3e9a3?r=PG&default=identicon"},{"login":"dale","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a7a1eca257c6cea943fea41e5cc3e9a3?r=PG&default=identicon"}],"body":"user=\u003E (let [mystr \"hello\"]\n (case mystr\n \"\" 0\n \"hello\" (count mystr)))\n5\n\nuser=\u003E (let [mystr \"no match\"]\n (case mystr\n \"\" 0\n \"hello\" (count mystr)))\nNo matching clause: no match\n [Thrown class java.lang.IllegalArgumentException]\n\nuser=\u003E (let [mystr \"no match\"]\n (case mystr\n \"\" 0\n \"hello\" (count mystr)\n \"default\"))\n\"default\"\n\n;; You can give multiple values for the same condition by putting\n;; those values in a list.\nuser=\u003E (case 'y\n (x y z) \"x, y, or z\"\n \"default\")\n\"x, y, or z\"\n\nuser=\u003E (let [myseq '(1 2)]\n (case myseq\n (()) \"empty seq\"\n ((1 2)) \"my seq\"\n \"default\"))\n\"my seq\"\n\n;; \"The test-constants are not evaluated.They must be compile-time\n;; literals, and need not be quoted.\" \nuser=\u003E (let [myvec [1 2]]\n (case myvec\n [] \"empty vec\"\n (vec '(1 2)) \"my vec\"\n \"default\"))\n\"default\"\n","created-at":1278987914000,"updated-at":1290672594000,"_id":"542692ccc026201cdc326c89"}],"macro":true,"notes":[{"updated-at":1290270646000,"body":"the third example describing myseq may be incorrect. I think we have to use vectors for comparing list of compile time constants.\r\n\u003Cpre\u003E\r\n(let [myseq [1 2]]\r\n (case myseq\r\n [] \"empty seq\"\r\n [1 2] \"my seq\"\r\n \"default\"))\r\n\u003C/pre\u003E\r\n\r\nThe parenthesized test conditions are used when multiple test conditions give the same output (output expression). In my case , since both [true, true] and [false, false] return true, i have put them within parenthesis.\r\n\r\n\u003Cpre\u003E\r\n(defn equ\r\n [a b]\r\n (case [a b]\r\n ([true true] [false false]) true\r\n true))\r\n\r\n(equ true true) ;; returns true\r\n(equ false false) ;; returns true\r\n(equ false true) ;; return false\r\n(equ true false) ;; returns false\r\n\u003C/pre\u003E","created-at":1290269788000,"author":{"login":"dpani","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3229d0eee8f780b9baa64657ff561fd3?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fa4"},{"updated-at":1290655074000,"body":"I updated that example with myseq to reflect behavior of Clojure 1.2.0 on my machine. I also added an additional example to explicitly demonstrate multiple values for the same condition.","created-at":1290655074000,"author":{"login":"dale","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a7a1eca257c6cea943fea41e5cc3e9a3?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fa6"}],"arglists":["e & clauses"],"doc":"Takes an expression, and a set of clauses.\n\n Each clause can take the form of either:\n\n test-constant result-expr\n\n (test-constant1 ... test-constantN) result-expr\n\n The test-constants are not evaluated. They must be compile-time\n literals, and need not be quoted. If the expression is equal to a\n test-constant, the corresponding result-expr is returned. A single\n default expression can follow the clauses, and its value will be\n returned if no clause matches. If no default expression is provided\n and no clause matches, an IllegalArgumentException is thrown.\n\n Unlike cond and condp, case does a constant-time dispatch, the\n clauses are not considered sequentially. All manner of constant\n expressions are acceptable in case, including numbers, strings,\n symbols, keywords, and (Clojure) composites thereof. Note that since\n lists are used to group multiple constants that map to the same\n expression, a vector can be used to match a list if needed. The\n test-constants need not be all of the same type.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/case"},{"added":"1.0","ns":"clojure.core","name":"*flush-on-newline*","type":"var","see-alsos":null,"examples":null,"notes":null,"arglists":[],"doc":"When set to true, output will be flushed whenever a newline is printed.\n\n Defaults to true.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/*flush-on-newline*"},{"added":"1.0","ns":"clojure.core","name":"to-array","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1329377518000,"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"alength","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ba2"},{"created-at":1329377602000,"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"char-array","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ba3"},{"created-at":1329377609000,"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"int-array","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ba4"},{"created-at":1329377615000,"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"long-array","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ba5"},{"created-at":1374150114000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"into-array","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ba6"},{"created-at":1374150319000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"make-array","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ba7"},{"created-at":1375613635000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"to-array-2d","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ba8"}],"line":340,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (to-array [1 2 3])\n#<Object[] [Ljava.lang.Object;@3a7e479a\u003E\n","created-at":1285922749000,"updated-at":1285922749000,"_id":"542692cfc026201cdc326e1e"},{"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"editors":[],"body":"(def hello (to-array \"Hello World!\"))\n\n(aget hello 1)\n\\e\n\n(aset hello 1 \\b) ;;Mutability! Watch out!\n\\b\n\n(dotimes [n (alength hello)] (print (aget hello n)))\nHbllo World!","created-at":1329377512000,"updated-at":1329377512000,"_id":"542692d5c026201cdc3270a9"}],"notes":null,"tag":"[Ljava.lang.Object;","arglists":["coll"],"doc":"Returns an array of Objects containing the contents of coll, which\n can be any Collection. Maps to java.util.Collection.toArray().","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/to-array"},{"added":"1.0","ns":"clojure.core","name":"bigdec","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1374317032000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"decimal?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ec2"}],"line":3673,"examples":[{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"replore","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e7869fe1a48cb1814c657eaca6bea3eb?r=PG&default=identicon"}],"body":"user=\u003E (bigdec 3.0)\n3.0M\n\nuser=\u003E (bigdec 5)\n5M\n\nuser=\u003E (bigdec -1)\n-1M\n\nuser=\u003E (bigdec -1.0)\n-1.0M\n\n","created-at":1280814320000,"updated-at":1321355928000,"_id":"542692cec026201cdc326d80"}],"notes":null,"tag":"java.math.BigDecimal","arglists":["x"],"doc":"Coerce to BigDecimal","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/bigdec"},{"added":"1.0","ns":"clojure.core","name":"list?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1318710916000,"author":{"login":"steveminer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d28543d134185d12d4006a74738d233e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"seq?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b5e"},{"created-at":1356063872000,"author":{"login":"hugoduncan","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/80fa2a15219b987664e4d6f5c78b4c27?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"sequential?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b5f"},{"created-at":1356066804000,"author":{"login":"hugoduncan","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/80fa2a15219b987664e4d6f5c78b4c27?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"coll?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b60"}],"line":6275,"examples":[{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[{"login":"MrHus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4fa262299223e58030e9062d97224547?r=PG&default=identicon"},{"login":"steveminer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d28543d134185d12d4006a74738d233e?r=PG&default=identicon"}],"body":"user=\u003E (list? '(1 2 3))\ntrue\nuser=\u003E (list? (list 1 2))\ntrue\nuser=\u003E (list? 0)\nfalse\nuser=\u003E (list? {})\nfalse\nuser=\u003E (list? [])\nfalse\nuser=\u003E (list? (range 10))\nfalse\n","created-at":1279074216000,"updated-at":1318710735000,"_id":"542692cbc026201cdc326b9d"}],"notes":[{"updated-at":1318711577000,"body":"You may want to use `seq?` instead of `list?`, especially if you might be dealing with a lazy sequence as returned by `filter`, `range`, etc.","created-at":1318711577000,"author":{"login":"steveminer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d28543d134185d12d4006a74738d233e?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fcf"}],"arglists":["x"],"doc":"Returns true if x implements IPersistentList","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/list_q"},{"added":"1.9","ns":"clojure.core","name":"simple-ident?","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":1632,"examples":null,"notes":null,"arglists":["x"],"doc":"Return true if x is a symbol or keyword without a namespace","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/simple-ident_q"},{"added":"1.0","ns":"clojure.core","name":"bit-not","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":1300,"examples":[{"author":{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},"editors":[{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (bit-not 2r0111)\n-8 \n\nuser=\u003E (bit-not -2r1000)\n7","created-at":1280338423000,"updated-at":1332951542000,"_id":"542692cac026201cdc326b50"}],"notes":null,"arglists":["x"],"doc":"Bitwise complement","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/bit-not"},{"added":"1.11","ns":"clojure.core","name":"parse-uuid","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":8192,"examples":null,"notes":null,"arglists":["s"],"doc":"Parse a string representing a UUID and return a java.util.UUID instance,\n or nil if parse fails.\n\n Grammar: https://docs.oracle.com/javase/8/docs/api/java/util/UUID.html#toString--","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/parse-uuid"},{"added":"1.0","ns":"clojure.core","name":"io!","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":null,"line":2529,"examples":[{"author":{"login":"mstoeckli","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/271f1fe6c39e19db5714ce29b64d3ad5?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (def a (ref 0))\n#'user/a\n\nuser=\u003E (dosync\n (io! (println \"hello\"))\n (alter a inc))\nIllegalStateException I/O in transaction\n\nuser=\u003E (dosync\n (println \"hello\")\n (alter a inc))\n\"hello\"\n1\n\nuser=\u003E (defn fn-with-io []\n (io! (println \"hello\")))\n#'user/fn-with-io\n\nuser=\u003E (dosync\n (fn-with-io)\n (alter a inc))\nIllegalStateException I/O in transaction","created-at":1337147168000,"updated-at":1337147168000,"_id":"542692d3c026201cdc326fdc"}],"macro":true,"notes":null,"arglists":["& body"],"doc":"If an io! block occurs in a transaction, throws an\n IllegalStateException, else runs body in an implicit do. If the\n first expression in body is a literal string, will use that as the\n exception message.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/io!"},{"added":"1.0","ns":"clojure.core","name":"xml-seq","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":5011,"examples":[{"author":{"login":"ed-g","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9b506528a954f5a5e83bd7041d287f68?r=PG&default=identicon"},"editors":[{"login":"biggert","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ebd5e5aaf54f2bb5b8b01872d8ffe5d0?r=PG&default=identicon"},{"login":"biggert","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ebd5e5aaf54f2bb5b8b01872d8ffe5d0?r=PG&default=identicon"},{"login":"biggert","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ebd5e5aaf54f2bb5b8b01872d8ffe5d0?r=PG&default=identicon"}],"body":";; data.xml from https://github.com/clojure/data.xml/\n(use '[clojure.data.xml :only [parse-str]])\n\nuser=\u003E (let [xml-text \"\u003C?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003E\n \u003Cfoo key=\\\"val\\\"\u003E1\u003Cbar\u003E2\u003C/bar\u003E3\u003C/foo\u003E\"]\n (let [root (parse-str xml-text)]\n (xml-seq root)))\n\n({:tag :foo, \n :attrs {:key \"val\"}, \n :content (\"1\" {:tag :bar, :attrs {}, :content (\"2\")} \"3\")} \n \"1\" \n {:tag :bar, :attrs {}, :content (\"2\")} \n \"2\" \n \"3\") \n","created-at":1357886858000,"updated-at":1367460525000,"_id":"542692d6c026201cdc3270c6"},{"author":{"login":"biggert","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ebd5e5aaf54f2bb5b8b01872d8ffe5d0?r=PG&default=identicon"},"editors":[],"body":"(use '[clojure.xml :only [parse]])\n\n;; clojure.xml/parse requires string to be ByteArrayInputStream\nuser-\u003E (let [xml-text \"\u003C?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003E\n \u003Cfoo key=\\\"val\\\"\u003E1\u003Cbar\u003E2\u003C/bar\u003E3\u003C/foo\u003E\"]\n (let [input (java.io.ByteArrayInputStream. \n (.getBytes xml-text))]\n (let [root (parse input)]\n (xml-seq root))))\n\n({:tag :foo, \n :attrs {:key \"val\"}, \n :content (\"1\" {:tag :bar, :attrs {}, :content (\"2\")} \"3\")} \n \"1\" \n {:tag :bar, :attrs {}, :content (\"2\")} \n \"2\" \n \"3\")","created-at":1367493904000,"updated-at":1367493904000,"_id":"542692d6c026201cdc3270ca"}],"notes":null,"arglists":["root"],"doc":"A tree seq on the xml elements as per xml/parse","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/xml-seq"},{"added":"1.0","ns":"clojure.core","name":"byte","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1334358069000,"author":{"login":"Havvy","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e799a79441c7543be48562403411cd13?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"byte-array","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e67"},{"created-at":1342917284000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"bytes","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e68"},{"created-at":1342917760000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"short","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e69"}],"line":3530,"examples":[{"author":{"login":"Miles","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bbb26d2a5e856c4fba0f72c3f7250f3f?r=PG&default=identicon"},"editors":[{"login":"Miles","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bbb26d2a5e856c4fba0f72c3f7250f3f?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"Miles","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bbb26d2a5e856c4fba0f72c3f7250f3f?r=PG&default=identicon"}],"body":"user=\u003E (def x (byte-array [(byte 0x43) \n (byte 0x6c)\n (byte 0x6f)\n (byte 0x6a)\n (byte 0x75)\n (byte 0x72)\n (byte 0x65)\n (byte 0x21)]))\n#'user/x\n\nuser=\u003E (String. x)\n\"Clojure!\"\n","created-at":1283813146000,"updated-at":1287791649000,"_id":"542692cbc026201cdc326c11"}],"notes":null,"arglists":["x"],"doc":"Coerce to byte","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/byte"},{"added":"1.0","ns":"clojure.core","name":"max","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1343257166000,"author":{"login":"john.r.woodward","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/22b6fbc4a386291e45b1cb4449377086?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"max-key","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cf7"},{"created-at":1371841162000,"author":{"login":"adereth","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5ad11b4e208a6cdb3bd45fe01dea59b7?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"min","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cf8"}],"line":1117,"examples":[{"author":{"login":"MrHus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4fa262299223e58030e9062d97224547?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; `max` returns the largest of its arguments\nuser=\u003E (max 1 2 3 4 5) \n5\n\n;; regardless of order of those arguments\nuser=\u003E (max 5 4 3 2 1)\n5\n\nuser=\u003E (max 100)\n100","created-at":1279417705000,"updated-at":1411918995332,"_id":"542692ccc026201cdc326c99"},{"author":{"login":"mydoghasworms","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e1e4692b0c0b2fcc1844f11cb43191da?r=PG&default=identicon"},"editors":[],"body":";; If elements are already in a sequence, use apply\nuser=\u003E (apply max [1 2 3 4 3])\n4\nuser=\u003E (apply max '(4 3 5 6 2))\n6","created-at":1367237523000,"updated-at":1367237523000,"_id":"542692d4c026201cdc32700b"}],"notes":[{"body":"As of 1.6, `max`'s behavior differs when it's passed single / multiple non-numeric arguments:\n\n```\n(max \"foo\") ;;=\u003E \"foo\"\n\n(max \"foo\" \"bar\") ;;=\u003E ClassCastException thrown\n```","created-at":1411919387514,"updated-at":1411919387514,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"_id":"54282e1be4b0ba57bdbcf25d"}],"arglists":["x","x y","x y & more"],"doc":"Returns the greatest of the nums.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/max"},{"added":"1.11","ns":"clojure.core","name":"update-keys","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":8148,"examples":null,"notes":null,"arglists":["m f"],"doc":"m f =\u003E {(f k) v ...}\n\n Given a map m and a function f of 1-argument, returns a new map whose\n keys are the result of applying f to the keys of m, mapped to the\n corresponding values of m.\n f must return a unique key for each key of m, else the behavior is undefined.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/update-keys"},{"added":"1.0","ns":"clojure.core","name":"==","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1287469513000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"=","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e4b"},{"created-at":1350778281000,"author":{"login":"dansalmo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e33ee460f5f61bc5ba9b598934766215?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"identical?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f34"}],"line":1102,"examples":[{"author":{"login":"james","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4b163432c99a124feee4be046a3f9d66?r=PG&default=identicon"},"editors":[{"login":"james","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4b163432c99a124feee4be046a3f9d66?r=PG&default=identicon"},{"login":"james","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4b163432c99a124feee4be046a3f9d66?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; true:\n(== 1)\n(== 1 1) \n(== 1/1, 2/2, 3/3, 4/4) \n(== 1, 1.0, 1/1)\n(== :foo)\n\n\n;; false:\n(== 1 2)\n(== 1 \\1)\n(== 1 \"1\")","created-at":1283399494000,"updated-at":1285488935000,"_id":"542692c6c026201cdc3268dd"}],"notes":[{"updated-at":1287470809000,"body":"There is a difference between \"=\" and \"==\". For primitives you definitely want to use \"==\" as \"=\" will result in a cast to the wrapped types for it's arguments.\r\n\r\nThis may not be the case come Clojure 1.3 (see [1])\r\n\r\n[1] http://github.com/clojure/clojure/commit/df8c65a286e90e93972bb69392bc106128427dde","created-at":1287470809000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521f9c"},{"updated-at":1363156271000,"body":"So what is difference with =? ","created-at":1363156271000,"author":{"login":"popopome","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/f764e6667c2664b9979227fc40be024e?r=PG&default=identicon"},"_id":"542692edf6e94c6970521ffe"},{"updated-at":1363512387000,"body":"'== is defined only for numbers, where '= is general equality. The example showing (== :foo) as true is a bit misleading because (== :foo :foo) produces an exception. Unary == always returns true as an optimization.","created-at":1363512387000,"author":{"login":"mattharden","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a0f377e9263784a0036c5417d0a18aef?r=PG&default=identicon"},"_id":"542692edf6e94c6970521fff"}],"arglists":["x","x y","x y & more"],"doc":"Returns non-nil if nums all have the equivalent\n value (type-independent), otherwise false","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/=="},{"added":"1.0","ns":"clojure.core","name":"*agent*","type":"var","see-alsos":[{"created-at":1399893914000,"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"agent","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d10"}],"examples":[{"author":{"login":"goodmike","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/42e0998c3077ba0ac435423941a3978e?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; *agent* is often used with send or send-off to set up a repeated\n;; transformation of an agent's value. For example, to repeatedly \n;; increment the integer value of an agent 'myagent' until some \n;; flag value 'running' evaluates to false:\n\n;; Create an agent set to an initial value of 0:\n(def myagent (agent 0))\n\n;; Define a variable to act as a boolean flag:\n(def running true)\n\n;; Define a function to increment agent value repeatedly:\n(defn inc-while-running [agent-value]\n (when running\n (send-off *agent* inc-while-running)) ;sets up another call\n (inc agent-value))\n\n;; Dereference myagent to confirm it is set to value 0:\nuser=\u003E @myagent\n0\n\n;; Start the fun:\nuser=\u003E (send-off myagent inc-while-running)\n#<Agent@5fb9f88b: 20>\n\n;; The agent has already been incremented many times (20 when I ran this)\n;; by the time the REPL prints.\n\n;; Redefine running as false to stop repeated send-off:\n(def running false)\n\n;; Dereference myagent to find its new value:\nuser=\u003E @myagent\n848167\n\n;; Dereference again to make sure incrementation has stopped:\nuser=\u003E @myagent\n848167","created-at":1279046895000,"updated-at":1285502273000,"_id":"542692cec026201cdc326d88"}],"notes":null,"tag":"clojure.lang.Agent","arglists":[],"doc":"The agent currently running an action on this thread, else nil","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/*agent*"},{"added":"1.0","ns":"clojure.core","name":"lazy-cat","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1318396486000,"author":{"login":"haplo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/890d46f8c0e24dd6fb8546095b1144e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"lazy-seq","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cfe"},{"created-at":1318396500000,"author":{"login":"haplo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/890d46f8c0e24dd6fb8546095b1144e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"concat","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cff"}],"line":4663,"examples":[{"author":{"login":"pashields","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/6ff7e838d2c47adf942be6df4d22b452?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (lazy-cat [1 2 3] [4 5 6])\n(1 2 3 4 5 6)\n","created-at":1295304229000,"updated-at":1295304229000,"_id":"542692c7c026201cdc3269d5"},{"author":{"login":"kij","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/153ba8c871d2f98e6683850790f27f60?r=PG&default=identicon"},"editors":[{"login":"kij","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/153ba8c871d2f98e6683850790f27f60?r=PG&default=identicon"},{"login":"bmabey","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/1837?v=2"}],"body":";; N.B. this example holds onto the head of a lazy seq which should generally be avoided\n(def fib-seq\n (lazy-cat [0 1] (map + (rest fib-seq) fib-seq)))\n\n(take 10 fib-seq)","created-at":1332777683000,"updated-at":1347405980000,"_id":"542692d3c026201cdc326fe4"},{"author":{"login":"guruma","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ade3cfcd37c594a590528e352528bba2?r=PG&default=identicon"},"editors":[{"login":"guruma","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ade3cfcd37c594a590528e352528bba2?r=PG&default=identicon"},{"login":"guruma","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ade3cfcd37c594a590528e352528bba2?r=PG&default=identicon"},{"login":"rahulpilani","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3c3585fc1c6bf074ed5f268c9ebcb2f?r=PG&default=identicon"}],"body":";; When the producer function produces a collection, not an element,\n;; lazy-cat is usable.\nuser=\u003E (defn n-repeat [n] (lazy-cat (repeat n n) (n-repeat (inc n))))\n#'user/n-repeat\n\nuser=\u003E (take 6 (n-repeat 1))\n(1 2 2 3 3 3)\n\nuser=\u003E (take 12 (n-repeat 1))\n(1 2 2 3 3 3 4 4 4 4 5 5)\n","created-at":1355523910000,"updated-at":1360760950000,"_id":"542692d3c026201cdc326fe7"}],"macro":true,"notes":null,"arglists":["& colls"],"doc":"Expands to code which yields a lazy sequence of the concatenation\n of the supplied colls. Each coll expr is not evaluated until it is\n needed. \n\n (lazy-cat xs ys zs) === (concat (lazy-seq xs) (lazy-seq ys) (lazy-seq zs))","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/lazy-cat"},{"added":"1.0","ns":"clojure.core","name":"comment","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":null,"line":4760,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; The commented forms do not get executed\nuser=\u003E (comment\n (functioncall-1)\n (functioncall-2))\nnil","created-at":1279395666000,"updated-at":1285500093000,"_id":"542692cac026201cdc326b64"}],"macro":true,"notes":[{"updated-at":1389835580000,"body":"it doesn't 100% ignore the body. If your comment has a map in it, for example, and that map isn't 100% correct it will fail to compile in some environments. I found that using Light Table. I am certain it would fail on other platforms that won't know to exclude it before parsing.\r\n\r\nExample:\r\n(comment\r\n here is some TeX: \\frac{\\sum_{m=1}^{m}x_{m}}{x_{s}}\r\n)\r\n\r\nThat will produce an error.","created-at":1389835580000,"author":{"login":"Pete","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8e398ff59e0c0073ccb6770938de769e?r=PG&default=identicon"},"_id":"542692edf6e94c6970522019"}],"arglists":["& body"],"doc":"Ignores body, yields nil","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/comment"},{"added":"1.12","ns":"clojure.core","name":"*repl*","file":"clojure/core.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":6365,"examples":null,"notes":null,"arglists":[],"doc":"Bound to true in a repl thread","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/*repl*"},{"added":"1.0","ns":"clojure.core","name":"parents","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1341101519000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"descendants","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521be0"},{"created-at":1341101522000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ancestors","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521be1"},{"created-at":1341101538000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"derive","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521be2"},{"created-at":1341101540000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"underive","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521be3"},{"created-at":1341101544000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"make-hierarchy","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521be4"},{"created-at":1341101631000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"isa?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521be5"}],"line":5638,"examples":[{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[],"body":";; simple example showing single parented derivation\n;; then adding another parent\n\nuser=\u003E (derive ::toy_poodle ::poodle)\nnil\nuser=\u003E (parents ::toy_poodle)\n#{:user/poodle}\nuser=\u003E (derive ::toy_poodle ::toy_dogs)\nnil\nuser=\u003E (parents ::toy_poodle)\n#{:user/poodle :user/toy_dogs}\nuser=\u003E","created-at":1313967813000,"updated-at":1313967813000,"_id":"542692cbc026201cdc326bde"}],"notes":null,"arglists":["tag","h tag"],"doc":"Returns the immediate parents of tag, either via a Java type\n inheritance relationship or a relationship established via derive. h\n must be a hierarchy obtained from make-hierarchy, if not supplied\n defaults to the global hierarchy","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/parents"},{"added":"1.0","ns":"clojure.core","name":"count","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":876,"examples":[{"author":{"login":"MrHus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4fa262299223e58030e9062d97224547?r=PG&default=identicon"},"editors":[{"login":"matthewg","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b29dd31d183124d9e87d8037bb30e326?r=PG&default=identicon"}],"body":"user=\u003E (count nil)\n0\n\nuser=\u003E (count [])\n0\n\nuser=\u003E (count [1 2 3])\n3\n\nuser=\u003E (count {:one 1 :two 2})\n2\n\nuser=\u003E (count [1 \\a \"string\" [1 2] {:foo :bar}])\n5\n\nuser=\u003E (count \"string\")\n6","created-at":1279416590000,"updated-at":1323235681000,"_id":"542692cbc026201cdc326bf9"},{"author":{"login":"rquinn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b3f3b40ea11b41b503df93d8b4a17043?r=PG&default=identicon"},"editors":[{"login":"Noneo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e66c8f6c768e29808bddd38ed2f21349?r=PG&default=identicon"}],"body":"user=\u003E (= (count '(1 2 3 3 1)) 5)\ntrue","created-at":1389437673000,"updated-at":1390502201000,"_id":"542692d2c026201cdc326f75"}],"notes":null,"arglists":["coll"],"doc":"Returns the number of items in the collection. (count nil) returns\n 0. Also works on strings, arrays, and Java Collections and Maps","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/count"},{"added":"1.0","ns":"clojure.core","name":"supers","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1285511319000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"type","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d64"},{"created-at":1285513946000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"instance?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d65"},{"created-at":1307530958000,"author":{"login":"stand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d7f9ed2753f8b3517f1539f6129f0a17?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"bases","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d66"},{"created-at":1374150792000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ancestors","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d67"}],"line":5606,"examples":[{"author":{"login":"stand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d7f9ed2753f8b3517f1539f6129f0a17?r=PG&default=identicon"},"editors":[],"body":";;find superclasses and interfaces of Java objects...\nuser\u003E (supers Object)\nnil\n\nuser\u003E (supers String)\n#{java.lang.Comparable java.lang.CharSequence java.io.Serializable java.lang.Object}\n\n;;...or Java interfaces\nuser\u003E (supers javax.naming.Name)\n#{java.lang.Cloneable java.lang.Comparable java.io.Serializable}\n\n;;Also with clojure types...\nuser\u003E (defrecord MyThing [a b c])\nuser.MyThing\n\nuser\u003E (supers MyThing)\n#{clojure.lang.Counted java.lang.Iterable clojure.lang.IKeywordLookup clojure.lang.IObj clojure.lang.IPersistentMap clojure.lang.Associative clojure.lang.Seqable java.util.Map clojure.lang.IMeta java.io.Serializable java.lang.Object clojure.lang.IPersistentCollection clojure.lang.ILookup}\n","created-at":1307530922000,"updated-at":1307530922000,"_id":"542692cdc026201cdc326cce"}],"notes":null,"arglists":["class"],"doc":"Returns the immediate and indirect superclasses and interfaces of c, if any","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/supers"},{"ns":"clojure.core","name":"*fn-loader*","type":"var","see-alsos":null,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core/*fn-loader*"},{"added":"1.0","ns":"clojure.core","name":"sorted-map-by","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1281961885000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"sorted-map","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e6b"},{"created-at":1330671660000,"author":{"login":"Chouser","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7a0192050ed6488670acfd3f59405c10?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"subseq","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e6c"},{"created-at":1330671664000,"author":{"login":"Chouser","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7a0192050ed6488670acfd3f59405c10?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"rsubseq","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e6d"},{"created-at":1353458254000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"sorted-set-by","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e6e"}],"line":409,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[],"body":"user\u003E (sorted-map-by \u003E 1 \"a\", 2 \"b\", 3 \"c\")\n{3 \"c\", 2 \"b\", 1 \"a\"}","created-at":1286955811000,"updated-at":1286955811000,"_id":"542692cac026201cdc326b5e"},{"author":{"login":"defiantt","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/24b2f585e6df92df9885e37b3b285c43?r=PG&default=identicon"},"editors":[{"login":"defiantt","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/24b2f585e6df92df9885e37b3b285c43?r=PG&default=identicon"}],"body":";; If you wish to sort the map according to the values, instead of by keys \n;; the following code WILL NOT WORK! This is because the map values are not unique.\n\nuser=\u003E (let [results {:A 1 :B 2 :C 2 :D 5 :E 1 :F 1}]\n (into (sorted-map-by (fn [key1 key2]\n (compare (get results key2)\n (get results key1))))\n results))\n\n=\u003E {:D 5, :C 2, :A 1}\n\n;; To make sure that the sorting works, we can make sure that the comparator \n;; works on unique values\n\nuser=\u003E (let [results {:A 1 :B 2 :C 2 :D 5 :E 1 :F 1}]\n (into (sorted-map-by (fn [key1 key2]\n (compare [(get results key2) key2]\n [(get results key1) key1])))\n results))\n\n=\u003E {:D 5, :C 2, :B 2, :F 1, :E 1, :A 1}","created-at":1331260029000,"updated-at":1331260095000,"_id":"542692d5c026201cdc327094"}],"notes":null,"arglists":["comparator & keyvals"],"doc":"keyval =\u003E key val\n Returns a new sorted map with supplied mappings, using the supplied\n comparator. If any keys are equal, they are handled as if by\n repeated uses of assoc.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/sorted-map-by"},{"added":"1.0","ns":"clojure.core","name":"apply","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1285116731000,"author":{"login":"gregg-williams","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/58610a64fc8638eec8d2239d80d4046f?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"map","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521eae"},{"created-at":1289278196000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"eval","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521eaf"},{"created-at":1289278244000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.template","name":"apply-template","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521eb1"},{"created-at":1411938673196,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.core","name":"reduce","library-url":"https://github.com/clojure/clojure"},"_id":"54287971e4b0ba57bdbcf25f"}],"line":662,"examples":[{"author":{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},"editors":[{"login":"gregg-williams","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/58610a64fc8638eec8d2239d80d4046f?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (def *strings* [\"str1\" \"str2\" \"str3\"])\n#'user/*strings*\n\n;; Oops!\nuser=\u003E (str *strings*)\n\"[\\\"str1\\\" \\\"str2\\\" \\\"str3\\\"]\"\n\n;; Yay!\nuser=\u003E (apply str *strings*)\n\"str1str2str3\"\nuser=\u003E\n\n;; Note the equivalence of the following two forms\nuser=\u003E (apply str [\"str1\" \"str2\" \"str3\"])\n\"str1str2str3\"\n\nuser=\u003E (str \"str1\" \"str2\" \"str3\")\n\"str1str2str3\"\n","created-at":1279062643000,"updated-at":1285485406000,"_id":"542692cdc026201cdc326d46"},{"author":{"login":"Jacolyte","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1703a0c3ed358b787f4b1bf3b2799472?r=PG&default=identicon"},"editors":[{"login":"gregg-williams","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/58610a64fc8638eec8d2239d80d4046f?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; If you were to try\nuser=\u003E (max [1 2 3])\n[1 2 3]\n\n;; You would get '[1 2 3]' for the result. In this case, 'max' has received one\n;; vector argument, and the largest of its arguments is that single vector.\n\n;; If you would like to find the largest item **within** the vector, you would need\n;; to use `apply`\n\nuser=\u003E (apply max [1 2 3])\n3\n\n;; which is the same as (max 1 2 3)\n","created-at":1280207658000,"updated-at":1288871102000,"_id":"542692cdc026201cdc326d49"},{"author":{"login":"gregg-williams","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/58610a64fc8638eec8d2239d80d4046f?r=PG&default=identicon"},"editors":[{"login":"gregg-williams","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/58610a64fc8638eec8d2239d80d4046f?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; Here's an example that uses the optional second argument, args:\n\nuser=\u003E (apply map vector [[:a :b] [:c :d]])\n([:a :c] [:b :d])\n\n;; In this example, 'f' = 'map', 'args' = 'vector', and argseq = '[:a :b] [:c :d]',\n;; making the above code equivalent to\n\nuser=\u003E (map vector [:a :b] [:c :d])\n([:a :c] [:b :d]) ;Same answer as above\n\n;; It might help to think of 'map' and 'vector' \"slipping inside\" the argument list\n;; ( '[[:a :b] [:c :d]]' ) to give '[map vector [:a :b] [:c :d]]' , which then \n;; becomes the executable form '(map vector [:a :b] [:c :d])' .","created-at":1285120582000,"updated-at":1285485696000,"_id":"542692cdc026201cdc326d4d"},{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[],"body":";; only functions can be used with apply. 'and' is a macro\n;; because it needs to evaluate its arguments lazily and so\n;; does not work with apply.\nuser=\u003E (apply and (list true true false true)\n\n-\u003E ERROR\n\n","created-at":1288763486000,"updated-at":1288763486000,"_id":"542692cdc026201cdc326d50"},{"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"editors":[{"login":"jasonrudolph.com","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c4e34ac0818591402a41b2e9cfb4747b?r=PG&default=identicon"}],"body":";apply is used to apply an operator to its operands. \n\n(apply + '(1 2)) ; equal to (+ 1 2)\n=\u003E 3\n\n\n;you can also put operands before the list of operands and they'll be consumed in the list of operands\n\n(apply + 1 2 '(3 4)) ; equal to (apply + '(1 2 3 4))\n=\u003E 10","created-at":1289278192000,"updated-at":1322347021000,"_id":"542692cdc026201cdc326d51"},{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[],"body":";; You can use map and apply together to drill one level deep in a collection\n;; of collections, in this case returning a collection of the max of each\n;; nested collection\n\nuser=\u003E (map #(apply max %) [[1 2 3][4 5 6][7 8 9]])\n(3 6 9)","created-at":1310850474000,"updated-at":1310850474000,"_id":"542692cdc026201cdc326d53"},{"author":{"login":"Jeff Terrell","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/658b2643cf2a8192286b5bb1ecb62cf8?r=PG&default=identicon"},"editors":[],"body":";; Using `apply` with optional keyword parameters:\n\n(defn add2 [a & {:keys [plus] :or {plus 0}}]\n (+ 2 plus a))\n\n(add2 4) ; =\u003E 6\n(add2 4 :plus 1) ; =\u003E 7\n(apply add2 [4]) ; =\u003E 6\n(apply add2 [4 {:plus 1}]) ; =\u003E IllegalArgumentException\n(apply add2 [4 :plus 1]) ; =\u003E 7\n","created-at":1409438218000,"updated-at":1409438218000,"_id":"542692d2c026201cdc326f4a"}],"notes":null,"arglists":["f args","f x args","f x y args","f x y z args","f a b c d & args"],"doc":"Applies fn f to the argument list formed by prepending intervening arguments to args.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/apply"},{"added":"1.0","ns":"clojure.core","name":"interpose","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1293096431000,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.core","name":"interleave","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bbb"},{"created-at":1334733658000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.string","name":"join","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bbc"}],"line":5259,"examples":[{"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"editors":[{"login":"philos99","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1de5617efb013ca7c9cf8e5646818ffa?r=PG&default=identicon"},{"login":"Iceland_jack","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c889e0a95a3bb07f90ab28ad442f1127?r=PG&default=identicon"},{"login":"Iceland_jack","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c889e0a95a3bb07f90ab28ad442f1127?r=PG&default=identicon"},{"login":"Iceland_jack","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c889e0a95a3bb07f90ab28ad442f1127?r=PG&default=identicon"},{"login":"Iceland_jack","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c889e0a95a3bb07f90ab28ad442f1127?r=PG&default=identicon"}],"body":";; The quintessential interpose example:\nuser\u003E (def my-strings [\"one\" \"two\" \"three\"])\n\nuser\u003E (interpose \", \" my-strings)\n=\u003E (\"one\" \", \" \"two\" \", \" \"three\")\n\nuser\u003E (apply str (interpose \", \" my-strings))\n=\u003E \"one, two, three\"\n\n;; Might use clojure.string/join if the plan is to join\n(use '[clojure.string :only (join)])\nuser\u003E (join \", \" my-strings)\n=\u003E \"one, two, three\"","created-at":1278174751000,"updated-at":1338784527000,"_id":"542692cdc026201cdc326d31"},{"author":{"login":"octopusgrabbus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fd31b8bcea99fa7b0711fbc424587774?r=PG&default=identicon"},"editors":[{"login":"octopusgrabbus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fd31b8bcea99fa7b0711fbc424587774?r=PG&default=identicon"},{"login":"octopusgrabbus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fd31b8bcea99fa7b0711fbc424587774?r=PG&default=identicon"},{"login":"octopusgrabbus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fd31b8bcea99fa7b0711fbc424587774?r=PG&default=identicon"},{"login":"octopusgrabbus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fd31b8bcea99fa7b0711fbc424587774?r=PG&default=identicon"}],"body":";This example converts what would be comma-separated values into pipe '|' ;separated values for alternate database loads. By switching delimiters, \n;quotes can be eliminated from each sequence element, which are not \n;needed for some databases.\n\n(def test-data-in '((\"9990999\" \"43\" \"ROADWAY\" \"MORRISON, VAN X DMD\" \"43 ROADWAY\" \"SOMETHINGTON\" \"XA\" \"00000\" \"501\" \"18050\" \"2500\" \"1180\" \"14370\" \"0\") (\"9990998\" \"25\" \"GARDEN PATH\" \"JANE SMITH N\" \"25 GARDEN PATH\" \"SOMETHINGTON\" \"ZA\" \"00000\" \"501\" \"1120\" \"600\" \"80\" \"440\" \"0\"))\n\n(def test-data-out (map #(concat (interpose \\| %) (list \\| \"\\n\")) d2))\n\ntest-data-out\n\n((\"9990999\" \\| \"43\" \\| \"ROADWAY\" \\| \"MORRISON, VAN X DMD\" \\| \"43 ROADWAY\" \\| \"SOMETHINGTON\" \\| \"ZA\" \\| \"00000\" \\| \"501\" \\| \"18050\" \\| \"2500\" \\| \"1180\" \\| \"14370\" \\| \"0\" \\| \"\\n\") (\"9990998\" \\| \"25\" \\| \"GARDEN PATH\" \\| \"JANE SMITH N\" \\| \"25 GARDEN PATH\" \\| \"SOMETHINGTON\" \\| \"ZA\" \\| \"00000\" \\| \"501\" \\| \"1120\" \\| \"600\" \\| \"80\" \\| \"440\" \\| \"0\" \\| \"\\n\"))\n\n(doseq [in-seq d3] (doseq [val in-seq] (spit \"temp1.csv\" val :append true)))\n\ncat temp1.csv\n\n9990999|43|ROADWAY|MORRISON VAN X DMD|43 ROADWAY|SOMETHINGTON|ZA|00000|501|18050|2500|1180|14370|0|\n9990998|25|GARDEN PATH|JANE SMITH N N|25 GARDEN PATH|SOMETHINGTON|A|00000|501|1120|600|80|440|0|\n","created-at":1352930917000,"updated-at":1352931088000,"_id":"542692d3c026201cdc326fd3"}],"notes":null,"arglists":["sep","sep coll"],"doc":"Returns a lazy seq of the elements of coll separated by sep.\n Returns a stateful transducer when no collection is provided.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/interpose"},{"added":"1.0","ns":"clojure.core","name":"deref","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1343082385000,"author":{"login":"john.r.woodward","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/22b6fbc4a386291e45b1cb4449377086?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"atom","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e70"},{"created-at":1343082392000,"author":{"login":"john.r.woodward","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/22b6fbc4a386291e45b1cb4449377086?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"agent","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e71"},{"created-at":1343082402000,"author":{"login":"john.r.woodward","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/22b6fbc4a386291e45b1cb4449377086?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ref","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e72"}],"line":2323,"examples":[{"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (def a (atom 0))\n#'user/a\nuser=\u003E @a\n0\nuser=\u003E (deref a)\n0\n\nuser=\u003E (def b (ref 1))\n#'user/b\nuser=\u003E @b\n1\nuser=\u003E (deref b)\n1\n\nuser=\u003E (def c (agent 2))\n#'user/c\nuser=\u003E @c\n2\nuser=\u003E (deref c)\n2\n\nuser=\u003E (def d (future 3))\n#'user/d\nuser=\u003E @d\n3\nuser=\u003E (deref d)\n3","created-at":1280548071000,"updated-at":1332951465000,"_id":"542692c8c026201cdc326a12"}],"notes":null,"arglists":["ref","ref timeout-ms timeout-val"],"doc":"Also reader macro: @ref/@agent/@var/@atom/@delay/@future/@promise. Within a transaction,\n returns the in-transaction-value of ref, else returns the\n most-recently-committed value of ref. When applied to a var, agent\n or atom, returns its current state. When applied to a delay, forces\n it if not already forced. When applied to a future, will block if\n computation not complete. When applied to a promise, will block\n until a value is delivered. The variant taking a timeout can be\n used for blocking references (futures and promises), and will return\n timeout-val if the timeout (in milliseconds) is reached before a\n value is available. See also - realized?.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/deref"},{"added":"1.11","ns":"clojure.core","name":"parse-boolean","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":8203,"examples":null,"notes":null,"arglists":["s"],"doc":"Parse strings \"true\" or \"false\" and return a boolean, or nil if invalid","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/parse-boolean"},{"added":"1.0","ns":"clojure.core","name":"assoc","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1291975387000,"author":{"login":"alimoeeny","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e8dd06976ead4082d2181f3807117e1?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"assoc-in","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ef1"},{"created-at":1295211937000,"author":{"login":"pauldoo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5cb916d3c8abc9f45a093209e72489fb?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"dissoc","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ef2"},{"created-at":1320356554000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"merge","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ef3"}],"line":183,"examples":[{"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"franks42","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b3ee701dd6c481e5d310467ddfe62c48?r=PG&default=identicon"},{"login":"MikeT","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/497a50e2eb50bb7a8dbb839adc473f1f?r=PG&default=identicon"}],"body":"user=\u003E (assoc {} :key1 \"value\" :key2 \"another value\")\n{:key2 \"another value\", :key1 \"value\"}\n\nuser=\u003E (assoc {:key1 \"old value1\" :key2 \"value2\"} :key1 \"value1\" :key3 \"value3\")\n{:key3 \"value3\", :key2 \"value2\", :key1 \"value1\"}\n\nuser=\u003E (assoc nil :key1 4)\n{:key1 4}\n\nuser=\u003E (assoc [1 2 3] 0 10)\n[10 2 3]\n\nuser=\u003E (assoc [1 2 3] 3 10)\n[1 2 3 10]\n\nuser=\u003E (assoc [1 2 3] 4 10)\njava.lang.IndexOutOfBoundsException (NO_SOURCE_FILE:0)\n\n\n\n\n;; From http://clojure-examples.appspot.com/clojure.core/assoc","created-at":1278953718000,"updated-at":1392735118000,"_id":"542692c9c026201cdc326acd"},{"author":{"login":"octopusgrabbus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fd31b8bcea99fa7b0711fbc424587774?r=PG&default=identicon"},"editors":[],"body":"(def test-map {:account-no 12345678 :lname \"Jones\" :fnam \"Fred\"})\n(assoc test-map :fnam \"Sue\")\n{:account-no 12345678, :lname \"Jones\", :fnam \"Sue\"}","created-at":1366772136000,"updated-at":1366772136000,"_id":"542692d2c026201cdc326f4b"}],"notes":[{"updated-at":1352836452000,"body":"Here is a version that will create a vector when the key is numerical.\r\nThis may be useful instead of throwing an IndexOutOfBoundsException.\r\n\r\n\u003Cpre\u003E\r\n(defn assoc-in-idx [m [k & ks] v]\r\n (let [value (get m k (when (number? (first ks)) []))\r\n\tm (if (and (vector? m) (number? k) (-\u003E m count (\u003C k)))\r\n\t (reduce (fn [m _] (conj m nil)) m (range (count m) k))\r\n\t m)\r\n\tv (if ks\r\n\t (assoc-in-idx value ks v)\r\n\t v)]\r\n (assoc m k v)))\r\n\u003C/pre\u003E\r\n","created-at":1352836452000,"author":{"login":"l0st3d","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cc23d1f40d9cfa1c5015ea972759cbf4?r=PG&default=identicon"},"_id":"542692edf6e94c6970521ff4"},{"updated-at":1378937381000,"body":"the API is blurry When applied to a vector\r\n\r\n\u003Cpre\u003E\r\n;; should indicate following\r\n(assoc vector index val) \u003C/pre\u003E","created-at":1378937381000,"author":{"login":"simlegate","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/313f9e3c2c4d3492222c1efd2fd955a4?r=PG&default=identicon"},"_id":"542692edf6e94c697052200b"}],"arglists":["map key val","map key val & kvs"],"doc":"assoc[iate]. When applied to a map, returns a new map of the\n same (hashed/sorted) type, that contains the mapping of key(s) to\n val(s). When applied to a vector, returns a new vector that\n contains val at index. Note - index must be \u003C= (count vector).","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/assoc"},{"added":"1.0","ns":"clojure.core","name":"rational?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":3638,"examples":[{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (rational? 1)\ntrue\nuser=\u003E (rational? 1.0)\nfalse\nuser=\u003E (class 1.0)\njava.lang.Double\n\n;; Note that decimal? only returns true if n is a BigDecimal.","created-at":1279074804000,"updated-at":1285501218000,"_id":"542692cec026201cdc326dc9"}],"notes":null,"arglists":["n"],"doc":"Returns true if n is a rational number","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/rational_q"},{"added":"1.1","ns":"clojure.core","name":"transient","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1286870150000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"persistent!","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521da8"},{"created-at":1286870156000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"conj!","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521da9"},{"created-at":1321399323000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"assoc!","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521daa"},{"created-at":1321399624000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"pop!","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dab"},{"created-at":1324959569000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"dissoc!","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dac"},{"created-at":1358908056000,"author":{"login":"jjcomer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ef581bba2f97adb539c67a35465b3e1b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"disj!","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dad"}],"line":3360,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[],"body":";; As seen on http://clojure.org/transients\n;; array is initially made transient, modified then\n;; finally made persistent.\n\n(defn vrange2 [n]\n (loop [i 0 v (transient [])]\n (if (\u003C i n)\n (recur (inc i) (conj! v i))\n (persistent! v))))\n\nuser=\u003E (vrange2 10)\n[0 1 2 3 4 5 6 7 8 9]","created-at":1286870136000,"updated-at":1286870136000,"_id":"542692cbc026201cdc326bb5"},{"author":{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"},"editors":[{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"},{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user\u003E (def foo (transient [1 2 3]))\n#'user/foo\nuser\u003E (get foo 0)\n1\nuser\u003E (count foo)\n3\nuser\u003E (nth foo 0)\n1\nuser\u003E (def bar (transient {:honda 7 :kagawa 23 :ienaga 14}))\n#'user/bar\nuser\u003E (get bar :kagawa)\n23\nuser\u003E (count bar)\n3\n\n;; There is a known bug in Clojure 1.3 where contains? always returns false for\n;; transients. http://dev.clojure.org/jira/browse/CLJ-700\n;; contains? works fine for persistent data structures.\nuser\u003E (contains? bar :kagawa) ; Caution! \nfalse\nuser\u003E (def bar2 (persistent! bar))\n#'user/bar2\nuser\u003E (contains? bar2 :kagawa) ; Caution!\ntrue\n","created-at":1307738808000,"updated-at":1330060674000,"_id":"542692cbc026201cdc326bb6"}],"notes":null,"arglists":["coll"],"doc":"Returns a new, transient version of the collection, in constant time.\n\n Transients support a parallel set of 'changing' operations, with similar names\n followed by ! - assoc!, conj! etc. These do the same things as their persistent\n counterparts except the return values are themselves transient.\n\n Note in particular that transients are not designed to be bashed in-place. You\n must capture and use the return value in the next call. In this way, they support\n the same code structure as the functional persistent code they replace.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/transient"},{"added":"1.0","ns":"clojure.core","name":"clojure-version","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":7229,"examples":[{"author":{"login":"mattdw","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ee24aacb65359196b0a1bad050f9a62f?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (clojure-version)\n\"1.2.0-master-SNAPSHOT\"","created-at":1280323117000,"updated-at":1332951038000,"_id":"542692cec026201cdc326da5"}],"notes":null,"arglists":[""],"doc":"Returns clojure version as a printable string.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/clojure-version"},{"ns":"clojure.core","name":"chunk-cons","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":712,"examples":null,"notes":null,"arglists":["chunk rest"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core/chunk-cons"},{"added":"1.0","ns":"clojure.core","name":"comparator","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":3102,"examples":[{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[{"login":"Chouser","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7a0192050ed6488670acfd3f59405c10?r=PG&default=identicon"}],"body":";; simple example to create an ArrayList, initially [1,2,0]\n;; and sort it in descending order\n\nuser=\u003E (def a (new java.util.ArrayList [1 2 0]))\n#'user/a\nuser=\u003E (def compx (comparator (fn [x y] (\u003E x y))))\n#'user/compx\nuser=\u003E (java.util.Collections/sort a compx)\nnil\nuser=\u003E a\n#\u003CArrayList [2, 1, 0]\u003E\n\n;; Note however that 'comparator' is rarely (never?) needed because if\n;; the fn returns a boolean, the .compare implementation Clojure provides\n;; causes it to behave the same as if 'comparator' were wrapped around it:\n\n(sort (comparator (fn [x y] (\u003E x y))) [1 2 0]) ;=\u003E (2 1 0)\n(sort (fn [x y] (\u003E x y)) [1 2 0]) ;=\u003E (2 1 0)\n(sort \u003E [1 2 0]) ;=\u003E (2 1 0)\n(sort \u003C [1 2 0]) ;=\u003E (0 1 2)","created-at":1313490576000,"updated-at":1345156531000,"_id":"542692cdc026201cdc326cfd"}],"notes":null,"arglists":["pred"],"doc":"Returns an implementation of java.util.Comparator based upon pred.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/comparator"},{"added":"1.0","ns":"clojure.core","name":"sorted-map","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1281961873000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"sorted-map-by","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cbd"},{"created-at":1330671636000,"author":{"login":"Chouser","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7a0192050ed6488670acfd3f59405c10?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"subseq","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cbe"},{"created-at":1330671641000,"author":{"login":"Chouser","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7a0192050ed6488670acfd3f59405c10?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"rsubseq","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cbf"},{"created-at":1330671776000,"author":{"login":"Chouser","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7a0192050ed6488670acfd3f59405c10?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"sorted-set","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cc0"},{"created-at":1397669012000,"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"array-map","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cc1"},{"created-at":1397669018000,"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"hash-map","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cc2"}],"line":400,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"clojureking","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/92625b8a6be91bb8c688d0d07b4e2a32?r=PG&default=identicon"},{"login":"clojureking","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/92625b8a6be91bb8c688d0d07b4e2a32?r=PG&default=identicon"},{"login":"clojureking","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/92625b8a6be91bb8c688d0d07b4e2a32?r=PG&default=identicon"}],"body":"user=\u003E (sorted-map :z 1, :b 2, :a 3)\n{:a 3, :b 2, :z 1}\n\nuser=\u003E (into (sorted-map) {:b 2 :a 1})\n{:a 1, :b 2}","created-at":1280746350000,"updated-at":1409355285000,"_id":"542692c6c026201cdc3268c0"}],"notes":null,"arglists":["& keyvals"],"doc":"keyval =\u003E key val\n Returns a new sorted map with supplied mappings. If any keys are\n equal, they are handled as if by repeated uses of assoc.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/sorted-map"},{"added":"1.0","ns":"clojure.core","name":"send","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1282635091000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"shutdown-agents","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d0a"},{"created-at":1282635102000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"send-off","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d0b"},{"created-at":1282635125000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"agent","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d0c"}],"line":2128,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (def my-agent (agent 100))\n#'user/my-agent\nuser=\u003E @my-agent\n100\n\n;; Note the following happens asynchronously in a thread\n;; pool\nuser=\u003E (send my-agent + 100)\n#\u003CAgent@5afc0f5: 200\u003E\n\n;; Assuming the addition has completed the value will\n;; now be updated when we look at it.\nuser=\u003E @my-agent\n200","created-at":1282635077000,"updated-at":1332951644000,"_id":"542692cbc026201cdc326bf5"}],"notes":null,"arglists":["a f & args"],"doc":"Dispatch an action to an agent. Returns the agent immediately.\n Subsequently, in a thread from a thread pool, the state of the agent\n will be set to the value of:\n\n (apply action-fn state-of-agent args)","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/send"},{"added":"1.0","ns":"clojure.core","name":"drop-while","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1301365967000,"author":{"login":"pauldoo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5cb916d3c8abc9f45a093209e72489fb?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"take-while","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e46"},{"created-at":1347077852000,"author":{"login":"dansalmo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e33ee460f5f61bc5ba9b598934766215?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"split-with","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e47"}],"line":2975,"examples":[{"author":{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":";; Note: Documentation should be \"starting from the first item for which\n;; (pred item) returns logical false, i.e. either of the values false or nil.\n\nuser=\u003E (drop-while neg? [-1 -2 -6 -7 1 2 3 4 -5 -6 0 1])\n(1 2 3 4 -5 -6 0 1)\n","created-at":1279378804000,"updated-at":1331882398000,"_id":"542692cfc026201cdc326e45"}],"notes":[{"updated-at":1280202567000,"body":"The description of this function is throwing me off. I think it should say: returns a sequence of items from `coll` dropping the initial items that evaluate to true when passed to `pred`, once a non-true value is encountered, the rest of the list is returned.","created-at":1280202567000,"author":{"login":"Jacolyte","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1703a0c3ed358b787f4b1bf3b2799472?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521f8c"}],"arglists":["pred","pred coll"],"doc":"Returns a lazy sequence of the items in coll starting from the\n first item for which (pred item) returns logical false. Returns a\n stateful transducer when no collection is provided.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/drop-while"},{"ns":"clojure.core","name":"proxy-call-with-super","file":"clojure/core_proxy.clj","type":"function","column":1,"see-alsos":null,"line":389,"examples":null,"notes":null,"arglists":["call this meth"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core/proxy-call-with-super"},{"added":"1.3","ns":"clojure.core","name":"realized?","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1334256253000,"author":{"login":"tcrawley","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9262893211442b0081f2bcd75bfd47f3?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"promise","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c53"},{"created-at":1334256260000,"author":{"login":"tcrawley","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9262893211442b0081f2bcd75bfd47f3?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"delay","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c54"},{"created-at":1334256266000,"author":{"login":"tcrawley","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9262893211442b0081f2bcd75bfd47f3?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"future","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c55"}],"line":7725,"examples":[{"author":{"login":"neotyk","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/366ff985977b3aab09510bc335cd44a4?r=PG&default=identicon"},"editors":[],"body":";; Create a promise\nuser\u003E (def p (promise))\n#'user/p ; p is our promise\n\n;; Check if was delivered/realized\nuser\u003E (realized? p)\nfalse ; No yet\n\n;; Delivering the promise\nuser\u003E (deliver p 42)\n#\u003Ccore$promise$reify__5727@47122d: 42\u003E\n\n;; Check again if it was delivered\nuser\u003E (realized? p)\ntrue ; Yes!\n\n;; Deref to see what has been delivered\nuser\u003E @p\n42\n\n;; Note that @ is shorthand for deref\nuser\u003E (deref p)\n42","created-at":1329847539000,"updated-at":1329847539000,"_id":"542692d5c026201cdc327063"}],"notes":null,"arglists":["x"],"doc":"Returns true if a value has been produced for a promise, delay, future or lazy sequence.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/realized_q"},{"added":"1.1","ns":"clojure.core","name":"char-array","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1293675171000,"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"into-array","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bd9"},{"created-at":1293675177000,"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"to-array","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bda"},{"created-at":1342917444000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"chars","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bdb"}],"line":5354,"examples":[{"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"editors":[],"body":"user\u003E (char-array \"asdf\")\n#\u003Cchar[] [C@167fc18\u003E\n\nuser\u003E (seq (char-array \"asdf\"))\n(\\a \\s \\d \\f)\n\nuser\u003E (seq (char-array 10))\n(\\^@ \\^@ \\^@ \\^@ \\^@ \\^@ \\^@ \\^@ \\^@ \\^@)","created-at":1293675165000,"updated-at":1293675165000,"_id":"542692c7c026201cdc32698c"}],"notes":null,"arglists":["size-or-seq","size init-val-or-seq"],"doc":"Creates an array of chars","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/char-array"},{"added":"1.0","ns":"clojure.core","name":"resolve","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1289660999000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ns-resolve","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c5e"}],"line":4398,"examples":[{"author":{"login":"jonase","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5e0b0bd287633db6fccf32a2aa5efd42?r=PG&default=identicon"},"editors":[{"login":"jonase","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5e0b0bd287633db6fccf32a2aa5efd42?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E ((-\u003E \"first\" symbol resolve) [1 2 3])\n1","created-at":1280971203000,"updated-at":1332950641000,"_id":"542692cdc026201cdc326cde"},{"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"editors":[],"body":";; See also http://clojure.org/namespaces for information on namespaces in Clojure and how to inspect and manipulate them","created-at":1348479395000,"updated-at":1348479395000,"_id":"542692d5c026201cdc327074"}],"notes":null,"arglists":["sym","env sym"],"doc":"same as (ns-resolve *ns* symbol) or (ns-resolve *ns* &env symbol)","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/resolve"},{"added":"1.0","ns":"clojure.core","name":"compare","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1361334293000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"sort-by","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e7f"},{"created-at":1361334307000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"sorted-set-by","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e80"},{"created-at":1361334315000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"sorted-map-by","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e81"}],"line":833,"examples":[{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"}],"body":";; various examples\n;; comparing vectors of different sizes does not work as you may expect\n;; the longer vector is always \"greater\" regardless of contents \n\nuser=\u003E (compare [0 1 2] [0 1 2])\n0\nuser=\u003E (compare [1 2 3] [0 1 2 3])\n-1\nuser=\u003E (compare [0 1 2] [3 4])\n1\nuser=\u003E (compare nil [1 2 3])\n-1\nuser=\u003E (compare [1 2 3] nil)\n1\nuser=\u003E (compare \"abc\" \"def\")\n-3\nuser=\u003E (compare \"abc\" \"abd\")\n-1","created-at":1313565230000,"updated-at":1314169796000,"_id":"542692ccc026201cdc326cc6"}],"notes":null,"arglists":["x y"],"doc":"Comparator. Returns a negative number, zero, or a positive number\n when x is logically 'less than', 'equal to', or 'greater than'\n y. Same as Java x.compareTo(y) except it also works for nil, and\n compares numbers and collections in a type-independent manner. x\n must implement Comparable","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/compare"},{"added":"1.0","ns":"clojure.core","name":"complement","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1301366589000,"author":{"login":"pauldoo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5cb916d3c8abc9f45a093209e72489fb?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"not","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b3f"}],"line":1447,"examples":[{"author":{"login":"mattdw","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ee24aacb65359196b0a1bad050f9a62f?r=PG&default=identicon"},"editors":[{"login":"mattdw","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ee24aacb65359196b0a1bad050f9a62f?r=PG&default=identicon"},{"login":"mattdw","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ee24aacb65359196b0a1bad050f9a62f?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; a simple not-empty? predicate\nuser=\u003E (def not-empty? (complement empty?))\n#'user/not-empty?\nuser=\u003E (not-empty? [])\nfalse\nuser=\u003E (not-empty? [1 2])\ntrue\n\n\n;; a slightly more complex example\n;; this function takes two arguments, and sometimes returns nil\n\nuser=\u003E (defn contains-char? [the-string, the-char]\n (some #(= the-char %) the-string))\n#'user/contains-char?\n\nuser=\u003E (contains-char? \"abc\" \\b)\ntrue\nuser=\u003E (contains-char? \"abc\" \\j)\nnil\n\n;; define the complement, to check if a char is absent\nuser=\u003E (def does-not-contain-char? (complement contains-char?))\n#'user/does-not-contain-char?\n\n;; our complement does exactly what we expect\nuser=\u003E (does-not-contain-char? \"abc\" \\b)\nfalse\nuser=\u003E (does-not-contain-char? \"abc\" \\j)\ntrue\n","created-at":1280324273000,"updated-at":1285496658000,"_id":"542692c7c026201cdc3269b7"}],"notes":null,"arglists":["f"],"doc":"Takes a fn f and returns a fn that takes the same arguments as f,\n has the same effects, if any, and returns the opposite truth value.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/complement"},{"added":"1.4","ns":"clojure.core","name":"*compiler-options*","type":"var","see-alsos":null,"examples":null,"notes":null,"arglists":[],"doc":"A map of keys to options.\n Note, when binding dynamically make sure to merge with previous value.\n Supported options:\n :elide-meta - a collection of metadata keys to elide during compilation.\n :disable-locals-clearing - set to true to disable clearing, useful for using a debugger\n :direct-linking - set to true to use direct static invocation of functions, rather than vars\n Note that call sites compiled with direct linking will not be affected by var redefinition.\n Use ^:redef (or ^:dynamic) on a var to prevent direct linking and allow redefinition.\n See https://clojure.org/reference/compilation for more information.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/*compiler-options*"},{"added":"1.0","ns":"clojure.core","name":"*print-dup*","type":"var","see-alsos":null,"examples":[{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"bmillare","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/57126d684344e156ede4592945b54366?r=PG&default=identicon"}],"body":";; `*print-dup*` is very handy when we want to write clojure code/data\n;; to a file to read it in later.\n\n(defn serialize\n \"Print a data structure to a file so that we may read it in later.\"\n [data-structure #^String filename]\n (with-out-writer\n (java.io.File. filename)\n (binding [*print-dup* true] (prn data-structure))))\n\n\n;; This allows us to then read in the structure at a later time, like so:\n(defn deserialize [filename]\n (with-open [r (PushbackReader. (FileReader. filename))]\n (read r)))\n\n\n(def *configuration-options* (deserialize \"config.clj\"))\n\nuser=\u003E *configuration-options*\n{:name \"Fred\", :age \"23\"}\n","created-at":1281149003000,"updated-at":1293075258000,"_id":"542692cec026201cdc326da7"}],"notes":[{"updated-at":1281149184000,"body":"It is sometimes preferable (depending on the size of the structure you're serializing) to wrap the `(with-out-writer ...)` inside a `(dorun (with-out-writer ...) nil)` in order to suppress the output at your REPL.","created-at":1281149184000,"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521f93"},{"updated-at":1293075429000,"body":"Note, I'm making changes to deserialize, there are a few typos.","created-at":1293075226000,"author":{"login":"bmillare","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/57126d684344e156ede4592945b54366?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521faf"}],"arglists":[],"doc":"When set to logical true, objects will be printed in a way that preserves\n their type when read in later.\n\n Defaults to false.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/*print-dup*"},{"added":"1.2","ns":"clojure.core","name":"defrecord","file":"clojure/core_deftype.clj","type":"macro","column":1,"see-alsos":[{"created-at":1289817120000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"deftype","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d16"},{"created-at":1289817125000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"defstruct","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d17"},{"created-at":1289817134000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"defprotocol","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d18"}],"line":314,"examples":[{"author":{"login":"Kototama","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a54a4dc204925d397ca010b9a332e74d?r=PG&default=identicon"},"editors":[{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},{"login":"Ljos","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/45b996a79abca465acaf6c0f10b0437?r=PG&default=identicon"},{"login":"pvesna","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a9e4f72971f946e55c71222a37d8e947?r=PG&default=identicon"}],"body":";; from Stu's examples:\n\n(defrecord Person [fname lname address])\n-\u003E user.Person\n\n(defrecord Address [street city state zip])\n-\u003E user.Address\n\n(def stu (Person. \"Stu\" \"Halloway\"\n (Address. \"200 N Mangum\"\n \"Durham\"\n \"NC\"\n 27701)))\n-\u003E #'user/stu\n\n(:lname stu)\n-\u003E \"Halloway\"\n\n(-\u003E stu :address :city)\n-\u003E \"Durham\"\n\n(assoc stu :fname \"Stuart\")\n-\u003E #:user.Person{:fname \"Stuart\", :lname \"Halloway\", :address #:user.Address{:street \"200 N Mangum\", :city \"Durham\", :state \"NC\", :zip 27701}}\n\n(update-in stu [:address :zip] inc)\n-\u003E #:user.Person{:fname \"Stu\", :lname \"Halloway\", :address #:user.Address{:street \"200 N Mangum\", :city \"Durham\", :state \"NC\", :zip 27702}}","created-at":1286314411000,"updated-at":1359584504000,"_id":"542692c8c026201cdc326a32"},{"author":{"login":"puredanger","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/89c8afd032c7b3473f67c9b00d3acd5a?r=PG&default=identicon"},"editors":[{"login":"puredanger","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/89c8afd032c7b3473f67c9b00d3acd5a?r=PG&default=identicon"},{"login":"puredanger","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/89c8afd032c7b3473f67c9b00d3acd5a?r=PG&default=identicon"},{"login":"steveminer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d28543d134185d12d4006a74738d233e?r=PG&default=identicon"},{"login":"Ljos","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/45b996a79abca465acaf6c0f10b0437?r=PG&default=identicon"},{"login":"pvesna","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a9e4f72971f946e55c71222a37d8e947?r=PG&default=identicon"}],"body":";; This example shows how to implement a Java interface in defrecord.\n;; We'll implement FileNameMap (because it has a simple interface, \n;; not for its real purpose). \n\n(import java.net.FileNameMap)\n-\u003E java.net.FileNameMap\n\n;; Define a record named Thing with a single field a. Implement\n;; FileNameMap interface and provide an implementation for the single\n;; method: String getContentTypeFor(String fileName)\n(defrecord Thing [a]\n FileNameMap\n (getContentTypeFor [this fileName] (str a \"-\" fileName)))\n-\u003E user.Thing\n\n;; construct an instance of the record\n(def thing (Thing. \"foo\"))\n-\u003E #'user/thing\n\n;; check that the instance implements the interface\n(instance? FileNameMap thing)\n-\u003E true\n\n;; get all the interfaces for the record type\n(map #(println %) (.getInterfaces Thing))\n-\u003E java.net.FileNameMap\n-\u003E clojure.lang.IObj\n-\u003E clojure.lang.ILookup\n-\u003E clojure.lang.IKeywordLookup\n-\u003E clojure.lang.IPersistentMap\n-\u003E java.util.Map\n-\u003E java.io.Serializable\n\n;; actually call the method on the thing instance and pass \"bar\"\n(.getContentTypeFor thing \"bar\")\n-\u003E \"foo-bar\"","created-at":1290599788000,"updated-at":1359589207000,"_id":"542692c8c026201cdc326a36"},{"author":{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},"editors":[{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},{"login":"belun","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8d3c423e74750fa42c0386833e4b8209?r=PG&default=identicon"},{"login":"Ljos","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/45b996a79abca465acaf6c0f10b0437?r=PG&default=identicon"}],"body":";; prepare a protocol\nuser=\u003E (defprotocol Fun-Time (drinky-drinky [_]))\nFun-Time\n\n;; define a record and extend the previous protocol, implementing its function\nuser=\u003E (defrecord Someone [nick-name preffered-drink] Fun-Time (drinky-drinky [_] (str nick-name \"(having \" preffered-drink \"): uuumm\")))\nuser.Someone\n;; NOTE how 'nick-name' and 'preffered-drink' are symbols that are not declared anywhere, they are 'provided' inside the function\n\n;; instantiate the protocol once and store it\nuser=\u003E (def dude (-\u003ESomeone \"belun\" \"daiquiri\"))\n#'user/dude\n\n;; use the function defined inside the protocol on the protocol instance\nuser=\u003E (drinky-drinky dude)\n\"belun(having daiquiri): uuumm\"\n\n\n;; courtessy of Howard Lewis Ship - http://java.dzone.com/articles/changes-cascade-and-cautionary","created-at":1317098332000,"updated-at":1354581211000,"_id":"542692d2c026201cdc326f82"},{"author":{"login":"albertcardona","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fea4948490b77a00b8c10bffd792f9d8?r=PG&default=identicon"},"editors":[{"login":"albertcardona","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fea4948490b77a00b8c10bffd792f9d8?r=PG&default=identicon"},{"login":"Ljos","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/45b996a79abca465acaf6c0f10b0437?r=PG&default=identicon"},{"login":"Ljos","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/45b996a79abca465acaf6c0f10b0437?r=PG&default=identicon"}],"body":"; If you define a defrecord in one namespace and want to use it\n; from another, first require the namespace and then import\n; the record as a regular class.\n; The require+import order makes sense if you consider that first\n; the namespace has to be compiled--which generates a class for\n; the record--and then the generated class must be imported.\n; (Thanks to raek in #clojure for the explanations!)\n\n; Namespace 1 in \"my/data.clj\", where a defrecord is declared\n(ns my.data)\n\n(defrecord Employee [name surname])\n\n\n; Namescape 2 in \"my/queries.clj\", where a defrecord is used\n(ns my.queries\n (:require my.data)\n (:import [my.data Employee]))\n\n(println\n \"Employees named Albert:\"\n (filter #(= \"Albert\" (.name %))\n [(Employee. \"Albert\" \"Smith\")\n (Employee. \"John\" \"Maynard\")\n (Employee. \"Albert\" \"Cheng\")]))\n ","created-at":1319420075000,"updated-at":1360699981000,"_id":"542692d2c026201cdc326f87"},{"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"editors":[],"body":";; The map-\u003ERecordclass form works only in Clojure 1.3 or higher\n\n(defrecord Foo [a b])\n\n(defrecord Bar [a b c])\n\n(defrecord Baz [a c])\n\n(def f (Foo. 10 20))\n(println f)\n-\u003E #user.Foo{:a 10, :b 20}\n\n(def r (map-\u003EBar (merge f {:c 30})))\n(println r)\n-\u003E #user.Bar{:a 10, :b 20, :c 30}\n\n(def z (map-\u003EBaz (merge f {:c 30})))\n(println z)\n-\u003E #user.Baz{:a 10, :c 30, :b 20}","created-at":1335392908000,"updated-at":1335392908000,"_id":"542692d2c026201cdc326f8b"}],"macro":true,"notes":[{"updated-at":1302904571000,"body":"http://tech.puredanger.com/2010/11/23/implementing-java-interfaces-with-clojure-records/","created-at":1302904571000,"author":{"login":"Havvy","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e799a79441c7543be48562403411cd13?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fb9"}],"arglists":["name [& fields] & opts+specs"],"doc":"(defrecord name [fields*] options* specs*)\n\n Options are expressed as sequential keywords and arguments (in any order).\n\n Supported options:\n :load-ns - if true, importing the record class will cause the\n namespace in which the record was defined to be loaded.\n Defaults to false.\n\n Each spec consists of a protocol or interface name followed by zero\n or more method bodies:\n\n protocol-or-interface-or-Object\n (methodName [args*] body)*\n\n Dynamically generates compiled bytecode for class with the given\n name, in a package with the same name as the current namespace, the\n given fields, and, optionally, methods for protocols and/or\n interfaces.\n\n The class will have the (immutable) fields named by\n fields, which can have type hints. Protocols/interfaces and methods\n are optional. The only methods that can be supplied are those\n declared in the protocols/interfaces. Note that method bodies are\n not closures, the local environment includes only the named fields,\n and those fields can be accessed directly.\n\n Method definitions take the form:\n\n (methodname [args*] body)\n\n The argument and return types can be hinted on the arg and\n methodname symbols. If not supplied, they will be inferred, so type\n hints should be reserved for disambiguation.\n\n Methods should be supplied for all methods of the desired\n protocol(s) and interface(s). You can also define overrides for\n methods of Object. Note that a parameter must be supplied to\n correspond to the target object ('this' in Java parlance). Thus\n methods for interfaces will take one more argument than do the\n interface declarations. Note also that recur calls to the method\n head should *not* pass the target object, it will be supplied\n automatically and can not be substituted.\n\n In the method bodies, the (unqualified) name can be used to name the\n class (for calls to new, instance? etc).\n\n The class will have implementations of several (clojure.lang)\n interfaces generated automatically: IObj (metadata support) and\n IPersistentMap, and all of their superinterfaces.\n\n In addition, defrecord will define type-and-value-based =,\n and will defined Java .hashCode and .equals consistent with the\n contract for java.util.Map.\n\n When AOT compiling, generates compiled bytecode for a class with the\n given name (a symbol), prepends the current ns as the package, and\n writes the .class file to the *compile-path* directory.\n\n Two constructors will be defined, one taking the designated fields\n followed by a metadata map (nil for none) and an extension field\n map (nil for none), and one taking only the fields (using nil for\n meta and extension fields). Note that the field names __meta,\n __extmap, __hash and __hasheq are currently reserved and should not\n be used when defining your own records.\n\n Given (defrecord TypeName ...), two factory functions will be\n defined: -\u003ETypeName, taking positional parameters for the fields,\n and map-\u003ETypeName, taking a map of keywords to field values.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/defrecord"},{"added":"1.3","ns":"clojure.core","name":"with-redefs-fn","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1322088065000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"with-redefs","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d81"}],"line":7690,"examples":[{"author":{"login":"johnnyluu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1ba99f2dc1064733c7badbb16db9254a?r=PG&default=identicon"},"editors":[{"login":"johnnyluu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1ba99f2dc1064733c7badbb16db9254a?r=PG&default=identicon"},{"login":"avasenin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2918eef190b9952940232b30a4f5541d?r=PG&default=identicon"}],"body":"(ns http)\n\n(defn post [url]\n {:body \"Hello world\"})\n\n(ns app\n (:require [clojure.test :refer [run-tests]]))\n\n(deftest is-a-fn\n (with-redefs-fn {#'http/post (fn [url] {:body \"Hello world again\"})}\n #(is (= {:body \"Hello world again\"} (http/post \"http://service.com/greet\")))))\n\n(run-tests) ;; test is passing","created-at":1350024230000,"updated-at":1352471467000,"_id":"542692d6c026201cdc3270c2"},{"author":{"login":"tonsky","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4188c62c28a196e3e82363217c56fca5?r=PG&default=identicon"},"editors":[],"body":"=\u003E (defn f [] false)\n\n=\u003E (println (f))\n;; false\n\n=\u003E (with-redefs-fn {#'f (fn [] true)} \n #(println (f)))\n;; true","created-at":1352394593000,"updated-at":1352394593000,"_id":"542692d6c026201cdc3270c5"}],"notes":null,"arglists":["binding-map func"],"doc":"Temporarily redefines Vars during a call to func. Each val of\n binding-map will replace the root value of its key which must be\n a Var. After func is called with no args, the root values of all\n the Vars will be set back to their old values. These temporary\n changes will be visible in all threads. Useful for mocking out\n functions during testing.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/with-redefs-fn"},{"added":"1.0","ns":"clojure.core","name":"sequence","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1374149058000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"seq","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521a7e"}],"line":2664,"examples":[{"author":{"login":"yasuto","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cacfb7ecf08cb6461767e514c93b7bf9?r=PG&default=identicon"},"editors":[],"body":"user\u003E (sequence [1 2 3])\n(1 2 3)\nuser\u003E \n(1 2 3)\nuser\u003E (class (sequence '(1 2 3)))\nclojure.lang.PersistentList","created-at":1307740020000,"updated-at":1307740020000,"_id":"542692c8c026201cdc326a16"}],"notes":null,"arglists":["coll","xform coll","xform coll & colls"],"doc":"Coerces coll to a (possibly empty) sequence, if it is not already\n one. Will not force a lazy seq. (sequence nil) yields (), When a\n transducer is supplied, returns a lazy sequence of applications of\n the transform to the items in coll(s), i.e. to the set of first\n items of each coll, followed by the set of second\n items in each coll, until any one of the colls is exhausted. Any\n remaining items in other colls are ignored. The transform should accept\n number-of-colls arguments","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/sequence"},{"added":"1.0","ns":"clojure.core","name":"constantly","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1345605389000,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"repeatedly","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521aa4"}],"line":1459,"examples":[{"author":{"login":"pkolloch","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/10b2fd3c0a4cc46dc241a48468dc551?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (def boring (constantly 10))\n#'user/boring\n\nuser=\u003E (boring 1 2 3)\n10\nuser=\u003E (boring)\n10\nuser=\u003E (boring \"Is anybody home?\")\n10\n","created-at":1282320404000,"updated-at":1285494470000,"_id":"542692cbc026201cdc326c18"},{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[],"body":";; A really goofy way to find the size of a collection\nuser=\u003E (reduce + (map (constantly 1) [:a :b :c]))\n3","created-at":1310850642000,"updated-at":1310850642000,"_id":"542692cbc026201cdc326c1a"},{"author":{"login":"john.r.woodward","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/22b6fbc4a386291e45b1cb4449377086?r=PG&default=identicon"},"editors":[{"login":"donkey","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b1c297c3ac97ef732eb689213c3337b9?r=PG&default=identicon"},{"login":"donkey","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b1c297c3ac97ef732eb689213c3337b9?r=PG&default=identicon"}],"body":";; constantly returns a function which always returns the same value\n(map (constantly 9) [1 2 3])\nuser=\u003E (9 9 9)\n\n(map (constantly (rand-int 100)) [:a :b :c])\nuser=\u003E (43 43 43)","created-at":1342722368000,"updated-at":1345367153000,"_id":"542692d2c026201cdc326f72"}],"notes":[{"updated-at":1291196938000,"body":"any examples of when this would be useful? I think it is weird to want a function that always returns \"x\" regardless of the number of arguments passed to it - however since this exists in core I'm sure it is sensible, more a case of I've not enough experience to appreciate its value.","created-at":1291196938000,"author":{"login":"ossareh","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9d0f447aca573ecf21a45c9272211140?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fa7"},{"updated-at":1292309493000,"body":"I asked about use cases for this function in #clojure and got a good response from amalloy:\r\n\r\nSay you want to call a library function that asks you to pass it a function; it's going to call that function ten times with different arguments to decide how to populate a list it gives you. But your program is really simple and you want the list to just be full of zeroes. So you call:\r\n\r\n (libfn (constantly 0))\r\n\r\nHope that's useful!","created-at":1292309381000,"author":{"login":"clizzin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/555813697e5dc358bb27d5efd3ffa23?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fae"},{"updated-at":1306502622000,"body":"(constantly 1) is often useful when it comes to testing. You can think of it like you would a \"stub\".","created-at":1306502622000,"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fbe"},{"updated-at":1403826661000,"body":"constantly is typically used as an argument to a higher order function when a constant value is needed. ","created-at":1403826661000,"author":{"login":"phreed","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3a0c739cf289be18be932dc3022e6fd3?r=PG&default=identicon"},"_id":"542692edf6e94c697052202b"}],"arglists":["x"],"doc":"Returns a function that takes any number of arguments and returns x.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/constantly"},{"added":"1.0","ns":"clojure.core","name":"get-proxy-class","file":"clojure/core_proxy.clj","type":"function","column":1,"see-alsos":null,"line":281,"examples":null,"notes":null,"arglists":["& bases"],"doc":"Takes an optional single class followed by zero or more\n interfaces. If not supplied class defaults to Object. Creates an\n returns an instance of a proxy class derived from the supplied\n classes. The resulting value is cached and used for any subsequent\n requests for the same class set. Returns a Class object.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/get-proxy-class"},{"added":"1.0","ns":"clojure.core","name":"make-array","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1299713235000,"author":{"login":"sergey","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fbf950615302e00a14bceec914af32ca?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"int-array","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f6c"},{"created-at":1299713241000,"author":{"login":"sergey","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fbf950615302e00a14bceec914af32ca?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"double-array","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f6d"},{"created-at":1299713244000,"author":{"login":"sergey","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fbf950615302e00a14bceec914af32ca?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"float-array","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f6e"},{"created-at":1299713281000,"author":{"login":"sergey","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fbf950615302e00a14bceec914af32ca?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"short-array","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f6f"},{"created-at":1299713289000,"author":{"login":"sergey","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fbf950615302e00a14bceec914af32ca?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"long-array","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f70"},{"created-at":1299713301000,"author":{"login":"sergey","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fbf950615302e00a14bceec914af32ca?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"char-array","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f71"},{"created-at":1299713305000,"author":{"login":"sergey","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fbf950615302e00a14bceec914af32ca?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"byte-array","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f72"},{"created-at":1299713311000,"author":{"login":"sergey","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fbf950615302e00a14bceec914af32ca?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"boolean-array","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f73"},{"created-at":1299713319000,"author":{"login":"sergey","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fbf950615302e00a14bceec914af32ca?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"object-array","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f74"},{"created-at":1299713350000,"author":{"login":"sergey","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fbf950615302e00a14bceec914af32ca?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"to-array","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f75"},{"created-at":1299713355000,"author":{"login":"sergey","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fbf950615302e00a14bceec914af32ca?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"to-array-2d","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f76"},{"created-at":1299713359000,"author":{"login":"sergey","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fbf950615302e00a14bceec914af32ca?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"into-array","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f77"},{"created-at":1299713411000,"author":{"login":"sergey","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fbf950615302e00a14bceec914af32ca?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"aget","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f78"},{"created-at":1299713415000,"author":{"login":"sergey","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fbf950615302e00a14bceec914af32ca?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"aset","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f79"},{"created-at":1299713422000,"author":{"login":"sergey","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fbf950615302e00a14bceec914af32ca?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"alength","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f7a"},{"created-at":1299713425000,"author":{"login":"sergey","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fbf950615302e00a14bceec914af32ca?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"amap","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f7b"},{"created-at":1299713428000,"author":{"login":"sergey","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fbf950615302e00a14bceec914af32ca?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"areduce","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f7c"}],"line":4012,"examples":[{"author":{"login":"sergey","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fbf950615302e00a14bceec914af32ca?r=PG&default=identicon"},"editors":[],"body":"(make-array Integer/TYPE 3)","created-at":1299713202000,"updated-at":1299713202000,"_id":"542692cec026201cdc326dfb"},{"author":{"login":"sergey","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fbf950615302e00a14bceec914af32ca?r=PG&default=identicon"},"editors":[{"login":"kawas44","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fbe17f4245ddacea6f46aaff3b051429?r=PG&default=identicon"}],"body":"user=\u003E (pprint (make-array Double/TYPE 3))\n[0.0, 0.0, 0.0]\n\nuser=\u003E (pprint (make-array Integer/TYPE 2 3))\n[[0, 0, 0], [0, 0, 0]]\n\n\n;; Create an array of Threads, then show content and type\nuser=\u003E (def ar (make-array Thread 3))\n#'user/ar\n\nuser=\u003E (pprint ar)\n[nil, nil, nil]\n\nuser=\u003E (type ar)\n[Ljava.lang.Thread;\n","created-at":1299713210000,"updated-at":1331510349000,"_id":"542692cec026201cdc326dfc"}],"notes":null,"arglists":["type len","type dim & more-dims"],"doc":"Creates and returns an array of instances of the specified class of\n the specified dimension(s). Note that a class object is required.\n Class objects can be obtained by using their imported or\n fully-qualified name. Class objects for the primitive types can be\n obtained using, e.g., Integer/TYPE.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/make-array"},{"added":"1.1","ns":"clojure.core","name":"shorts","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1342917710000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"short-array","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f31"}],"line":5416,"examples":null,"notes":null,"arglists":["xs"],"doc":"Casts to shorts[]","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/shorts"},{"added":"1.7","ns":"clojure.core","name":"completing","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":7000,"examples":null,"notes":null,"arglists":["f","f cf"],"doc":"Takes a reducing function f of 2 args and returns a fn suitable for\n transduce by adding an arity-1 signature that calls cf (default -\n identity) on the result argument.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/completing"},{"added":"1.0","ns":"clojure.core","name":"update-proxy","file":"clojure/core_proxy.clj","type":"function","column":1,"see-alsos":null,"line":313,"examples":[{"author":{"login":"jneira","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2c8ecc24181d171df85a26458b9cd5f?r=PG&default=identicon"},"editors":[],"body":";; from http://groups.google.com/group/clojure/msg/71702435ccd1d189\nuser\u003E (import java.util.Date)\njava.util.Date\n\nuser\u003E (def d (proxy [Date] [] (toString [] \"hello\")))\n#'user/d\n\nuser\u003E d\n#\u003CDate$0 hello\u003E\n\nuser\u003E (.toString d)\n\"hello\"\n\nuser\u003E (.toGMTString d)\n\"17 Nov 2010 12:57:28 GMT\"\n\nuser\u003E (update-proxy d {\"toGMTString\" (fn [this] \"goodbye\")})\nnil\n\nuser\u003E (.toGMTString d)\n\"goodbye\" ","created-at":1290029291000,"updated-at":1290029291000,"_id":"542692cdc026201cdc326d30"}],"notes":null,"arglists":["proxy mappings"],"doc":"Takes a proxy instance and a map of strings (which must\n correspond to methods of the proxy superclass/superinterfaces) to\n fns (which must take arguments matching the corresponding method,\n plus an additional (explicit) first arg corresponding to this, and\n updates (via assoc) the proxy's fn map. nil can be passed instead of\n a fn, in which case the corresponding method will revert to the\n default behavior. Note that this function can be used to update the\n behavior of an existing instance without changing its identity.\n Returns the proxy.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/update-proxy"},{"added":"1.0","ns":"clojure.core","name":"unchecked-negate-int","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":1191,"examples":[{"author":{"login":"Jens","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7f9a46b88f30d9461fea5670fd185f65?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (unchecked-negate-int 4)\n-4\nuser=\u003E (unchecked-negate-int 0)\n0\nuser=\u003E (unchecked-negate-int -7)\n7\nuser=\u003E (unchecked-negate-int Integer/MAX_VALUE)\n-2147483647\nuser=\u003E (unchecked-negate-int Integer/MIN_VALUE) ;overflow\n-2147483648","created-at":1331729438000,"updated-at":1331729438000,"_id":"542692d5c026201cdc3270ae"}],"notes":null,"arglists":["x"],"doc":"Returns the negation of x, an int.\n Note - uses a primitive operator subject to overflow.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/unchecked-negate-int"},{"added":"1.6","ns":"clojure.core","name":"hash-unordered-coll","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":5248,"examples":null,"notes":null,"arglists":["coll"],"doc":"Returns the hash code, consistent with =, for an external unordered\n collection implementing Iterable. For maps, the iterator should\n return map entries whose hash is computed as\n (hash-ordered-coll [k v]).\n See http://clojure.org/data_structures#hash for full algorithms.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/hash-unordered-coll"},{"added":"1.0","ns":"clojure.core","name":"repeat","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1286195040000,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.core","name":"repeatedly","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dae"},{"created-at":1291970208000,"author":{"login":"alimoeeny","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e8dd06976ead4082d2181f3807117e1?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"cycle","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521daf"},{"created-at":1302045956000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"constantly","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521db0"},{"created-at":1327501829000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"dotimes","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521db1"}],"line":3022,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"john.r.woodward","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/22b6fbc4a386291e45b1cb4449377086?r=PG&default=identicon"}],"body":"user=\u003E (take 5 (repeat \"x\"))\n(\"x\" \"x\" \"x\" \"x\" \"x\")\n\n;; which is the same as:\nuser=\u003E (repeat 5 \"x\")\n(\"x\" \"x\" \"x\" \"x\" \"x\")\n\n;; It should be noted that repeat simply repeats the value n number of times.\n;; If you wish to execute a function to calculate the value each time you \n;; probably want the repeatedly function.\n\n","created-at":1279092799000,"updated-at":1343165038000,"_id":"542692c7c026201cdc3269a5"}],"notes":null,"arglists":["x","n x"],"doc":"Returns a lazy (infinite!, or length n if supplied) sequence of xs.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/repeat"},{"added":"1.0","ns":"clojure.core","name":"unchecked-inc","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1289217232000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unchecked-add","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ba9"},{"created-at":1289217236000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unchecked-dec","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521baa"},{"created-at":1289217238000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unchecked-inc","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bab"},{"created-at":1289217241000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unchecked-negate","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bac"},{"created-at":1289217244000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unchecked-divide","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bad"},{"created-at":1289217247000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unchecked-subtract","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bae"},{"created-at":1289217251000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unchecked-multiply","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521baf"},{"created-at":1289217253000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"unchecked-remainder","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bb0"}],"line":1170,"examples":[{"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"editors":[],"body":"users=\u003E (unchecked-inc Integer/MAX_VALUE)\n-2147483648\n\nusers=\u003E (unchecked-inc 0)\n1","created-at":1289217223000,"updated-at":1289217223000,"_id":"542692c8c026201cdc326a14"}],"notes":null,"arglists":["x"],"doc":"Returns a number one greater than x, a long.\n Note - uses a primitive operator subject to overflow.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/unchecked-inc"},{"ns":"clojure.core","name":"*reader-resolver*","type":"var","see-alsos":null,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core/*reader-resolver*"},{"added":"1.0","ns":"clojure.core","name":"nthnext","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1303125684000,"author":{"login":"Havvy","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e799a79441c7543be48562403411cd13?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"nth","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ca9"},{"created-at":1303125696000,"author":{"login":"Havvy","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e799a79441c7543be48562403411cd13?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"drop","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521caa"},{"created-at":1356088874000,"author":{"login":"TimMc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5d532e51427ef2f4ded31aaca16c8baf?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"nthrest","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cab"}],"line":3172,"examples":[{"author":{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (nthnext (range 10) 3)\n(3 4 5 6 7 8 9)\n\nuser=\u003E (nthnext [] 3)\nnil\n\n","created-at":1281033770000,"updated-at":1285495210000,"_id":"542692cec026201cdc326d86"}],"notes":[{"updated-at":1306331938000,"body":"`nthnext` is similar to `drop`.\r\nBut `nthnext` is \u003Ci\u003Eeager\u003C/i\u003E, while `drop` is \u003Ci\u003Elazy\u003C/i\u003E.\u003Cp\u003E\r\nAlso parameters are in opposite order.","created-at":1306324912000,"author":{"login":"Dmitry Kakurin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/85b70be5da433a6adf5112e7140848da?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fbd"}],"arglists":["coll n"],"doc":"Returns the nth next of coll, (seq coll) when n is 0.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/nthnext"},{"added":"1.0","ns":"clojure.core","name":"and","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1286508452000,"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"or","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521eb2"},{"created-at":1334293964000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"if","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521eb3"}],"line":844,"examples":[{"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (and true true)\ntrue\n\nuser=\u003E (and true false)\nfalse\n\nuser=\u003E (and false false)\nfalse\n\nuser=\u003E (and '() '())\n()\n\nuser=\u003E (and '[] '[])\n[]\n\nuser=\u003E (and 0 1) ; Note that this is *not* bitwise 'and'\n1\n\nuser=\u003E (and 1 0)\n0\n\nuser=\u003E (and (constantly true) (\u003E 2 1))\ntrue","created-at":1286508448000,"updated-at":1286508448000,"_id":"542692cdc026201cdc326d0a"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[],"body":";; See examples for \"if\" explaining Clojure's idea of logical true\n;; and logical false.","created-at":1334293968000,"updated-at":1334293968000,"_id":"542692d2c026201cdc326f49"}],"macro":true,"notes":[{"updated-at":1305106125000,"body":"Note \u003Cb\u003Eadd\u003C/b\u003E is a macro, so you cannot \u003Cb\u003Eapply\u003C/b\u003E it. For example, there is a vector of some Boolean values \u003Cb\u003E[true true false true]\u003C/b\u003E, which you want to test to see if they are all true. The code below will not work: \u003Cpre\u003E(apply add [true true false true]) ;won't work\u003C/pre\u003E\r\nInstead, use this: \u003Cpre\u003E(every? identity [true true false true])\u003C/pre\u003E More discussion can be found at http://osdir.com/ml/clojure/2010-01/msg01242.html","created-at":1305106125000,"author":{"login":"huahaiy","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/889685?v=2"},"_id":"542692ecf6e94c6970521fbb"}],"arglists":["","x","x & next"],"doc":"Evaluates exprs one at a time, from left to right. If a form\n returns logical false (nil or false), and returns that value and\n doesn't evaluate any of the other expressions, otherwise it returns\n the value of the last expr. (and) returns true.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/and"},{"added":"1.0","ns":"clojure.core","name":"create-struct","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":4064,"examples":null,"notes":null,"arglists":["& keys"],"doc":"Returns a structure basis object.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/create-struct"},{"added":"1.0","ns":"clojure.core","name":"get-validator","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":2417,"examples":null,"notes":null,"arglists":["iref"],"doc":"Gets the validator-fn for a var/ref/agent/atom.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/get-validator"},{"added":"1.0","ns":"clojure.core","name":"number?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1342917515000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"num","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b4d"}],"line":3585,"examples":[{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[{"login":"benjiiiiii","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fd1adaf32d9dc6531d6041dbc379efb0?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (number? 1)\ntrue\nuser=\u003E (number? 1.0)\ntrue\nuser=\u003E (number? :a)\nfalse\nuser=\u003E (number? nil)\nfalse\nuser=\u003E (number? \"23\")\nfalse","created-at":1279074614000,"updated-at":1332951904000,"_id":"542692c8c026201cdc326a1e"}],"notes":null,"arglists":["x"],"doc":"Returns true if x is a Number","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/number_q"},{"added":"1.0","ns":"clojure.core","name":"await-for","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1298860372000,"author":{"login":"ninjudd","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7ced25585a7556e9b9b975c1f9e136e3?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"await","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ced"}],"line":3314,"examples":null,"notes":null,"arglists":["timeout-ms & agents"],"doc":"Blocks the current thread until all actions dispatched thus\n far (from this thread or agent) to the agents have occurred, or the\n timeout (in milliseconds) has elapsed. Returns logical false if\n returning due to timeout, logical true otherwise.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/await-for"},{"ns":"clojure.core","name":"chunk-next","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":709,"examples":null,"notes":null,"tag":"clojure.lang.ISeq","arglists":["s"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core/chunk-next"},{"added":"1.0","ns":"clojure.core","name":"print-str","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1297554870000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"println-str","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f5d"},{"created-at":1374264258000,"author":{"login":"lbeschastny","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/416170465e4045f810f09a9300dda4dd?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"print","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f5e"}],"line":4803,"examples":[{"author":{"login":"Miles","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bbb26d2a5e856c4fba0f72c3f7250f3f?r=PG&default=identicon"},"editors":[{"login":"Miles","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bbb26d2a5e856c4fba0f72c3f7250f3f?r=PG&default=identicon"},{"login":"Miles","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bbb26d2a5e856c4fba0f72c3f7250f3f?r=PG&default=identicon"},{"login":"Miles","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bbb26d2a5e856c4fba0f72c3f7250f3f?r=PG&default=identicon"},{"login":"Miles","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bbb26d2a5e856c4fba0f72c3f7250f3f?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"Miles","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bbb26d2a5e856c4fba0f72c3f7250f3f?r=PG&default=identicon"},{"login":"matthewg","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b29dd31d183124d9e87d8037bb30e326?r=PG&default=identicon"}],"body":";; Create a string from the given items and store it in x.\nuser=\u003E (def x (print-str 1 \"foo\" \\b \\a \\r {:a 2}))\n#'user/x\n\n;; It's a string.\nuser=\u003E (string? x)\ntrue\n\n;; Notice that each item is separated by a space.\nuser=\u003E x\n\"1 foo b a r {:a 2}\"\n\n","created-at":1284257174000,"updated-at":1323233208000,"_id":"542692c9c026201cdc326aea"}],"notes":null,"tag":"java.lang.String","arglists":["& xs"],"doc":"print to a string, returning it","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/print-str"},{"added":"1.0","ns":"clojure.core","name":"not-any?","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1330526858000,"author":{"login":"kisielk","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/55fd56dfef815d7aa543be09ad3ed3e9?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"some","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d5b"},{"created-at":1369837609000,"author":{"login":"avasenin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2918eef190b9952940232b30a4f5541d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"every?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d5c"}],"line":2720,"examples":[{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (not-any? odd? '(2 4 6))\ntrue\nuser=\u003E (not-any? odd? '(1 2 3))\nfalse","created-at":1279074514000,"updated-at":1332952427000,"_id":"542692cbc026201cdc326ba8"}],"notes":null,"tag":"java.lang.Boolean","arglists":["pred coll"],"doc":"Returns false if (pred x) is logical true for any x in coll,\n else true.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/not-any_q"},{"added":"1.0","ns":"clojure.core","name":"into-array","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1374150173000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"to-array","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521aa7"},{"created-at":1374150354000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"make-array","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521aa8"}],"line":3469,"examples":[{"author":{"login":"ysph","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/eed512f3595f1baa31fd91f3b297ebbf?r=PG&default=identicon"},"editors":[{"login":"ysph","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/eed512f3595f1baa31fd91f3b297ebbf?r=PG&default=identicon"},{"login":"Ambrose Bonnaire-Sergeant","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/f4b6f2ea0cd9cac02ecd8101c482a41f?r=PG&default=identicon"},{"login":"Phalphalak","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a684c0fd4f27597437de953e92a15d4b?r=PG&default=identicon"},{"login":"Phalphalak","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a684c0fd4f27597437de953e92a15d4b?r=PG&default=identicon"},{"login":"Phalphalak","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a684c0fd4f27597437de953e92a15d4b?r=PG&default=identicon"},{"login":"Phalphalak","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a684c0fd4f27597437de953e92a15d4b?r=PG&default=identicon"}],"body":";; Array's component type is set to (class 2), cannot add Strings.\n;; This will result in an IllegalArgumentException\nuser=\u003E (into-array [2 \"4\" \"8\" 5])\n;; Evaluation aborted.\n\n;; However, if the common type is specified, aforementioned values can be put into an array\nuser=\u003E (into-array Object [2 \"4\" \"8\" 5])\n#\u003CObject[] [Ljava.lang.Object;@3aa6d0a4\u003E\n\nuser=\u003E (into-array (range 4))\n#\u003CInteger[] [Ljava.lang.Integer;@63d6dc46\u003E\n\n;; if you assign a type, you still have to coerce values\nuser=\u003E (into-array Byte/TYPE (range 4))\n;; Evaluation aborted.\n\nuser=\u003E (into-array Byte/TYPE (map byte (range 4)))\n#\u003Cbyte[] [B@68ffefc9\u003E","created-at":1294395323000,"updated-at":1368810887000,"_id":"542692c8c026201cdc326a25"},{"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"editors":[],"body":";; java.nio.file.Paths#get takes (String, String...)\nuser=\u003E (java.nio.file.Paths/get \"/Users\" (into-array [\"username\" \"dev\" \"clojure\"]))\n#\u003CUnixPath /Users/username/dev/clojure\u003E","created-at":1337936915000,"updated-at":1337936915000,"_id":"542692d3c026201cdc326fda"},{"author":{"login":"Phalphalak","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a684c0fd4f27597437de953e92a15d4b?r=PG&default=identicon"},"editors":[],"body":";; Creating an empty array defaults to Object[]\nuser=\u003E (into-array [])\n#\u003CObject[] [Ljava.lang.Object;@21f1151f\u003E\n\n;; However, the type of an empty array can be coerced\nuser=\u003E (into-array String [])\n#\u003CString[] [Ljava.lang.String;@578baf24\u003E\n","created-at":1368810750000,"updated-at":1368810750000,"_id":"542692d3c026201cdc326fdb"}],"notes":null,"arglists":["aseq","type aseq"],"doc":"Returns an array with components set to the values in aseq. The array's\n component type is type if provided, or the type of the first value in\n aseq if present, or Object. All values in aseq must be compatible with\n the component type. Class objects for the primitive types can be obtained\n using, e.g., Integer/TYPE.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/into-array"},{"added":"1.9","ns":"clojure.core","name":"qualified-symbol?","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":1647,"examples":null,"notes":null,"arglists":["x"],"doc":"Return true if x is a symbol with a namespace","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/qualified-symbol_q"},{"added":"1.11","ns":"clojure.core","name":"parse-long","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":8168,"examples":null,"notes":null,"arglists":["s"],"doc":"Parse string of decimal digits with optional leading -/+ and return a\n Long value, or nil if parse fails","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/parse-long"},{"added":"1.0","ns":"clojure.core","name":"init-proxy","file":"clojure/core_proxy.clj","type":"function","column":1,"see-alsos":null,"line":302,"examples":null,"notes":null,"arglists":["proxy mappings"],"doc":"Takes a proxy instance and a map of strings (which must\n correspond to methods of the proxy superclass/superinterfaces) to\n fns (which must take arguments matching the corresponding method,\n plus an additional (explicit) first arg corresponding to this, and\n sets the proxy's fn map. Returns the proxy.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/init-proxy"},{"ns":"clojure.core","name":"chunk-buffer","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":694,"examples":null,"notes":null,"tag":"clojure.lang.ChunkBuffer","arglists":["capacity"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core/chunk-buffer"},{"added":"1.9","ns":"clojure.core","name":"seqable?","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":6281,"examples":null,"notes":null,"arglists":["x"],"doc":"Return true if the seq function is supported for x","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/seqable_q"},{"added":"1.0","ns":"clojure.core","name":"symbol?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":null,"line":564,"examples":[{"author":{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},"editors":[{"login":"dpritchett","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7ecd0a49930872f14eb226ac9c813ac?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (symbol? 'a)\ntrue\nuser=\u003E (symbol? 1)\nfalse\nuser=\u003E (symbol? :a)\nfalse","created-at":1279075212000,"updated-at":1332949799000,"_id":"542692c8c026201cdc3269e7"}],"notes":null,"arglists":["x"],"doc":"Return true if x is a Symbol","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/symbol_q"},{"added":"1.6","ns":"clojure.core","name":"when-some","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":null,"line":1913,"examples":null,"macro":true,"notes":null,"arglists":["bindings & body"],"doc":"bindings =\u003E binding-form test\n\n When test is not nil, evaluates body with binding-form bound to the\n value of test","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/when-some"},{"added":"1.3","ns":"clojure.core","name":"unchecked-char","file":"clojure/core.clj","type":"function","column":1,"see-alsos":null,"line":3554,"examples":null,"notes":null,"arglists":["x"],"doc":"Coerce to char. Subject to rounding or truncation.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/unchecked-char"},{"added":"1.1","ns":"clojure.core","name":"-\u003E\u003E","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1293436689000,"author":{"login":"0x89","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/56bc4acd59315ed4dc1cb99c3be71102?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"-\u003E","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521deb"}],"line":1710,"examples":[{"author":{"login":"tomoj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/854f0ed52f56be27c9919c2afaa665c2?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"tomoj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/854f0ed52f56be27c9919c2afaa665c2?r=PG&default=identicon"},{"login":"tomoj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/854f0ed52f56be27c9919c2afaa665c2?r=PG&default=identicon"},{"login":"uvtc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/34f159f89cbd1d9beac0276f5a7af552?r=PG&default=identicon"}],"body":";; An example of using the \"thread-last\" macro to get\n;; the sum of the first 10 even squares.\nuser=\u003E (-\u003E\u003E (range)\n (map #(* % %))\n (filter even?)\n (take 10)\n (reduce +))\n1140\n\n;; This expands to:\nuser=\u003E (reduce +\n (take 10\n (filter even?\n (map #(* % %)\n (range)))))\n1140\n","created-at":1279952064000,"updated-at":1347320971000,"_id":"542692c8c026201cdc326a52"},{"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"editors":[{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},{"login":"zenog","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8528397254e98a159c68bb0ce20eae71?r=PG&default=identicon"}],"body":"user=\u003E (def c 5)\nuser=\u003E (-\u003E\u003E c (+ 3) (/ 2) (- 1)) \n3/4\n\n;; and if you are curious why\nuser=\u003E (use 'clojure.walk)\nuser=\u003E (macroexpand-all '(-\u003E\u003E c (+ 3) (/ 2) (- 1)))\n(- 1 (/ 2 (+ 3 c)))\n\n","created-at":1339250191000,"updated-at":1343663486000,"_id":"542692d1c026201cdc326f40"}],"macro":true,"notes":[{"updated-at":1280212250000,"body":"I'm getting: `Exception in thread \"main\" java.lang.Exception: Unable to resolve symbol: ->> in this context (11.clj:25)`\r\n\r\nIt's also extremely hard to Google this method. It'd be nice if there was a non-symbol name for this that one could search for.\r\n\r\n**Update**\r\n\r\nThe name of this operator is called a thrush.","created-at":1280193441000,"author":{"login":"Jacolyte","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1703a0c3ed358b787f4b1bf3b2799472?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521f8b"},{"updated-at":1280208986000,"body":"See also \u003Ca href=\"http://clojuredocs.org/v/1872\"\u003E->\u003C/a\u003E which is similar but threads the first expr as the \u003Cb\u003Esecond\u003C/b\u003E argument of the forms.","created-at":1280208986000,"author":{"login":"steveminer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d28543d134185d12d4006a74738d233e?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521f8f"},{"updated-at":1280211630000,"body":"My error was due to using an old version of Clojure. I was using 1.0.0.","created-at":1280211630000,"author":{"login":"Jacolyte","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1703a0c3ed358b787f4b1bf3b2799472?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521f90"},{"updated-at":1400187256000,"body":"There is something I don't get : in the case \"form\" is a seq, why should we write\r\n... (with-meta `(~(first form) ~@(next form) ~x) (meta form))\r\n\r\nand not \r\n... (with-meta `(~@form ~x) (meta form))\r\n\r\nas items order in \"form\" is not changed ?\r\n\r\n","created-at":1400187256000,"author":{"login":"nmichel","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7c68edbc73c1d48f86e5c5f642fff93f?r=PG&default=identicon"},"_id":"542692edf6e94c6970522026"}],"arglists":["x & forms"],"doc":"Threads the expr through the forms. Inserts x as the\n last item in the first form, making a list of it if it is not a\n list already. If there are more forms, inserts the first form as the\n last item in second form, etc.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/-\u003E\u003E"},{"added":"1.1","ns":"clojure.core","name":"future-cancel","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1339252235000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"future","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521afb"},{"created-at":1339252240000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"future?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521afc"},{"created-at":1339252246000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"future-cancelled?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521afd"},{"created-at":1339252256000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"future-done?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521afe"}],"line":7147,"examples":[{"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"editors":[],"body":"\nuser=\u003E (def f (future (Thread/sleep 5000) (inc 0)))\n#'user/f\n\nuser=\u003E (future-cancel f) \ntrue\n\nuser=\u003E (future-cancelled? f) \ntrue","created-at":1339252267000,"updated-at":1339252267000,"_id":"542692d3c026201cdc326fb3"},{"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"editors":[],"body":"\nuser=\u003E (def f (future (inc 0)))\n#'user/f\n\nuser=\u003E (future-cancel f) \nfalse\n\nuser=\u003E (future-cancelled? f) \nfalse","created-at":1339252313000,"updated-at":1339252313000,"_id":"542692d3c026201cdc326fb4"}],"notes":null,"arglists":["f"],"doc":"Cancels the future, if possible.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/future-cancel"},{"added":"1.0","ns":"clojure.core","name":"var-get","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1331249138000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"with-local-vars","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521da4"}],"line":4353,"examples":null,"notes":null,"arglists":["x"],"doc":"Gets the value in the var object","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/var-get"},{"added":"1.0","ns":"clojure.core","name":"commute","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1364879943000,"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ref","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b4c"}],"line":2439,"examples":[{"author":{"login":"leifp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d2f37720f063404ef83b987d2824353d?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (def counter (ref 0))\n#'user/counter\n\n;; deciding whether to increment the counter takes the terribly long time\n;; of 100 ms -- it is decided by committee.\nuser=\u003E (defn commute-inc! [counter]\n (dosync (Thread/sleep 100) (commute counter inc)))\n#'user/commute-inc!\nuser=\u003E (defn alter-inc! [counter]\n (dosync (Thread/sleep 100) (alter counter inc)))\n#'user/alter-inc!\n\n;; what if n people try to hit the counter at once?\nuser=\u003E (defn bombard-counter! [n f counter]\n (apply pcalls (repeat n #(f counter))))\n#'user/bombard-counter!\n\n;; first, use alter. Everyone is trying to update the counter, and\n;; stepping on each other's toes, so almost every transaction is getting \n;; retried lots of times:\nuser=\u003E (dosync (ref-set counter 0))\n0\nuser=\u003E (time (doall (bombard-counter! 20 alter-inc! counter)))\n\"Elapsed time: 2007.049224 msecs\"\n(3 1 2 4 7 10 5 8 6 9 13 14 15 12 11 16 17 20 18 19)\n;; note that it took about 2000 ms = (20 workers * 100 ms / update)\n\n;; now, since it doesn't matter what order people update a counter in, we\n;; use commute:\nuser=\u003E (dosync (ref-set counter 0))\n0\nuser=\u003E (time (doall (bombard-counter! 20 commute-inc! counter)))\n\"Elapsed time: 401.748181 msecs\"\n(1 2 3 4 5 9 10 6 7 8 11 15 13 12 14 16 19 17 18 20)\n;; notice that we got actual concurrency this time.","created-at":1342530933000,"updated-at":1342530933000,"_id":"542692d2c026201cdc326f63"}],"notes":[{"updated-at":1295818063000,"body":"Note to understand the difference to 'alter':\r\n\r\nCommute should be used when it doesn't matter whether anyone else has changed (altered or commuted) the ref using a successful transaction. This often implies that this ref is not affected by any conditions, i.e. it should be changed the same way no matter what. (thanks to raek for clarifying that for me)","created-at":1295818063000,"author":{"login":"dedeibel","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e89e54d864f1e584c5ef4102f98bc83?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fb1"},{"updated-at":1316668674000,"body":"In the concurrency video RH explains that commute is useful for actions where the order in which they alter the value doesn't matter, e.g. incrementing a counter.","created-at":1316668674000,"author":{"login":"m0wfo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/f4e90ce9fdf9e968587c7f9bec94721e?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fcd"}],"arglists":["ref fun & args"],"doc":"Must be called in a transaction. Sets the in-transaction-value of\n ref to:\n\n (apply fun in-transaction-value-of-ref args)\n\n and returns the in-transaction-value of ref.\n\n At the commit point of the transaction, sets the value of ref to be:\n\n (apply fun most-recently-committed-value-of-ref args)\n\n Thus fun should be commutative, or, failing that, you must accept\n last-one-in-wins behavior. commute allows for more concurrency than\n ref-set.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/commute"},{"added":"1.0","ns":"clojure.core","name":"coll?","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1357786211000,"author":{"login":"juan.facorro","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d6f59d93cc17c698f16e550034a2d1ad?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"seq?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f37"},{"created-at":1357786229000,"author":{"login":"juan.facorro","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d6f59d93cc17c698f16e550034a2d1ad?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"list?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f38"},{"created-at":1357786244000,"author":{"login":"juan.facorro","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d6f59d93cc17c698f16e550034a2d1ad?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"sequential?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f39"}],"line":6269,"examples":[{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"MrHus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4fa262299223e58030e9062d97224547?r=PG&default=identicon"},{"login":"Dmitry Kakurin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/85b70be5da433a6adf5112e7140848da?r=PG&default=identicon"}],"body":"user=\u003E (coll? {})\ntrue\n\nuser=\u003E (coll? #{})\ntrue\n\nuser=\u003E (coll? [])\ntrue\n\nuser=\u003E (coll? ())\ntrue\n\nuser=\u003E (coll? 4)\nfalse\n\nuser=\u003E (coll? \"fred\")\nfalse\n\nuser=\u003E (coll? true)\nfalse\n\nuser=\u003E (coll? nil)\nfalse\n","created-at":1280775820000,"updated-at":1306764731000,"_id":"542692cfc026201cdc326e40"},{"author":{"login":"kumarshantanu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/39f90a6c0ffe4995fb9dff4fb6b6bad6?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (coll? {:a 10 :b 20}) ; map is a collection of map-entries\ntrue","created-at":1290278420000,"updated-at":1290278420000,"_id":"542692cfc026201cdc326e44"},{"author":{"login":"gregginca","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bad5f5cb177b0968d4288596691ec3cd?r=PG&default=identicon"},"editors":[{"login":"dcj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c18c35f1747ce57b4c1114cb12d600b1?r=PG&default=identicon"}],"body":";; contrast to example code for sequential?\n;;\nuser\u003E (coll? '(1 2 3))\ntrue\nuser\u003E (coll? [1 2 3])\ntrue\nuser\u003E (coll? (range 1 5))\ntrue\nuser\u003E (coll? 1)\nfalse\nuser\u003E (coll? {:a 2 :b 1}) \ntrue\nuser\u003E (coll? {:a 2 :b 1}) ; in contrast to sequential?, coll? returns true for a hash map\ntrue\nuser\u003E (sequential? {:a 2 :b 1})\nfalse","created-at":1334018852000,"updated-at":1348632492000,"_id":"542692d2c026201cdc326f61"}],"notes":null,"arglists":["x"],"doc":"Returns true if x implements IPersistentCollection","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/coll_q"},{"added":"1.2","ns":"clojure.core","name":"get-in","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1318010512000,"author":{"login":"jks","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/de50bee3396570d25f900873303c98f1?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"assoc-in","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ce6"},{"created-at":1318010548000,"author":{"login":"jks","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/de50bee3396570d25f900873303c98f1?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"update-in","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ce7"},{"created-at":1360286942000,"author":{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"find","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ce8"},{"created-at":1360286946000,"author":{"login":"AtKaaZ","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e10dfa345f44b0fe72bbe081fd51b83?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"get","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ce9"},{"created-at":1412262512260,"author":{"login":"phreed","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/211644?v=2"},"to-var":{"ns":"clojure.core","name":"-\u003E","library-url":"https://github.com/clojure/clojure"},"_id":"542d6a70e4b05f4d257a2989"}],"line":6205,"examples":[{"author":{"login":"tomoj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/854f0ed52f56be27c9919c2afaa665c2?r=PG&default=identicon"},"editors":[{"login":"tomoj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/854f0ed52f56be27c9919c2afaa665c2?r=PG&default=identicon"},{"login":"tomoj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/854f0ed52f56be27c9919c2afaa665c2?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; We can use get-in for reaching into nested maps:\nuser=\u003E (def m {:username \"sally\"\n :profile {:name \"Sally Clojurian\"\n :address {:city \"Austin\" :state \"TX\"}}})\n#'user/m\n\nuser=\u003E (get-in m [:profile :name])\n\"Sally Clojurian\"\nuser=\u003E (get-in m [:profile :address :city])\n\"Austin\"\nuser=\u003E (get-in m [:profile :address :zip-code])\nnil\nuser=\u003E (get-in m [:profile :address :zip-code] \"no zip code!\")\n\"no zip code!\"\n\n\n;; Vectors are also associative:\nuser=\u003E (def v [[1 2 3]\n [4 5 6]\n [7 8 9]])\n#'user/v\nuser=\u003E (get-in v [0 2])\n3\nuser=\u003E (get-in v [2 1])\n8\n\n\n;; We can mix associative types:\nuser=\u003E (def mv {:username \"jimmy\"\n :pets [{:name \"Rex\"\n :type :dog}\n {:name \"Sniffles\"\n :type :hamster}]})\n#'user/mv\nuser=\u003E (get-in mv [:pets 1 :type])\n:hamster\n","created-at":1279953166000,"updated-at":1285497184000,"_id":"542692c7c026201cdc3269af"},{"author":{"login":"octopusgrabbus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fd31b8bcea99fa7b0711fbc424587774?r=PG&default=identicon"},"editors":[],"body":"(def s1 [[:000-00-0000 \"TYPE 1\" \"JACKSON\" \"FRED\"]\n [:000-00-0001 \"TYPE 2\" \"SIMPSON\" \"HOMER\"]\n [:000-00-0002 \"TYPE 4\" \"SMITH\" \"SUSAN\"]])\n\n(def cols [0 2 3])\n\n(defn f1 \n [s1 col] \n (map #(get-in s1 [% col] nil) (range (count s1))))\n\n(apply interleave (map (partial f1 s1) cols))\n\n(:000-00-0000 \"JACKSON\" \"FRED\" :000-00-0001 \"SIMPSON\" \"HOMER\" :000-00-0002 \"SMITH\" \"SUSAN\")","created-at":1334887763000,"updated-at":1334887763000,"_id":"542692d3c026201cdc326fc1"},{"author":{"login":"fitswell","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/12550cf0cd2d5a801d70ec1bf282e8ba?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":";; spam link removed","created-at":1377540628000,"updated-at":1379291978000,"_id":"542692d3c026201cdc326fc2"},{"body":";; Introduction of references is jarring to get-in usage\n\n(def owners [{:owner \"Jimmy\"\n :pets (ref [{:name \"Rex\"\n :type :dog}\n {:name \"Sniffles\"\n :type :hamster}])} \n {:owner \"Jacky\" \n :pets (ref [{:name \"Spot\" \n :type :mink}\n {:name \"Puff\" \n :type :magic-dragon}])}])\n;;=\u003E 'user/owners\n\n(get-in owners [0 :pets])\n;;=\u003E #\u003CRef@: [{:name \"Rex\", :type :dog} {:name \"Sniffles\", :type :hamster}\u003E\n\n;; In order to go deeper the get needs to be split \n;; as the deref cannot be used as part of the get.\n(-\u003E (get-in owners [0 :pets]) deref (get-in [1 :type]))\n;;=\u003E :hamster\n\n;; At this point it clear that the thread operator \n;; can be used to produce similar results. \n(-\u003E owners (nth 0) :pets deref (nth 1) :type)\n;;=\u003E :hamster","author":{"login":"phreed","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/211644?v=2"},"created-at":1412262392950,"updated-at":1412262454783,"editors":[{"login":"phreed","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/211644?v=2"}],"_id":"542d69f8e4b05f4d257a2986"}],"notes":null,"arglists":["m ks","m ks not-found"],"doc":"Returns the value in a nested associative structure,\n where ks is a sequence of keys. Returns nil if the key\n is not present, or the not-found value if supplied.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/get-in"},{"added":"1.0","ns":"clojure.core","name":"fnext","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1348637428000,"author":{"login":"dansalmo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e33ee460f5f61bc5ba9b598934766215?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"ffirst","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d68"},{"created-at":1374512076000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"second","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d69"}],"line":114,"examples":[{"author":{"login":"zmila","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/68dd6f50915854aa04fefcf4d6fa5c8e?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (fnext ['(a b c) '(b a c)])\n(b a c) \n\nuser=\u003E (fnext '([a b c] [b a c]))\n[b a c] \n\nuser=\u003E (fnext {:a 1 :b 2 :c 3})\n[:b 2] \n\nuser=\u003E (fnext [])\nnil \n\nuser=\u003E (fnext [1])\nnil","created-at":1280347120000,"updated-at":1332952453000,"_id":"542692ccc026201cdc326ca5"}],"notes":null,"arglists":["x"],"doc":"Same as (first (next x))","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/fnext"},{"added":"1.2","ns":"clojure.core","name":"denominator","file":"clojure/core.clj","static":true,"type":"function","column":1,"see-alsos":[{"created-at":1401510175000,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.core","name":"numerator","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b91"}],"line":3616,"examples":[{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[],"body":";; denominator always returns the denominator of the reduced fraction\n;;\nuser=\u003E (denominator (/ 2 3))\n3\nuser=\u003E (denominator (/ 3 6))\n2\nuser=\u003E (map denominator [(/ 3 2) (/ 2 3) (/ 4 5) (/ 4 6)])\n(2 3 5 3)\nuser=\u003E","created-at":1313489509000,"updated-at":1313489509000,"_id":"542692ccc026201cdc326c35"}],"notes":null,"tag":"java.math.BigInteger","arglists":["r"],"doc":"Returns the denominator part of a Ratio.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/denominator"},{"added":"1.1","ns":"clojure.core","name":"bytes","file":"clojure/core.clj","type":"function","column":1,"see-alsos":[{"created-at":1334358122000,"author":{"login":"Havvy","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e799a79441c7543be48562403411cd13?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"byte-array","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c11"}],"line":5406,"examples":[{"author":{"login":"leifp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d2f37720f063404ef83b987d2824353d?r=PG&default=identicon"},"editors":[],"body":";; for fast interop\nuser=\u003E (bytes (byte-array (map (comp byte int) \"ascii\")))\n#\u003Cbyte[] [B@7a004f62\u003E\nuser=\u003E (def the-bytes *1)\n#'user/the-bytes\nuser=\u003E (defn get-byte [the-bytes i] (aget the-bytes i))\n#'user/get-byte Reflection warning, NO_SOURCE_PATH:1 - call to aget can't be resolved.\n\nuser=\u003E (defn get-byte [the-bytes i] \n (let [the-bytes (bytes the-bytes)] \n (aget the-bytes i)))\n#'user/get-byte\nuser=\u003E (get-byte the-bytes 0)\n97\n","created-at":1342528870000,"updated-at":1342528870000,"_id":"542692d2c026201cdc326f5e"}],"notes":[{"updated-at":1369546475000,"body":"Why is the `(comp byte int)` required in the example? This seems to work just as well:\r\n\r\n\u003Cpre\u003E\r\nuser=\u003E (def b (bytes (byte-array (map byte \"ascii\"))))\r\nuser=\u003E (String. b)\r\n\"ascii\"\r\n\u003C/pre\u003E","created-at":1369546475000,"author":{"login":"Brian Marick","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a523012f661f603806ab1c22d855216f?r=PG&default=identicon"},"_id":"542692edf6e94c6970522002"},{"updated-at":1369546620000,"body":"For that matter, why is the `bytes` needed? Consider:\r\n\r\n\u003Cpre\u003E\r\nuser=\u003E (String. (byte-array (map byte \"ascii\")))\r\n\"ascii\"\r\n\u003C/pre\u003E\r\n","created-at":1369546620000,"author":{"login":"Brian Marick","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a523012f661f603806ab1c22d855216f?r=PG&default=identicon"},"_id":"542692edf6e94c6970522003"},{"updated-at":1402388003000,"body":"AFAIK, `bytes` is used for referring to `bytes[].class` from JAVA\r\n\r\nExample (midje):\r\n\r\n (fact (class (.getBytes \"test\")) =\u003E bytes) ; true\r\n","created-at":1402388003000,"author":{"login":"xcthulhu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/81c9adff485c35b7fdbbefe29589585a?r=PG&default=identicon"},"_id":"542692edf6e94c6970522028"}],"arglists":["xs"],"doc":"Casts to bytes[]","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/bytes"},{"added":"1.0","ns":"clojure.core","name":"refer-clojure","file":"clojure/core.clj","type":"macro","column":1,"see-alsos":[{"created-at":1327515371000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"refer","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f4c"}],"line":5875,"examples":[{"author":{"login":"juergenhoetzel","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2736dfffc803c704dcf25b45ff63cede?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; Prevent namespace conflicts like:\n\n;; `WARNING: time already refers to: #'clojure.core/time in namespace: \n;; time, being replaced by: #'time/time`\n\nuser=\u003E (ns time\n (:refer-clojure :exclude [time]))\n\n(defn time []\n (System/nanoTime))\n","created-at":1279945839000,"updated-at":1285497447000,"_id":"542692c8c026201cdc326a5f"}],"macro":true,"notes":null,"arglists":["& filters"],"doc":"Same as (refer 'clojure.core \u003Cfilters\u003E)","library-url":"https://github.com/clojure/clojure","href":"/clojure.core/refer-clojure"},{"ns":"clojure.core.async","name":"Pub","file":"clojure/core/async.clj","type":"var","column":1,"see-alsos":null,"line":918,"examples":null,"notes":null,"arglists":[],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/Pub"},{"ns":"clojure.core.async","name":"reduce","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":636,"examples":null,"notes":null,"arglists":["f init ch"],"doc":"f should be a function of 2 arguments. Returns a channel containing\n the single result of applying f to init and the first item from the\n channel, then applying f to that result and the 2nd item, etc. If\n the channel closes without yielding items, returns init and f is not\n called. ch must close before reduce produces a result.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/reduce"},{"ns":"clojure.core.async","name":"remove\u003E","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":1147,"examples":null,"deprecated":"0.1.319.0-6b1aca-alpha","notes":null,"arglists":["p ch"],"doc":"Deprecated - this function will be removed. Use transducer instead","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/remove\u003E"},{"ns":"clojure.core.async","name":"timeout","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":111,"examples":[{"body":"user=\u003E (go-loop [seconds (atom 0)\n add-seconds! #(swap! seconds + %)]\n (println \"Waiting 1 second\")\n (\u003C! (timeout 1000))\n (add-seconds! 1)\n (println \"Waiting 2 seconds\")\n (\u003C! (timeout 2000))\n (add-seconds! 2)\n (println\n (format \"Waited %s seconds\"\n @seconds))) \n\n#\u003CManyToManyChannel clojure.core.async.impl.channels.ManyToManyChannel@67ddcb0e\u003E\n\n;; Waiting 1 second\n\n;; Waiting 2 seconds\n\n;; Waited 3 seconds\n","author":{"login":"runexec","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/1487241?v=2"},"created-at":1412204562718,"updated-at":1412204562718,"_id":"542c8812e4b05f4d257a2979"},{"body":"user=\u003E (doseq [n (range 10)\n :let [i (-\u003E n\n inc\n range\n rand-nth)]] \n (go\n (\u003C! (timeout (* i 1000)))\n (println n)))\nnil\n5\n3\n0\n6\n4\n7\n1\n2\n9\n8\n\n","author":{"login":"runexec","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/1487241?v=2"},"created-at":1412206392113,"updated-at":1412206392113,"_id":"542c8f38e4b05f4d257a2981"}],"notes":null,"arglists":["msecs"],"doc":"Returns a channel that will close after msecs","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/timeout"},{"ns":"clojure.core.async","name":"unsub*","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["p v ch"],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/unsub*"},{"ns":"clojure.core.async","name":"admix*","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["m ch"],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/admix*"},{"ns":"clojure.core.async","name":"unmix*","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["m ch"],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/unmix*"},{"ns":"clojure.core.async","name":"mix","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":816,"examples":[{"body":"user=\u003E (def ch-out (chan))\n#'user/ch-out\n\nuser=\u003E (def mix-out (mix ch-out))\n#'user/mix-out\n\nuser=\u003E (def ch-example1 (chan))\n#'user/ch-example1\n\nuser=\u003E (def ch-example2 (chan))\n#'user/ch-example2\n\nuser=\u003E (admix mix-out ch-example1)\ntrue\n\nuser=\u003E (admix mix-out ch-example2)\ntrue\n\nuser=\u003E (put! ch-example1 \"sent to chan 1\")\ntrue\n\nuser=\u003E (put! ch-example2 \"sent to chan 2\")\ntrue\n\nuser=\u003E (\u003C!! ch-out)\n\"sent to chan 1\"\n\nuser=\u003E (\u003C!! ch-out)\n\"sent to chan 2\"\n\n","author":{"login":"runexec","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/1487241?v=2"},"created-at":1412147964717,"updated-at":1412147964717,"_id":"542baafce4b05f4d257a295c"}],"notes":null,"arglists":["out"],"doc":"Creates and returns a mix of one or more input channels which will\n be put on the supplied out channel. Input sources can be added to\n the mix with 'admix', and removed with 'unmix'. A mix supports\n soloing, muting and pausing multiple inputs atomically using\n 'toggle', and can solo using either muting or pausing as determined\n by 'solo-mode'.\n\n Each channel can have zero or more boolean modes set via 'toggle':\n\n :solo - when true, only this (ond other soloed) channel(s) will appear\n in the mix output channel. :mute and :pause states of soloed\n channels are ignored. If solo-mode is :mute, non-soloed\n channels are muted, if :pause, non-soloed channels are\n paused.\n\n :mute - muted channels will have their contents consumed but not included in the mix\n :pause - paused channels will not have their contents consumed (and thus also not included in the mix)\n","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/mix"},{"ns":"clojure.core.async","name":"pub","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":923,"examples":[{"body":"user=\u003E (def c (chan 1))\n#'user/c\n\nuser=\u003E (def sub-c (pub c :route))\n#'user/sub-c\n\nuser=\u003E (def cx (chan 1))\n#'user/cx\n\nuser=\u003E (sub sub-c :up-stream cx)\n#\u003CManyToManyChannel clojure.core.async.impl.channels.ManyToManyChannel@526eb67f\u003E\n\nuser=\u003E (def cy (chan 1))\n#'user/cy\n\nuser=\u003E (sub sub-c :down-stream cy)\n#\u003CManyToManyChannel clojure.core.async.impl.channels.ManyToManyChannel@777692ac\u003E\n\nuser=\u003E (go-loop [_ (\u003C! cx)]\n (println \"Got something coming up!\"))\n#\u003CManyToManyChannel clojure.core.async.impl.channels.ManyToManyChannel@49e2e0f9\u003E\n\nuser=\u003E (go-loop [_ (\u003C! cy)]\n (println \"Got something going down!\"))\n#\u003CManyToManyChannel clojure.core.async.impl.channels.ManyToManyChannel@33498147\u003E\n\nuser=\u003E (put! c {:route :up-stream :data 123})\ntrue\nGot something coming up!\n\nuser=\u003E (put! c {:route :down-stream :data 123})\nGot something going down!\ntrue\n","author":{"login":"runexec","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/1487241?v=2"},"created-at":1412174292506,"updated-at":1412188913552,"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"_id":"542c11d4e4b05f4d257a2964"}],"notes":null,"arglists":["ch topic-fn","ch topic-fn buf-fn"],"doc":"Creates and returns a pub(lication) of the supplied channel,\n partitioned into topics by the topic-fn. topic-fn will be applied to\n each value on the channel and the result will determine the 'topic'\n on which that value will be put. Channels can be subscribed to\n receive copies of topics using 'sub', and unsubscribed using\n 'unsub'. Each topic will be handled by an internal mult on a\n dedicated channel. By default these internal channels are\n unbuffered, but a buf-fn can be supplied which, given a topic,\n creates a buffer with desired properties.\n\n Each item is distributed to all subs in parallel and synchronously,\n i.e. each sub must accept before the next item is distributed. Use\n buffering/windowing to prevent slow subs from holding up the pub.\n\n Items received when there are no matching subs get dropped.\n\n Note that if buf-fns are used then each topic is handled\n asynchronously, i.e. if a channel is subscribed to more than one\n topic it should not expect them to be interleaved identically with\n the source.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/pub"},{"ns":"clojure.core.async","name":"take","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":1062,"examples":null,"notes":null,"arglists":["n ch","n ch buf-or-n"],"doc":"Returns a channel that will return, at most, n items from ch. After n items\n have been returned, or ch has been closed, the return channel will close.\n\n The output channel is unbuffered by default, unless buf-or-n is given.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/take"},{"ns":"clojure.core.async","name":"unsub-all*","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["p","p v"],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/unsub-all*"},{"ns":"clojure.core.async","name":"\u003C!","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":[{"created-at":1412197300851,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.core.async","name":"take!","library-url":"https://github.com/clojure/clojure"},"_id":"542c6bb4e4b05f4d257a296e"},{"created-at":1412197636649,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.core.async","name":"\u003C!!","library-url":"https://github.com/clojure/clojure"},"_id":"542c6d04e4b05f4d257a2973"}],"line":140,"examples":[{"body":"user=\u003E (def c (chan 1))\n#'user/c\n\nuser=\u003E (go-loop [data (\u003C! c)]\n (println \"Waited for =\u003E \" data)\n (println \"No recur. Won't print again\"))\n\n#\u003CManyToManyChannel clojure.core.async.impl.channels.ManyToManyChannel@6a3d3df4\u003E\n\nuser=\u003E (put! c \"Example Async Data\")\n\nnil\n\nWaited for =\u003E Example Async Data\nNo recur. Won't print again\n\nuser=\u003E (put! c \"Example Async Data\")\nnil\n","author":{"login":"runexec","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/1487241?v=2"},"created-at":1412145281681,"updated-at":1412197165245,"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"_id":"542ba081e4b05f4d257a2956"},{"body":";; Clojure 1.7\nuser=\u003E (let [c (chan 1 (filter pos?))]\n \n (go-loop []\n (let [nums (\u003C! c)]\n (println nums))\n (recur))\n \n (doseq [n (range -10 10)]\n (put! c n)))\nnil\n1\n2\n3\n4\n5\n6\n7\n8\n9\n","author":{"login":"runexec","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/1487241?v=2"},"created-at":1412146875135,"updated-at":1412197218572,"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"_id":"542ba6bbe4b05f4d257a2957"}],"notes":null,"arglists":["port"],"doc":"takes a val from port. Must be called inside a (go ...) block. Will\n return nil if closed. Will park if nothing is available.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/\u003C!"},{"ns":"clojure.core.async","name":"map","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":998,"examples":[{"body":"user=\u003E (def cx\n (to-chan\n (range 10)))\n#'user/cx\n\nuser=\u003E (def cy\n (to-chan\n (range -10 0)))\n#'user/cy\n\nuser=\u003E (def mapped-chans\n (clojure.core.async/map + [cx cy]))\n#'user/mapped-chans\n\n;;\nuser=\u003E (\u003C!! mapped-chans)\n-8\nuser=\u003E (\u003C!! mapped-chans)\n-6\nuser=\u003E (\u003C!! mapped-chans)\n-4\nuser=\u003E (\u003C!! mapped-chans)\n-2\nuser=\u003E (\u003C!! mapped-chans)\n0\nuser=\u003E (\u003C!! mapped-chans)\n2\nuser=\u003E (\u003C!! mapped-chans)\n4\nuser=\u003E (\u003C!! mapped-chans)\n6\nuser=\u003E (\u003C!! mapped-chans)\n8\n","author":{"login":"runexec","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/1487241?v=2"},"created-at":1412205675141,"updated-at":1412205675141,"_id":"542c8c6be4b05f4d257a297e"}],"notes":null,"arglists":["f chs","f chs buf-or-n"],"doc":"Takes a function and a collection of source channels, and returns a\n channel which contains the values produced by applying f to the set\n of first items taken from each source channel, followed by applying\n f to the set of second items from each channel, until any one of the\n channels is closed, at which point the output channel will be\n closed. The returned channel will be unbuffered by default, or a\n buf-or-n can be supplied","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/map"},{"ns":"clojure.core.async","name":"Mux","file":"clojure/core/async.clj","type":"var","column":1,"see-alsos":null,"line":742,"examples":null,"notes":null,"arglists":[],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/Mux"},{"ns":"clojure.core.async","name":"mapcat\u003E","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":1193,"examples":null,"deprecated":"0.1.319.0-6b1aca-alpha","notes":null,"arglists":["f out","f out buf-or-n"],"doc":"Deprecated - this function will be removed. Use transducer instead","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/mapcat\u003E"},{"ns":"clojure.core.async","name":"buffer","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":58,"examples":[{"body":"user=\u003E (def c (chan (buffer 3)))\n#'user/c\n\nuser=\u003E (go (\u003C! (timeout 20000))\n (println \"Unblocking buffer\")\n (doseq [_ (range 2)]\n (\u003C! c)))\n\n#\u003CManyToManyChannel clojure.core.async.impl.channels.ManyToManyChannel@5c350b54\u003E\n\nuser=\u003E (doseq [_ (range 5)] (println (\u003E!! c true)))\ntrue\ntrue\ntrue\nUnblocking buffer\ntrue\ntrue\nnil","author":{"login":"runexec","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/1487241?v=2"},"created-at":1412149213685,"updated-at":1412188866844,"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"_id":"542bafdde4b05f4d257a295d"}],"notes":null,"arglists":["n"],"doc":"Returns a fixed buffer of size n. When full, puts will block/park.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/buffer"},{"ns":"clojure.core.async","name":"close!","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":214,"examples":null,"notes":null,"arglists":["chan"],"doc":"Closes a channel. The channel will no longer accept any puts (they\n will be ignored). Data in the channel remains available for taking, until\n exhausted, after which takes will return nil. If there are any\n pending takes, they will be dispatched with nil. Closing a closed\n channel is a no-op. Returns nil.\n\n Logically closing happens after all puts have been delivered. Therefore, any\n blocked or parked puts will remain blocked/parked until a taker releases them.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/close!"},{"ns":"clojure.core.async","name":"offer!","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":429,"examples":null,"notes":null,"arglists":["port val"],"doc":"Puts a val into port if it's possible to do so immediately.\n nil values are not allowed. Never blocks. Returns true if offer succeeds.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/offer!"},{"ns":"clojure.core.async","name":"chan","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":[{"created-at":1412171784700,"author":{"login":"halgari","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/654621?v=2"},"to-var":{"ns":"clojure.core.async","name":"buffer","library-url":"https://github.com/clojure/clojure"},"_id":"542c0808e4b05f4d257a295f"},{"created-at":1412171799578,"author":{"login":"halgari","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/654621?v=2"},"to-var":{"ns":"clojure.core.async","name":"dropping-buffer","library-url":"https://github.com/clojure/clojure"},"_id":"542c0817e4b05f4d257a2960"},{"created-at":1412171810126,"author":{"login":"halgari","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/654621?v=2"},"to-var":{"ns":"clojure.core.async","name":"sliding-buffer","library-url":"https://github.com/clojure/clojure"},"_id":"542c0822e4b05f4d257a2961"}],"line":83,"examples":[{"body":"user=\u003E (def c (chan))\n#'user/c\nuser=\u003E (def c (chan 1))\n#'user/c\nuser=\u003E (def c (chan (buffer 2)))\n#'user/c\n;; Clojure 1.7\nuser=\u003E (def c (chan 1 (filter string?)))\n#'user/c\n\n","author":{"login":"runexec","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/1487241?v=2"},"created-at":1412149437066,"updated-at":1412149437066,"_id":"542bb0bde4b05f4d257a295e"}],"notes":null,"arglists":["","buf-or-n","buf-or-n xform","buf-or-n xform ex-handler"],"doc":"Creates a channel with an optional buffer, an optional transducer\n (like (map f), (filter p) etc or a composition thereof), and an\n optional exception-handler. If buf-or-n is a number, will create\n and use a fixed buffer of that size. If a transducer is supplied a\n buffer must be specified. ex-handler must be a fn of one argument -\n if an exception occurs during transformation it will be called with\n the Throwable as an argument, and any non-nil return value will be\n placed in the channel.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/chan"},{"ns":"clojure.core.async","name":"solo-mode*","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["m mode"],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/solo-mode*"},{"ns":"clojure.core.async","name":"onto-chan!","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":673,"examples":null,"notes":null,"arglists":["ch coll","ch coll close?"],"doc":"Puts the contents of coll into the supplied channel.\n\n By default the channel will be closed after the items are copied,\n but can be determined by the close? parameter.\n\n Returns a channel which will close after the items are copied.\n\n If accessing coll might block, use onto-chan!! instead","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/onto-chan!"},{"ns":"clojure.core.async","name":"tap","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":792,"examples":[{"body":"user=\u003E (def sz 20)\n#'user/sz\n\nuser=\u003E (def c (chan sz))\n#'user/c\n\nuser=\u003E (def mult-c (mult c))\n#'user/mult-c\n\nuser=\u003E (def cx (chan sz))\n#'user/cx\n\nuser=\u003E (def cy (chan sz))\n#'user/cy\n\nuser=\u003E (def cz (chan sz))\n#'user/cz\n\nuser=\u003E (tap mult-c cx)\n#\u003CManyToManyChannel clojure.core.async.impl.channels.ManyToManyChannel@63942268\u003E\n\nuser=\u003E (tap mult-c cy)\n#\u003CManyToManyChannel clojure.core.async.impl.channels.ManyToManyChannel@1f025346\u003E\n\nuser=\u003E (tap mult-c cz)\n#\u003CManyToManyChannel clojure.core.async.impl.channels.ManyToManyChannel@29d4cd91\u003E\n\nuser=\u003E (put! c \"sent to all\")\ntrue\n\nuser=\u003E (\u003C!! cx)\n\"sent to all\"\n\nuser=\u003E (\u003C!! cy)\n\"sent to all\"\n\nuser=\u003E (\u003C!! cz)\n\"sent to all\"\n\n","author":{"login":"runexec","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/1487241?v=2"},"created-at":1412203655521,"updated-at":1412203655521,"_id":"542c8487e4b05f4d257a2976"}],"notes":null,"arglists":["mult ch","mult ch close?"],"doc":"Copies the mult source onto the supplied channel.\n\n By default the channel will be closed when the source closes,\n but can be determined by the close? parameter.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/tap"},{"ns":"clojure.core.async","name":"go","file":"clojure/core/async.clj","type":"macro","column":1,"see-alsos":null,"line":443,"examples":[{"body":"user=\u003E (doseq [n (range 10)\n :let [i (-\u003E n\n inc\n range\n rand-nth)]] \n (go\n (\u003C! (timeout (* i 1000)))\n (println n)))\nnil\n5\n3\n0\n6\n4\n7\n1\n2\n9\n8\n\n","author":{"login":"runexec","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/1487241?v=2"},"created-at":1412206377445,"updated-at":1412206377445,"_id":"542c8f29e4b05f4d257a2980"}],"macro":true,"notes":null,"arglists":["& body"],"doc":"Asynchronously executes the body, returning immediately to the\n calling thread. Additionally, any visible calls to \u003C!, \u003E! and alt!/alts!\n channel operations within the body will block (if necessary) by\n 'parking' the calling thread rather than tying up an OS thread (or\n the only JS thread when in ClojureScript). Upon completion of the\n operation, the body will be resumed.\n\n go blocks should not (either directly or indirectly) perform operations\n that may block indefinitely. Doing so risks depleting the fixed pool of\n go block threads, causing all go block processing to stop. This includes\n core.async blocking ops (those ending in !!) and other blocking IO.\n\n Returns a channel which will receive the result of the body when\n completed","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/go"},{"ns":"clojure.core.async","name":"admix","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":886,"examples":[{"body":"user=\u003E (def ch-out (chan))\n#'user/ch-out\n\nuser=\u003E (def mix-out (mix ch-out))\n#'user/mix-out\n\nuser=\u003E (def ch-example1 (chan))\n#'user/ch-example1\n\nuser=\u003E (def ch-example2 (chan))\n#'user/ch-example2\n\nuser=\u003E (admix mix-out ch-example1)\ntrue\n\nuser=\u003E (admix mix-out ch-example2)\ntrue\n\nuser=\u003E (put! ch-example1 \"sent to chan 1\")\ntrue\n\nuser=\u003E (put! ch-example2 \"sent to chan 2\")\ntrue\n\nuser=\u003E (\u003C!! ch-out)\n\"sent to chan 1\"\n\nuser=\u003E (\u003C!! ch-out)\n\"sent to chan 2\"\n\n","author":{"login":"runexec","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/1487241?v=2"},"created-at":1412147871588,"updated-at":1412147871588,"_id":"542baa9fe4b05f4d257a295b"}],"notes":null,"arglists":["mix ch"],"doc":"Adds ch as an input to the mix","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/admix"},{"ns":"clojure.core.async","name":"promise-chan","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":99,"examples":null,"notes":null,"arglists":["","xform","xform ex-handler"],"doc":"Creates a promise channel with an optional transducer, and an optional\n exception-handler. A promise channel can take exactly one value that consumers\n will receive. Once full, puts complete but val is dropped (no transfer).\n Consumers will block until either a value is placed in the channel or the\n channel is closed, then return the value (or nil) forever. See chan for the\n semantics of xform and ex-handler.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/promise-chan"},{"ns":"clojure.core.async","name":"unique","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":1202,"examples":null,"deprecated":"0.1.319.0-6b1aca-alpha","notes":null,"arglists":["ch","ch buf-or-n"],"doc":"Deprecated - this function will be removed. Use transducer instead","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/unique"},{"ns":"clojure.core.async","name":"muxch*","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["_"],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/muxch*"},{"ns":"clojure.core.async","name":"solo-mode","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":913,"examples":null,"notes":null,"arglists":["mix mode"],"doc":"Sets the solo mode of the mix. mode must be one of :mute or :pause","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/solo-mode"},{"ns":"clojure.core.async","name":"transduce","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":652,"examples":null,"notes":null,"arglists":["xform f init ch"],"doc":"async/reduces a channel with a transformation (xform f).\n Returns a channel containing the result. ch must close before\n transduce produces a result.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/transduce"},{"ns":"clojure.core.async","name":"onto-chan","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":705,"examples":[{"body":"user=\u003E (def c (chan))\n#'user/c\n\nuser=\u003E (onto-chan c (range 100))\n#\u003CManyToManyChannel clojure.core.async.impl.channels.ManyToManyChannel@2e68de5\u003E\n\nuser=\u003E (\u003C!! c)\n0\nuser=\u003E (\u003C!! c)\n1\nuser=\u003E (\u003C!! c)\n2\n","author":{"login":"runexec","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/1487241?v=2"},"created-at":1412204952394,"updated-at":1412204952394,"_id":"542c8998e4b05f4d257a297c"}],"deprecated":"1.2","notes":null,"arglists":["ch coll","ch coll close?"],"doc":"Deprecated - use onto-chan! or onto-chan!!","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/onto-chan"},{"ns":"clojure.core.async","name":"to-chan","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":711,"examples":[{"body":"user=\u003E (def c (to-chan (range 10)))\n#'user/c\nuser=\u003E (\u003C!! c)\n0\nuser=\u003E (\u003C!! c)\n1\nuser=\u003E (\u003C!! c)\n2\nuser=\u003E (\u003C!! c)\n3\n","author":{"login":"runexec","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/1487241?v=2"},"created-at":1412203983353,"updated-at":1412203983353,"_id":"542c85cfe4b05f4d257a2978"}],"deprecated":"1.2","notes":null,"arglists":["coll"],"doc":"Deprecated - use to-chan! or to-chan!!","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/to-chan"},{"ns":"clojure.core.async","name":"dropping-buffer","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":64,"examples":null,"notes":null,"arglists":["n"],"doc":"Returns a buffer of size n. When full, puts will complete but\n val will be dropped (no transfer).","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/dropping-buffer"},{"ns":"clojure.core.async","name":"untap-all","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":805,"examples":null,"notes":null,"arglists":["mult"],"doc":"Disconnects all target channels from a mult","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/untap-all"},{"ns":"clojure.core.async","name":"into","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":1054,"examples":[{"body":"user=\u003E (def c\n (clojure.core.async/into [:a :b :c]\n (to-chan\n (range 10))))\n#'user/c\n\nuser=\u003E (\u003C!! c)\n[:a :b :c 0 1 2 3 4 5 6 7 8 9]\n","author":{"login":"runexec","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/1487241?v=2"},"created-at":1412205992809,"updated-at":1412205992809,"_id":"542c8da8e4b05f4d257a297f"}],"notes":null,"arglists":["coll ch"],"doc":"Returns a channel containing the single (collection) result of the\n items taken from the channel conjoined to the supplied\n collection. ch must close before into produces a result.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/into"},{"ns":"clojure.core.async","name":"\u003E!!","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":166,"examples":[{"body":"user=\u003E (\u003E!! c \"Blocking - not in go-block\")\ntrue\nuser=\u003E (\u003C!! c)\n\"Blocking - not in go-block\"\n","author":{"login":"runexec","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/1487241?v=2"},"created-at":1412147318961,"updated-at":1412147318961,"_id":"542ba876e4b05f4d257a2959"}],"notes":null,"arglists":["port val"],"doc":"puts a val into port. nil values are not allowed. Will block if no\n buffer space is available. Returns true unless port is already closed.\n Not intended for use in direct or transitive calls from (go ...) blocks.\n Use the clojure.core.async.go-checking flag to detect invalid use (see\n namespace docs).","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/\u003E!!"},{"ns":"clojure.core.async","name":"to-chan!","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":690,"examples":null,"notes":null,"arglists":["coll"],"doc":"Creates and returns a channel which contains the contents of coll,\n closing when exhausted.\n\n If accessing coll might block, use to-chan!! instead","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/to-chan!"},{"ns":"clojure.core.async","name":"alt!","file":"clojure/core/async.clj","type":"macro","column":1,"see-alsos":null,"line":387,"examples":null,"macro":true,"notes":null,"arglists":["& clauses"],"doc":"Makes a single choice between one of several channel operations,\n as if by alts!, returning the value of the result expr corresponding\n to the operation completed. Must be called inside a (go ...) block.\n\n Each clause takes the form of:\n\n channel-op[s] result-expr\n\n where channel-ops is one of:\n\n take-port - a single port to take\n [take-port | [put-port put-val] ...] - a vector of ports as per alts!\n :default | :priority - an option for alts!\n\n and result-expr is either a list beginning with a vector, whereupon that\n vector will be treated as a binding for the [val port] return of the\n operation, else any other expression.\n\n (alt!\n [c t] ([val ch] (foo ch val))\n x ([v] v)\n [[out val]] :wrote\n :default 42)\n\n Each option may appear at most once. The choice and parking\n characteristics are those of alts!.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/alt!"},{"ns":"clojure.core.async","name":"pipeline","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":577,"examples":null,"notes":null,"arglists":["n to xf from","n to xf from close?","n to xf from close? ex-handler"],"doc":"Takes elements from the from channel and supplies them to the to\n channel, subject to the transducer xf, with parallelism n. Because\n it is parallel, the transducer will be applied independently to each\n element, not across elements, and may produce zero or more outputs\n per input. Outputs will be returned in order relative to the\n inputs. By default, the to channel will be closed when the from\n channel closes, but can be determined by the close? parameter. Will\n stop consuming the from channel if the to channel closes. Note this\n should be used for computational parallelism. If you have multiple\n blocking operations to put in flight, use pipeline-blocking instead,\n If you have multiple asynchronous operations to put in flight, use\n pipeline-async instead. See chan for semantics of ex-handler.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/pipeline"},{"ns":"clojure.core.async","name":"sub","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":978,"examples":[{"body":"user=\u003E (def c (chan 1))\n#'user/c\n\nuser=\u003E (def sub-c (pub c :route))\n#'user/sub-c\n\nuser=\u003E (def cx (chan 1))\n#'user/cx\n\nuser=\u003E (sub sub-c :up-stream cx)\n#\u003CManyToManyChannel clojure.core.async.impl.channels.ManyToManyChannel@526eb67f\u003E\n\nuser=\u003E (def cy (chan 1))\n#'user/cy\n\nuser=\u003E (sub sub-c :down-stream cy)\n#\u003CManyToManyChannel clojure.core.async.impl.channels.ManyToManyChannel@777692ac\u003E\n\nuser=\u003E (go-loop [_ (\u003C! cx)]\n (println \"Got something coming up!\"))\n#\u003CManyToManyChannel clojure.core.async.impl.channels.ManyToManyChannel@49e2e0f9\u003E\n\nuser=\u003E (go-loop [_ (\u003C! cy)]\n (println \"Got something going down!\"))\n#\u003CManyToManyChannel clojure.core.async.impl.channels.ManyToManyChannel@33498147\u003E\n\nuser=\u003E (put! c {:route :up-stream :data 123})\ntrue\nGot something coming up!\n\nuser=\u003E (put! c {:route :down-stream :data 123})\nGot something going down!\ntrue\n","author":{"login":"runexec","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/1487241?v=2"},"created-at":1412174270351,"updated-at":1412188965721,"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"_id":"542c11bee4b05f4d257a2963"}],"notes":null,"arglists":["p topic ch","p topic ch close?"],"doc":"Subscribes a channel to a topic of a pub.\n\n By default the channel will be closed when the source closes,\n but can be determined by the close? parameter.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/sub"},{"ns":"clojure.core.async","name":"go-loop","file":"clojure/core/async.clj","type":"macro","column":1,"see-alsos":null,"line":502,"examples":[{"body":"user=\u003E (go-loop [seconds (atom 0)\n add-seconds! #(swap! seconds + %)]\n (println \"Waiting 1 second\")\n (\u003C! (timeout 1000))\n (add-seconds! 1)\n (println \"Waiting 2 seconds\")\n (\u003C! (timeout 2000))\n (add-seconds! 2)\n (println\n (format \"Waited %s seconds\"\n @seconds))) \n\n#\u003CManyToManyChannel clojure.core.async.impl.channels.ManyToManyChannel@67ddcb0e\u003E\n\n;; Waiting 1 second\n\n;; Waiting 2 seconds\n\n;; Waited 3 seconds\n","author":{"login":"runexec","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/1487241?v=2"},"created-at":1412204595867,"updated-at":1412204595867,"_id":"542c8833e4b05f4d257a297a"},{"body":"user=\u003E (def c (chan 1))\n#'user/c\n\nuser=\u003E (go-loop []\n (let [x (\u003C! c)]\n (println \"Got a value in this loop:\" x))\n (recur))\n\n#\u003CManyToManyChannel clojure.core.async.impl.channels.ManyToManyChannel@30df0e27\u003E\n\nuser=\u003E (doseq [n (range 3)] (put! c n))\nnil\nGot a value in this loop: 0\nGot a value in this loop: 1\nGot a value in this loop: 2\n","author":{"login":"runexec","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/1487241?v=2"},"created-at":1412204771239,"updated-at":1412204771239,"_id":"542c88e3e4b05f4d257a297b"}],"macro":true,"notes":null,"arglists":["bindings & body"],"doc":"Like (go (loop ...))","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/go-loop"},{"ns":"clojure.core.async","name":"map\u003E","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":1113,"examples":null,"deprecated":"0.1.319.0-6b1aca-alpha","notes":null,"arglists":["f ch"],"doc":"Deprecated - this function will be removed. Use transducer instead","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/map\u003E"},{"ns":"clojure.core.async","name":"pipe","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":507,"examples":[{"body":"user=\u003E (def cx (chan 1))\n#'user/cx\n\nuser=\u003E (def cy (chan 1))\n#'user/cy\n\nuser=\u003E (pipe cx cy)\n#\u003CManyToManyChannel clojure.core.async.impl.channels.ManyToManyChannel@5064227c\u003E\n\nuser=\u003E (put! cx \"Going into CX\")\ntrue\n\nuser=\u003E (\u003C!! cy)\n\"Going into CX\"\n","author":{"login":"runexec","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/1487241?v=2"},"created-at":1412174511500,"updated-at":1412174511500,"_id":"542c12afe4b05f4d257a2965"}],"notes":null,"arglists":["from to","from to close?"],"doc":"Takes elements from the from channel and supplies them to the to\n channel. By default, the to channel will be closed when the from\n channel closes, but can be determined by the close? parameter. Will\n stop consuming the from channel if the to channel closes","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/pipe"},{"ns":"clojure.core.async","name":"unmix","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":891,"examples":null,"notes":null,"arglists":["mix ch"],"doc":"Removes ch as an input to the mix","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/unmix"},{"ns":"clojure.core.async","name":"onto-chan!!","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":717,"examples":null,"notes":null,"arglists":["ch coll","ch coll close?"],"doc":"Like onto-chan! for use when accessing coll might block,\n e.g. a lazy seq of blocking operations","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/onto-chan!!"},{"ns":"clojure.core.async","name":"filter\u003C","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":1153,"examples":null,"deprecated":"0.1.319.0-6b1aca-alpha","notes":null,"arglists":["p ch","p ch buf-or-n"],"doc":"Deprecated - this function will be removed. Use transducer instead","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/filter\u003C"},{"ns":"clojure.core.async","name":"sub*","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["p v ch close?"],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/sub*"},{"ns":"clojure.core.async","name":"remove\u003C","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":1168,"examples":null,"deprecated":"0.1.319.0-6b1aca-alpha","notes":null,"arglists":["p ch","p ch buf-or-n"],"doc":"Deprecated - this function will be removed. Use transducer instead","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/remove\u003C"},{"ns":"clojure.core.async","name":"alt!!","file":"clojure/core/async.clj","type":"macro","column":1,"see-alsos":null,"line":380,"examples":null,"macro":true,"notes":null,"arglists":["& clauses"],"doc":"Like alt!, except as if by alts!!, will block until completed, and\n not intended for use in (go ...) blocks.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/alt!!"},{"ns":"clojure.core.async","name":"untap*","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["m ch"],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/untap*"},{"ns":"clojure.core.async","name":"\u003C!!","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":[{"created-at":1412197429254,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.core.async","name":"\u003C!","library-url":"https://github.com/clojure/clojure"},"_id":"542c6c35e4b05f4d257a2971"},{"created-at":1412197438580,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.core.async","name":"take!","library-url":"https://github.com/clojure/clojure"},"_id":"542c6c3ee4b05f4d257a2972"}],"line":127,"examples":[{"body":"user=\u003E (\u003E!! c \"Blocking - not in go-block\")\ntrue\nuser=\u003E (\u003C!! c)\n\"Blocking - not in go-block\"\n","author":{"login":"runexec","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/1487241?v=2"},"created-at":1412147336577,"updated-at":1412147336577,"_id":"542ba888e4b05f4d257a295a"}],"notes":null,"arglists":["port"],"doc":"takes a val from port. Will return nil if closed. Will block\n if nothing is available.\n Not intended for use in direct or transitive calls from (go ...) blocks.\n Use the clojure.core.async.go-checking flag to detect invalid use (see\n namespace docs).","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/\u003C!!"},{"ns":"clojure.core.async","name":"toggle","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":901,"examples":null,"notes":null,"arglists":["mix state-map"],"doc":"Atomically sets the state(s) of one or more channels in a mix. The\n state map is a map of channels -\u003E channel-state-map. A\n channel-state-map is a map of attrs -\u003E boolean, where attr is one or\n more of :mute, :pause or :solo. Any states supplied are merged with\n the current state.\n\n Note that channels can be added to a mix via toggle, which can be\n used to add channels in a particular (e.g. paused) state.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/toggle"},{"ns":"clojure.core.async","name":"untap-all*","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["m"],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/untap-all*"},{"ns":"clojure.core.async","name":"sliding-buffer","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":70,"examples":null,"notes":null,"arglists":["n"],"doc":"Returns a buffer of size n. When full, puts will complete, and be\n buffered, but oldest elements in buffer will be dropped (not\n transferred).","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/sliding-buffer"},{"ns":"clojure.core.async","name":"partition","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":1220,"examples":null,"deprecated":"0.1.319.0-6b1aca-alpha","notes":null,"arglists":["n ch","n ch buf-or-n"],"doc":"Deprecated - this function will be removed. Use transducer instead","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/partition"},{"ns":"clojure.core.async","name":"Mult","file":"clojure/core/async.clj","type":"var","column":1,"see-alsos":null,"line":745,"examples":null,"notes":null,"arglists":[],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/Mult"},{"ns":"clojure.core.async","name":"merge","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":1036,"examples":[{"body":"user=\u003E (def cx (chan))\n#'user/cx\n\nuser=\u003E (def cy (chan))\n#'user/cy\n\nuser=\u003E (def mc (clojure.core.async/merge [cx cy]))\n#'user/mc\n\nuser=\u003E (put! cx \"Going to x\")\ntrue\n\nuser=\u003E (put! cy \"Goint to y\")\ntrue\n\nuser=\u003E (\u003C!! mc)\n\"Going to x\"\n\nuser=\u003E (\u003C!! mc)\n\"Goint to y\"\n","author":{"login":"runexec","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/1487241?v=2"},"created-at":1412205302119,"updated-at":1412205302119,"_id":"542c8af6e4b05f4d257a297d"}],"notes":null,"arglists":["chs","chs buf-or-n"],"doc":"Takes a collection of source channels and returns a channel which\n contains all values taken from them. The returned channel will be\n unbuffered by default, or a buf-or-n can be supplied. The channel\n will close after all the source channels have closed.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/merge"},{"ns":"clojure.core.async","name":"partition-by","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":1245,"examples":null,"deprecated":"0.1.319.0-6b1aca-alpha","notes":null,"arglists":["f ch","f ch buf-or-n"],"doc":"Deprecated - this function will be removed. Use transducer instead","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/partition-by"},{"ns":"clojure.core.async","name":"unsub-all","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":991,"examples":null,"notes":null,"arglists":["p","p topic"],"doc":"Unsubscribes all channels from a pub, or a topic of a pub","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/unsub-all"},{"ns":"clojure.core.async","name":"\u003E!","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":179,"examples":[{"body":"user=\u003E (let [c (chan 1)]\n #_=\u003E (go (\u003E! c 1)\n #_=\u003E (println \"Got =\u003E \" (\u003C! c))))\n\nGot =\u003E 1\n\n#\u003CManyToManyChannel clojure.core.async.impl.channels.ManyToManyChannel@4a061708\u003E\n","author":{"login":"runexec","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/1487241?v=2"},"created-at":1412147143085,"updated-at":1412147143085,"_id":"542ba7c7e4b05f4d257a2958"}],"notes":null,"arglists":["port val"],"doc":"puts a val into port. nil values are not allowed. Must be called\n inside a (go ...) block. Will park if no buffer space is available.\n Returns true unless port is already closed.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/\u003E!"},{"ns":"clojure.core.async","name":"to-chan!!","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":729,"examples":null,"notes":null,"arglists":["coll"],"doc":"Like to-chan! for use when accessing coll might block,\n e.g. a lazy seq of blocking operations","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/to-chan!!"},{"ns":"clojure.core.async","name":"unmix-all*","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["m"],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/unmix-all*"},{"ns":"clojure.core.async","name":"split","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":615,"examples":null,"notes":null,"arglists":["p ch","p ch t-buf-or-n f-buf-or-n"],"doc":"Takes a predicate and a source channel and returns a vector of two\n channels, the first of which will contain the values for which the\n predicate returned true, the second those for which it returned\n false.\n\n The out channels will be unbuffered by default, or two buf-or-ns can\n be supplied. The channels will close after the source channel has\n closed.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/split"},{"ns":"clojure.core.async","name":"unmix-all","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":896,"examples":null,"notes":null,"arglists":["mix"],"doc":"removes all inputs from the mix","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/unmix-all"},{"ns":"clojure.core.async","name":"filter\u003E","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":1129,"examples":null,"deprecated":"0.1.319.0-6b1aca-alpha","notes":null,"arglists":["p ch"],"doc":"Deprecated - this function will be removed. Use transducer instead","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/filter\u003E"},{"ns":"clojure.core.async","name":"tap*","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["m ch close?"],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/tap*"},{"ns":"clojure.core.async","name":"defblockingop","file":"clojure/core/async.clj","type":"macro","column":1,"see-alsos":null,"line":116,"examples":null,"macro":true,"notes":null,"arglists":["op doc arglist & body"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/defblockingop"},{"ns":"clojure.core.async","name":"untap","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":800,"examples":null,"notes":null,"arglists":["mult ch"],"doc":"Disconnects a target channel from a mult","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/untap"},{"ns":"clojure.core.async","name":"alts!","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":316,"examples":null,"notes":null,"arglists":["ports & {:as opts}"],"doc":"Completes at most one of several channel operations. Must be called\n inside a (go ...) block. ports is a vector of channel endpoints,\n which can be either a channel to take from or a vector of\n [channel-to-put-to val-to-put], in any combination. Takes will be\n made as if by \u003C!, and puts will be made as if by \u003E!. Unless\n the :priority option is true, if more than one port operation is\n ready a non-deterministic choice will be made. If no operation is\n ready and a :default value is supplied, [default-val :default] will\n be returned, otherwise alts! will park until the first operation to\n become ready completes. Returns [val port] of the completed\n operation, where val is the value taken for takes, and a\n boolean (true unless already closed, as per put!) for puts.\n\n opts are passed as :key val ... Supported options:\n\n :default val - the value to use if none of the operations are immediately ready\n :priority true - (default nil) when true, the operations will be tried in order.\n\n Note: there is no guarantee that the port exps or val exprs will be\n used, nor in what order should they be, so they should not be\n depended upon for side effects.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/alts!"},{"ns":"clojure.core.async","name":"unsub","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":986,"examples":null,"notes":null,"arglists":["p topic ch"],"doc":"Unsubscribes a channel from a topic of a pub","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/unsub"},{"ns":"clojure.core.async","name":"poll!","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":436,"examples":null,"notes":null,"arglists":["port"],"doc":"Takes a val from port if it's possible to do so immediately.\n Never blocks. Returns value if successful, nil otherwise.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/poll!"},{"ns":"clojure.core.async","name":"thread","file":"clojure/core/async.clj","type":"macro","column":1,"see-alsos":null,"line":493,"examples":null,"macro":true,"notes":null,"arglists":["& body"],"doc":"Executes the body in another thread, returning immediately to the\n calling thread. Returns a channel which will receive the result of\n the body when completed, then close.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/thread"},{"ns":"clojure.core.async","name":"map\u003C","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":1081,"examples":null,"deprecated":"0.1.319.0-6b1aca-alpha","notes":null,"arglists":["f ch"],"doc":"Deprecated - this function will be removed. Use transducer instead","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/map\u003C"},{"ns":"clojure.core.async","name":"fn-handler","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":43,"examples":null,"notes":null,"arglists":["f","f blockable"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/fn-handler"},{"ns":"clojure.core.async","name":"do-alts","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":272,"examples":null,"notes":null,"arglists":["fret ports opts"],"doc":"returns derefable [val port] if immediate, nil if enqueued","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/do-alts"},{"ns":"clojure.core.async","name":"pipeline-blocking","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":594,"examples":null,"notes":null,"arglists":["n to xf from","n to xf from close?","n to xf from close? ex-handler"],"doc":"Like pipeline, for blocking operations.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/pipeline-blocking"},{"ns":"clojure.core.async","name":"pipeline-async","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":600,"examples":null,"notes":null,"arglists":["n to af from","n to af from close?"],"doc":"Takes elements from the from channel and supplies them to the to\n channel, subject to the async function af, with parallelism n. af\n must be a function of two arguments, the first an input value and\n the second a channel on which to place the result(s). The\n presumption is that af will return immediately, having launched some\n asynchronous operation whose completion/callback will put results on\n the channel, then close! it. Outputs will be returned in order\n relative to the inputs. By default, the to channel will be closed\n when the from channel closes, but can be determined by the close?\n parameter. Will stop consuming the from channel if the to channel\n closes. See also pipeline, pipeline-blocking.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/pipeline-async"},{"ns":"clojure.core.async","name":"Mix","file":"clojure/core/async.clj","type":"var","column":1,"see-alsos":null,"line":809,"examples":null,"notes":null,"arglists":[],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/Mix"},{"ns":"clojure.core.async","name":"toggle*","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["m state-map"],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/toggle*"},{"ns":"clojure.core.async","name":"mult","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":750,"examples":[{"body":"user=\u003E (def sz 20)\n#'user/sz\n\nuser=\u003E (def c (chan sz))\n#'user/c\n\nuser=\u003E (def mult-c (mult c))\n#'user/mult-c\n\nuser=\u003E (def cx (chan sz))\n#'user/cx\n\nuser=\u003E (def cy (chan sz))\n#'user/cy\n\nuser=\u003E (def cz (chan sz))\n#'user/cz\n\nuser=\u003E (tap mult-c cx)\n#\u003CManyToManyChannel clojure.core.async.impl.channels.ManyToManyChannel@63942268\u003E\n\nuser=\u003E (tap mult-c cy)\n#\u003CManyToManyChannel clojure.core.async.impl.channels.ManyToManyChannel@1f025346\u003E\n\nuser=\u003E (tap mult-c cz)\n#\u003CManyToManyChannel clojure.core.async.impl.channels.ManyToManyChannel@29d4cd91\u003E\n\nuser=\u003E (put! c \"sent to all\")\ntrue\n\nuser=\u003E (\u003C!! cx)\n\"sent to all\"\n\nuser=\u003E (\u003C!! cy)\n\"sent to all\"\n\nuser=\u003E (\u003C!! cz)\n\"sent to all\"\n\n","author":{"login":"runexec","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/1487241?v=2"},"created-at":1412203675781,"updated-at":1412203675781,"_id":"542c849be4b05f4d257a2977"}],"notes":null,"arglists":["ch"],"doc":"Creates and returns a mult(iple) of the supplied channel. Channels\n containing copies of the channel can be created with 'tap', and\n detached with 'untap'.\n\n Each item is distributed to all taps in parallel and synchronously,\n i.e. each tap must accept before the next item is distributed. Use\n buffering/windowing to prevent slow taps from holding up the mult.\n\n Items received when there are no taps get dropped.\n\n If a tap puts to a closed channel, it will be removed from the mult.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/mult"},{"ns":"clojure.core.async","name":"thread-call","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":475,"examples":null,"notes":null,"arglists":["f"],"doc":"Executes f in another thread, returning immediately to the calling\n thread. Returns a channel which will receive the result of calling\n f when completed, then close.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/thread-call"},{"ns":"clojure.core.async","name":"alts!!","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":303,"examples":null,"notes":null,"arglists":["ports & opts"],"doc":"Like alts!, except takes will be made as if by \u003C!!, and puts will\n be made as if by \u003E!!, will block until completed.\n Not intended for use in direct or transitive calls from (go ...) blocks.\n Use the clojure.core.async.go-checking flag to detect invalid use (see\n namespace docs).","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/alts!!"},{"ns":"clojure.core.async","name":"mapcat\u003C","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":1184,"examples":null,"deprecated":"0.1.319.0-6b1aca-alpha","notes":null,"arglists":["f in","f in buf-or-n"],"doc":"Deprecated - this function will be removed. Use transducer instead","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/mapcat\u003C"},{"ns":"clojure.core.async","name":"ioc-alts!","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":418,"examples":null,"notes":null,"arglists":["state cont-block ports & {:as opts}"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/ioc-alts!"},{"ns":"clojure.core.async","name":"unblocking-buffer?","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":77,"examples":null,"notes":null,"arglists":["buff"],"doc":"Returns true if a channel created with buff will never block. That is to say,\n puts into this buffer will never cause the buffer to be full. ","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/unblocking-buffer_q"},{"ns":"clojure.core.async","name":"do-alt","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":342,"examples":null,"notes":null,"arglists":["alts clauses"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/do-alt"},{"ns":"clojure.core.async","name":"put!","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":189,"examples":[{"body":"user=\u003E (def c (chan 1))\n#'user/c\n\nuser=\u003E (take! c\n (fn [x]\n (println \"Clojure callback value \" x)))\nnil\n\nuser=\u003E (put! c \"XYZ\")\nClojure callback value XYZ\ntrue\n\nuser=\u003E (put! c \"XYZ\")\ntrue\n","author":{"login":"runexec","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/1487241?v=2"},"created-at":1412203179922,"updated-at":1412203179922,"_id":"542c82abe4b05f4d257a2975"}],"notes":null,"arglists":["port val","port val fn1","port val fn1 on-caller?"],"doc":"Asynchronously puts a val into port, calling fn1 (if supplied) when\n complete, passing false iff port is already closed. nil values are\n not allowed. If on-caller? (default true) is true, and the put is\n immediately accepted, will call fn1 on calling thread.\n\n fn1 may be run in a fixed-size dispatch thread pool and should not\n perform blocking IO, including core.async blocking ops (those that\n end in !!).\n\n Returns true unless port is already closed.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/put!"},{"ns":"clojure.core.async","name":"take!","file":"clojure/core/async.clj","type":"function","column":1,"see-alsos":null,"line":146,"examples":[{"body":"user=\u003E (def c (chan 1))\n#'user/c\n\nuser=\u003E (take! c\n (fn [x]\n (println \"Clojure callback value \" x)))\nnil\n\nuser=\u003E (put! c \"XYZ\")\nClojure callback value XYZ\ntrue\n\nuser=\u003E (put! c \"XYZ\")\ntrue\n","author":{"login":"runexec","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/1487241?v=2"},"created-at":1412203153682,"updated-at":1412203153682,"_id":"542c8291e4b05f4d257a2974"}],"notes":null,"arglists":["port fn1","port fn1 on-caller?"],"doc":"Asynchronously takes a val from port, passing to fn1. Will pass nil\n if closed. If on-caller? (default true) is true, and value is\n immediately available, will call fn1 on calling thread.\n\n fn1 may be run in a fixed-size dispatch thread pool and should not\n perform blocking IO, including core.async blocking ops (those that\n end in !!).\n\n Returns nil.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.async/take!"},{"ns":"clojure.core.logic","name":"run-db*","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":1252,"examples":null,"macro":true,"notes":null,"arglists":["db bindings & goals"],"doc":"Executes goals until results are exhausted. Uses a specified logic database.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/run-db*"},{"ns":"clojure.core.logic","name":"choice","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":1102,"examples":null,"notes":null,"arglists":["a f"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/choice"},{"ns":"clojure.core.logic","name":"-conjo","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2768,"examples":null,"notes":null,"arglists":["coll args out"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/-conjo"},{"ns":"clojure.core.logic","name":"to-subst-val","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":604,"examples":null,"notes":null,"arglists":["v"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/to-subst-val"},{"ns":"clojure.core.logic","name":"conde","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":1175,"examples":null,"macro":true,"notes":null,"arglists":["& clauses"],"doc":"Logical disjunction of the clauses. The first goal in\n a clause is considered the head of that clause. Interleaves the\n execution of the clauses.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/conde"},{"ns":"clojure.core.logic","name":"master","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":1976,"examples":null,"notes":null,"arglists":["argv cache"],"doc":"Take the argument to the goal and check that we don't\n have an alpha equivalent cached answer term in the cache.\n If it doesn't already exist in the cache add the new\n answer term.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/master"},{"ns":"clojure.core.logic","name":"sort-by-member-count","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2218,"examples":null,"notes":null,"arglists":["a"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/sort-by-member-count"},{"ns":"clojure.core.logic","name":"matche","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":1705,"examples":null,"macro":true,"notes":null,"arglists":["xs & cs"],"doc":"Pattern matching macro. All patterns will be tried.\n See conde.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/matche"},{"ns":"clojure.core.logic","name":"appendo","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":1772,"examples":null,"notes":null,"arglists":["x y z"],"doc":"A relation where x, y, and z are proper collections,\n such that z is x appended to y","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/appendo"},{"ns":"clojure.core.logic","name":"nafc","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2725,"examples":null,"notes":null,"arglists":["c & args"],"doc":"EXPERIMENTAL: negation as failure constraint. All arguments to the goal c\n must be ground. If some argument is not ground the execution of this constraint\n will be delayed.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/nafc"},{"ns":"clojure.core.logic","name":"fnu","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":1723,"examples":null,"macro":true,"notes":null,"arglists":["& rest"],"doc":"Define an anonymous committed choice goal. See condu.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/fnu"},{"ns":"clojure.core.logic","name":"!=c","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2409,"examples":null,"notes":null,"arglists":["p"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/!=c"},{"ns":"clojure.core.logic","name":"composeg*","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":1060,"examples":null,"macro":true,"notes":null,"arglists":["g0","g0 & gs"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/composeg*"},{"ns":"clojure.core.logic","name":"addcg","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2036,"examples":null,"notes":null,"arglists":["c"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/addcg"},{"ns":"clojure.core.logic","name":"dissoc-meta","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":27,"examples":null,"notes":null,"arglists":["x k"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/dissoc-meta"},{"ns":"clojure.core.logic","name":"rem-attr","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":440,"examples":null,"notes":null,"arglists":["s x attr"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/rem-attr"},{"ns":"clojure.core.logic","name":"fk","file":"clojure/core/logic.clj","type":"var","column":1,"see-alsos":null,"line":19,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/fk"},{"ns":"clojure.core.logic","name":"-predc","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2659,"examples":null,"notes":null,"arglists":["x p","x p pform"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/-predc"},{"ns":"clojure.core.logic","name":"recover-vars-from-term","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2389,"examples":null,"notes":null,"arglists":["x"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/recover-vars-from-term"},{"ns":"clojure.core.logic","name":"defna","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":1728,"examples":null,"macro":true,"notes":null,"arglists":["& rest"],"doc":"Define a soft cut goal. See conda.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/defna"},{"ns":"clojure.core.logic","name":"recover-vars","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2398,"examples":null,"notes":null,"arglists":["p"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/recover-vars"},{"ns":"clojure.core.logic","name":"defnu","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":1733,"examples":null,"macro":true,"notes":null,"arglists":["& rest"],"doc":"Define a committed choice goal. See condu.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/defnu"},{"ns":"clojure.core.logic","name":"cgoal","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2187,"examples":null,"notes":null,"arglists":["c"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/cgoal"},{"ns":"clojure.core.logic","name":"seqc","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2887,"examples":null,"notes":null,"arglists":["v"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/seqc"},{"ns":"clojure.core.logic","name":"log","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":1288,"examples":null,"macro":true,"notes":null,"arglists":["& s"],"doc":"Goal for println","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/log"},{"ns":"clojure.core.logic","name":"-reify*","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":259,"examples":null,"notes":null,"arglists":["s v"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/-reify*"},{"ns":"clojure.core.logic","name":"bind*","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":1067,"examples":null,"macro":true,"notes":null,"arglists":["a g","a g & g-rest"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/bind*"},{"ns":"clojure.core.logic","name":"reifyg","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2175,"examples":null,"notes":null,"arglists":["x"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/reifyg"},{"ns":"clojure.core.logic","name":"distincto","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2472,"examples":null,"notes":null,"arglists":["l"],"doc":"A relation which guarantees no element of l will unify\n with another element of l.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/distincto"},{"ns":"clojure.core.logic","name":"assoc-dom","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":30,"examples":null,"notes":null,"arglists":["x k v"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/assoc-dom"},{"ns":"clojure.core.logic","name":"get-dom","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":515,"examples":null,"notes":null,"arglists":["s x dom"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/get-dom"},{"ns":"clojure.core.logic","name":"condu","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":1425,"examples":null,"macro":true,"notes":null,"arglists":["& clauses"],"doc":"Committed choice. Once the head (first goal) of a clause\n has succeeded, remaining goals of the clause will only\n be run once. Non-relational.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/condu"},{"ns":"clojure.core.logic","name":"constrain-tree","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2839,"examples":null,"notes":null,"arglists":["t fc"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/constrain-tree"},{"ns":"clojure.core.logic","name":"run-nc*","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":1263,"examples":null,"macro":true,"notes":null,"arglists":["& goals"],"doc":"Executes goals until results are exhausted. Does not occurs-check.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/run-nc*"},{"ns":"clojure.core.logic","name":"empty-s","file":"clojure/core/logic.clj","type":"var","column":1,"see-alsos":null,"line":537,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/empty-s"},{"ns":"clojure.core.logic","name":"var-rands","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":91,"examples":null,"notes":null,"arglists":["a c"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/var-rands"},{"ns":"clojure.core.logic","name":"merge-with-root","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":579,"examples":null,"notes":null,"arglists":["s x root"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/merge-with-root"},{"ns":"clojure.core.logic","name":"waiting-stream-check","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":1863,"examples":null,"notes":null,"arglists":["w success-cont failure-cont"],"doc":"Take a waiting stream, a success continuation, and a failure continuation.\n If we don't find any ready suspended streams, invoke the failure continuation.\n If we find a ready suspended stream calculate the remainder of the waiting\n stream. If we've reached the fixpoint just call the thunk of the suspended\n stream, otherwise call mplus on the result of the thunk and the remainder\n of the waiting stream. Pass this result to the success contination.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/waiting-stream-check"},{"ns":"clojure.core.logic","name":"tabled-s","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":529,"examples":null,"notes":null,"arglists":["","oc","oc meta"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/tabled-s"},{"ns":"clojure.core.logic","name":"fresh","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":1207,"examples":null,"macro":true,"notes":null,"arglists":["[& lvars] & goals"],"doc":"Creates fresh variables. Goals occuring within form a logical\n conjunction.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/fresh"},{"ns":"clojure.core.logic","name":"treec","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2876,"examples":null,"notes":null,"arglists":["x fc reifier"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/treec"},{"ns":"clojure.core.logic","name":"partial-map","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2536,"examples":null,"notes":null,"arglists":["m"],"doc":"Given map m, returns partial map that unifies with maps even if it\n doesn't share all of the keys of that map.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/partial-map"},{"ns":"clojure.core.logic","name":"*logic-dbs*","file":"clojure/core/logic.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":1235,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/*logic-dbs*"},{"ns":"clojure.core.logic","name":"and*","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":1273,"examples":null,"notes":null,"arglists":["goals"],"doc":"A function version of all, which takes a list of goals and succeeds only fi they all succeed.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/and*"},{"ns":"clojure.core.logic","name":"unify-with-map*","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":911,"examples":null,"notes":null,"arglists":["u v s"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/unify-with-map*"},{"ns":"clojure.core.logic","name":"runcg","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2053,"examples":null,"notes":null,"arglists":["c"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/runcg"},{"ns":"clojure.core.logic","name":"matcha","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":1738,"examples":null,"macro":true,"notes":null,"arglists":["xs & cs"],"doc":"Define a soft cut pattern match. See conda.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/matcha"},{"ns":"clojure.core.logic","name":"ientailed?","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2061,"examples":null,"notes":null,"arglists":["c"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/ientailed_q"},{"ns":"clojure.core.logic","name":"lcons?","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":875,"examples":null,"notes":null,"arglists":["x"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/lcons_q"},{"ns":"clojure.core.logic","name":"ext-run-csg","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":1152,"examples":null,"notes":null,"arglists":["u v"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/ext-run-csg"},{"ns":"clojure.core.logic","name":"emptyo","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":1654,"examples":null,"notes":null,"arglists":["a"],"doc":"A relation where a is the empty list","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/emptyo"},{"ns":"clojure.core.logic","name":"unbound-rands","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":97,"examples":null,"notes":null,"arglists":["a c"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/unbound-rands"},{"ns":"clojure.core.logic","name":"updatecg","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2045,"examples":null,"notes":null,"arglists":["c"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/updatecg"},{"ns":"clojure.core.logic","name":"reify-lvar-name","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":253,"examples":null,"notes":null,"arglists":["s"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/reify-lvar-name"},{"ns":"clojure.core.logic","name":"reify-constraints","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2164,"examples":null,"notes":null,"arglists":["v r a"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/reify-constraints"},{"ns":"clojure.core.logic","name":"lvar","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":706,"examples":null,"notes":null,"arglists":["","name","name unique"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/lvar"},{"ns":"clojure.core.logic","name":"unify","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":236,"examples":null,"notes":null,"arglists":["s u v"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/unify"},{"ns":"clojure.core.logic","name":"to-stream","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":1794,"examples":null,"notes":null,"arglists":["aseq"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/to-stream"},{"ns":"clojure.core.logic","name":"s#","file":"clojure/core/logic.clj","type":"var","column":1,"see-alsos":null,"line":1148,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/s#"},{"ns":"clojure.core.logic","name":"trace-s","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":1295,"examples":null,"macro":true,"notes":null,"arglists":[""],"doc":"Goal that prints the current substitution","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/trace-s"},{"ns":"clojure.core.logic","name":"-\u003ESubstitutions","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":287,"examples":null,"notes":null,"arglists":["s vs ts cs cq cqs oc _meta"],"doc":"Positional factory function for class clojure.core.logic.Substitutions.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/-\u003ESubstitutions"},{"ns":"clojure.core.logic","name":"enforce-constraints","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2156,"examples":null,"notes":null,"arglists":["x"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/enforce-constraints"},{"ns":"clojure.core.logic","name":"rembero","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2483,"examples":null,"notes":null,"arglists":["x l o"],"doc":"A relation between l and o where x is removed from\n l exactly one time.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/rembero"},{"ns":"clojure.core.logic","name":"permuteo","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":1781,"examples":null,"notes":null,"arglists":["xl yl"],"doc":"A relation that will permute xl into the yl. May not\n terminate if xl is not ground.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/permuteo"},{"ns":"clojure.core.logic","name":"llist","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":878,"examples":null,"macro":true,"notes":null,"arglists":["f s","f s & rest"],"doc":"Constructs a sequence from 2 or more arguments, with the last argument as the\n tail. The tail is improper if the last argument is a logic variable.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/llist"},{"ns":"clojure.core.logic","name":"ext","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":220,"examples":null,"notes":null,"arglists":["s u v"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/ext"},{"ns":"clojure.core.logic","name":"onceo","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":1434,"examples":null,"notes":null,"arglists":["g"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/onceo"},{"ns":"clojure.core.logic","name":"run","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":1237,"examples":null,"macro":true,"notes":null,"arglists":["n bindings & goals"],"doc":"Executes goals until a maximum of n results are found.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/run"},{"ns":"clojure.core.logic","name":"unify-with-pmap*","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2497,"examples":null,"notes":null,"arglists":["u v s"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/unify-with-pmap*"},{"ns":"clojure.core.logic","name":"defnc","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":2653,"examples":null,"macro":true,"notes":null,"arglists":["name args & body"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/defnc"},{"ns":"clojure.core.logic","name":"tramp","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2695,"examples":null,"notes":null,"arglists":["f"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/tramp"},{"ns":"clojure.core.logic","name":"-\u003EPair","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":43,"examples":null,"notes":null,"arglists":["lhs rhs"],"doc":"Positional factory function for class clojure.core.logic.Pair.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/-\u003EPair"},{"ns":"clojure.core.logic","name":"mplus*","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":1072,"examples":null,"macro":true,"notes":null,"arglists":["e","e & e-rest"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/mplus*"},{"ns":"clojure.core.logic","name":"fnc","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":2611,"examples":null,"macro":true,"notes":null,"arglists":["args & body"],"doc":"Define an anonymous constraint that can be used with the unifier:\n\n (let [oddc (fnc [x] (odd? x))]\n\n (unifier {:a '?a} {:a 1} :when {'?a oddc})\n ;;=\u003E {:a 1}\n\n (unifier {:a '?a} {:a 2} :when {'?a oddc})\n ;;=\u003E nil\n )\n\n Note, the constraint will not run until all arguments are fully ground.\n\n Use defnc to define a constraint and assign a toplevel var.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/fnc"},{"ns":"clojure.core.logic","name":"run-nc","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":1257,"examples":null,"macro":true,"notes":null,"arglists":["n bindings & goals"],"doc":"Executes goals until a maximum of n results are found. Does not\n occurs-check.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/run-nc"},{"ns":"clojure.core.logic","name":"lcons","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":868,"examples":null,"notes":null,"arglists":["a d"],"doc":"Constructs a sequence a with an improper tail d if d is a logic variable.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/lcons"},{"ns":"clojure.core.logic","name":"solutions","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":1279,"examples":null,"notes":null,"arglists":["s g","s q g"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/solutions"},{"ns":"clojure.core.logic","name":"stopcg","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2057,"examples":null,"notes":null,"arglists":["c"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/stopcg"},{"ns":"clojure.core.logic","name":"copy-term","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":1439,"examples":null,"notes":null,"arglists":["u v"],"doc":"Copies a term u into v. Non-relational.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/copy-term"},{"ns":"clojure.core.logic","name":"disunify","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2290,"examples":null,"notes":null,"arglists":["s u v","s u v cs"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/disunify"},{"ns":"clojure.core.logic","name":"sort-by-strategy","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2223,"examples":null,"notes":null,"arglists":["v x a"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/sort-by-strategy"},{"ns":"clojure.core.logic","name":"add-dom","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":467,"examples":null,"notes":null,"arglists":["s x dom domv","s x dom domv seenset"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/add-dom"},{"ns":"clojure.core.logic","name":"fnm","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":1632,"examples":null,"macro":true,"notes":null,"arglists":["t as tabled? & cs"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/fnm"},{"ns":"clojure.core.logic","name":"pred","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":1336,"examples":null,"macro":true,"notes":null,"arglists":["v f"],"doc":"Check a predicate against the value logic var. Non-relational.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/pred"},{"ns":"clojure.core.logic","name":"sync-eset","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":455,"examples":null,"notes":null,"arglists":["s v seenset f"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/sync-eset"},{"ns":"clojure.core.logic","name":"is","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":1344,"examples":null,"macro":true,"notes":null,"arglists":["u v op"],"doc":"Set the value of a var to value of another var with the operation\n applied. Non-relational.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/is"},{"ns":"clojure.core.logic","name":"-\u003ELCons","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":755,"examples":null,"notes":null,"arglists":["a d cache meta"],"doc":"Positional factory function for class clojure.core.logic.LCons.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/-\u003ELCons"},{"ns":"clojure.core.logic","name":"umi","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":741,"examples":null,"macro":true,"notes":null,"arglists":["& args"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/umi"},{"ns":"clojure.core.logic","name":"assoc-meta","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":24,"examples":null,"notes":null,"arglists":["x k v"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/assoc-meta"},{"ns":"clojure.core.logic","name":"conda","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":1417,"examples":null,"macro":true,"notes":null,"arglists":["& clauses"],"doc":"Soft cut. Once the head of a clause has succeeded\n all other clauses will be ignored. Non-relational.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/conda"},{"ns":"clojure.core.logic","name":"run-constraints*","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2115,"examples":null,"notes":null,"arglists":["xs cs ws"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/run-constraints*"},{"ns":"clojure.core.logic","name":"let-dom","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":2211,"examples":null,"macro":true,"notes":null,"arglists":["a vars & body"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/let-dom"},{"ns":"clojure.core.logic","name":"-reify","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":263,"examples":null,"notes":null,"arglists":["s v","s v r"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/-reify"},{"ns":"clojure.core.logic","name":"run-constraint","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2070,"examples":null,"notes":null,"arglists":["c"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/run-constraint"},{"ns":"clojure.core.logic","name":"-\u003EConstraintStore","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":109,"examples":null,"notes":null,"arglists":["km cm cid running"],"doc":"Positional factory function for class clojure.core.logic.ConstraintStore.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/-\u003EConstraintStore"},{"ns":"clojure.core.logic","name":"make-suspended-stream","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":1854,"examples":null,"notes":null,"arglists":["cache ansv* f"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/make-suspended-stream"},{"ns":"clojure.core.logic","name":"tree-term?","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":884,"examples":null,"notes":null,"arglists":["x"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/tree-term_q"},{"ns":"clojure.core.logic","name":"fna","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":1718,"examples":null,"macro":true,"notes":null,"arglists":["& rest"],"doc":"Define an anonymous soft cut goal. See conda.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/fna"},{"ns":"clojure.core.logic","name":"*locals*","file":"clojure/core/logic.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":17,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/*locals*"},{"ns":"clojure.core.logic","name":"unbound-names","file":"clojure/core/logic.clj","type":"var","column":1,"see-alsos":null,"line":249,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/unbound-names"},{"ns":"clojure.core.logic","name":"member1o","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":1762,"examples":null,"notes":null,"arglists":["x l"],"doc":"Like membero but uses to disequality further constraining\n the results. For example, if x and l are ground and x occurs\n multiple times in l, member1o will succeed only once.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/member1o"},{"ns":"clojure.core.logic","name":"pair","file":"clojure/core/logic.clj","type":"var","column":1,"see-alsos":null,"line":214,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/pair"},{"ns":"clojure.core.logic","name":"walk-record-term","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":969,"examples":null,"notes":null,"arglists":["v f"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/walk-record-term"},{"ns":"clojure.core.logic","name":"lvaro","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":1448,"examples":null,"macro":true,"notes":null,"arglists":["v"],"doc":"A goal that succeeds if the argument is fresh. v must be a logic\n variable. Non-relational.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/lvaro"},{"ns":"clojure.core.logic","name":"map-\u003EPMap","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2518,"examples":null,"notes":null,"arglists":["m__8001__auto__"],"doc":"Factory function for class clojure.core.logic.PMap, taking a map of keywords to field values.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/map-\u003EPMap"},{"ns":"clojure.core.logic","name":"annotate","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":547,"examples":null,"notes":null,"arglists":["k v"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/annotate"},{"ns":"clojure.core.logic","name":"empty-f","file":"clojure/core/logic.clj","type":"var","column":1,"see-alsos":null,"line":538,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/empty-f"},{"ns":"clojure.core.logic","name":"-\u003ELVar","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":621,"examples":null,"notes":null,"arglists":["id unique name oname hash meta"],"doc":"Positional factory function for class clojure.core.logic.LVar.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/-\u003ELVar"},{"ns":"clojure.core.logic","name":"update-pvars!","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":1492,"examples":null,"notes":null,"arglists":["x vars"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/update-pvars!"},{"ns":"clojure.core.logic","name":"tabled","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":1997,"examples":null,"macro":true,"notes":null,"arglists":["args & grest"],"doc":"Macro for defining a tabled goal. Prefer ^:tabled with the\n defne/a/u forms over using this directly.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/tabled"},{"ns":"clojure.core.logic","name":"resto","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":1671,"examples":null,"notes":null,"arglists":["l d"],"doc":"A relation where l is a collection, such that d is the rest of l","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/resto"},{"ns":"clojure.core.logic","name":"ifu*","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":1369,"examples":null,"macro":true,"notes":null,"arglists":["","[e & gs] & grest"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/ifu*"},{"ns":"clojure.core.logic","name":"unify-with-sequential*","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":893,"examples":null,"notes":null,"arglists":["u v s"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/unify-with-sequential*"},{"ns":"clojure.core.logic","name":"add-attr","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":432,"examples":null,"notes":null,"arglists":["s x attr attrv"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/add-attr"},{"ns":"clojure.core.logic","name":"walk*","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":227,"examples":null,"notes":null,"arglists":["s v"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/walk*"},{"ns":"clojure.core.logic","name":"-\u003EAnswerCache","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":1818,"examples":null,"notes":null,"arglists":["ansl anss _meta"],"doc":"Positional factory function for class clojure.core.logic.AnswerCache.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/-\u003EAnswerCache"},{"ns":"clojure.core.logic","name":"enforceable-constrained","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2140,"examples":null,"notes":null,"arglists":["a"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/enforceable-constrained"},{"ns":"clojure.core.logic","name":"bindable?","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":732,"examples":null,"notes":null,"arglists":["x"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/bindable_q"},{"ns":"clojure.core.logic","name":"-\u003EChoice","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":1084,"examples":null,"notes":null,"arglists":["a f"],"doc":"Positional factory function for class clojure.core.logic.Choice.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/-\u003EChoice"},{"ns":"clojure.core.logic","name":"defne","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":1699,"examples":null,"macro":true,"notes":null,"arglists":["& rest"],"doc":"Define a goal fn. Supports pattern matching. All\n patterns will be tried. See conde.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/defne"},{"ns":"clojure.core.logic","name":"featurec","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2579,"examples":null,"notes":null,"arglists":["x fs"],"doc":"Ensure that a map contains at least the key-value pairs\n in the map fs. fs must be partially instantiated - that is,\n it may contain values which are logic variables to support\n feature extraction.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/featurec"},{"ns":"clojure.core.logic","name":"force-ans","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2273,"examples":null,"notes":null,"arglists":["x"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/force-ans"},{"ns":"clojure.core.logic","name":"normalize-store","file":"clojure/core/logic.clj","type":"var","column":1,"see-alsos":null,"line":2407,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/normalize-store"},{"ns":"clojure.core.logic","name":"update-dom","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":480,"examples":null,"notes":null,"arglists":["s x dom f","s x dom f seenset"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/update-dom"},{"ns":"clojure.core.logic","name":"membero","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":1755,"examples":null,"notes":null,"arglists":["x l"],"doc":"A relation where l is a collection, such that l contains x.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/membero"},{"ns":"clojure.core.logic","name":"merge-doms","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":558,"examples":null,"notes":null,"arglists":["s x doms"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/merge-doms"},{"ns":"clojure.core.logic","name":"matchu","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":1744,"examples":null,"macro":true,"notes":null,"arglists":["xs & cs"],"doc":"Define a committed choice goal. See condu.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/matchu"},{"ns":"clojure.core.logic","name":"fixc","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2871,"examples":null,"notes":null,"arglists":["x f reifier","x f runnable reifier"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/fixc"},{"ns":"clojure.core.logic","name":"lvar?","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":726,"examples":null,"notes":null,"arglists":["x"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/lvar_q"},{"ns":"clojure.core.logic","name":"answer-cache","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":1844,"examples":null,"notes":null,"arglists":[""],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/answer-cache"},{"ns":"clojure.core.logic","name":"run-constraints","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2105,"examples":null,"notes":null,"arglists":["xcs"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/run-constraints"},{"ns":"clojure.core.logic","name":"all","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":1268,"examples":null,"macro":true,"notes":null,"arglists":["","& goals"],"doc":"Like fresh but does does not create logic variables.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/all"},{"ns":"clojure.core.logic","name":"or*","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":1185,"examples":null,"notes":null,"arglists":["goals"],"doc":"A function version of conde, which takes a list of goals and tries them as if via conde.\n Note that or* only does disjunction, ie (or* [a b c]) is the same as (conde [a] [b] [c]).\n If you need something like (conde [a b] [c]), you can use and*, or all:\n (or* [(and* a b) c]).","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/or*"},{"ns":"clojure.core.logic","name":"-\u003EPMap","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2518,"examples":null,"notes":null,"arglists":[""],"doc":"Positional factory function for class clojure.core.logic.PMap.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/-\u003EPMap"},{"ns":"clojure.core.logic","name":"u#","file":"clojure/core/logic.clj","type":"var","column":1,"see-alsos":null,"line":1150,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/u#"},{"ns":"clojure.core.logic","name":"trace-lvar","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":1302,"examples":null,"notes":null,"arglists":["a lvar"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/trace-lvar"},{"ns":"clojure.core.logic","name":"add-var","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":178,"examples":null,"notes":null,"arglists":["cs x c"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/add-var"},{"ns":"clojure.core.logic","name":"to-s","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":543,"examples":null,"notes":null,"arglists":["v"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/to-s"},{"ns":"clojure.core.logic","name":"waiting-stream?","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":1860,"examples":null,"notes":null,"arglists":["x"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/waiting-stream_q"},{"ns":"clojure.core.logic","name":"-fnm","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":1628,"examples":null,"macro":true,"notes":null,"arglists":["fn-gen t as & cs"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/-fnm"},{"ns":"clojure.core.logic","name":"distribute","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2283,"examples":null,"notes":null,"arglists":["v* strategy"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/distribute"},{"ns":"clojure.core.logic","name":"occurs-check","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":216,"examples":null,"notes":null,"arglists":["s u v"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/occurs-check"},{"ns":"clojure.core.logic","name":"predc","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2687,"examples":null,"notes":null,"arglists":["x p","x p pform"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/predc"},{"ns":"clojure.core.logic","name":"entailed?","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2064,"examples":null,"notes":null,"arglists":["c c' a"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/entailed_q"},{"ns":"clojure.core.logic","name":"-\u003ESubstValue","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":197,"examples":null,"notes":null,"arglists":["v doms eset"],"doc":"Positional factory function for class clojure.core.logic.SubstValue.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/-\u003ESubstValue"},{"ns":"clojure.core.logic","name":"-featurec","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2549,"examples":null,"notes":null,"arglists":["x fs"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/-featurec"},{"ns":"clojure.core.logic","name":"rem-dom","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":494,"examples":null,"notes":null,"arglists":["s x dom","s x dom seenset"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/rem-dom"},{"ns":"clojure.core.logic","name":"update-eset","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":572,"examples":null,"notes":null,"arglists":["s doms eset"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/update-eset"},{"ns":"clojure.core.logic","name":"conso","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":1659,"examples":null,"notes":null,"arglists":["a d l"],"doc":"A relation where l is a collection, such that a is the first of l\n and d is the rest of l. If ground d must be bound to a proper tail.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/conso"},{"ns":"clojure.core.logic","name":"nilo","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":1649,"examples":null,"notes":null,"arglists":["a"],"doc":"A relation where a is nil","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/nilo"},{"ns":"clojure.core.logic","name":"nonlvaro","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":1456,"examples":null,"macro":true,"notes":null,"arglists":["v"],"doc":"A goal that succeeds if the argument is not fresh. v must be a\n logic variable. Non-relational.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/nonlvaro"},{"ns":"clojure.core.logic","name":"uai","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":747,"examples":null,"macro":true,"notes":null,"arglists":["& args"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/uai"},{"ns":"clojure.core.logic","name":"fail","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":1144,"examples":null,"notes":null,"arglists":["a"],"doc":"A goal that always fails.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/fail"},{"ns":"clojure.core.logic","name":"get-attr","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":450,"examples":null,"notes":null,"arglists":["s x attr"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/get-attr"},{"ns":"clojure.core.logic","name":"-fixc","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2843,"examples":null,"notes":null,"arglists":["x f reifier","x f runnable reifier"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/-fixc"},{"ns":"clojure.core.logic","name":"build","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":271,"examples":null,"notes":null,"arglists":["s u"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/build"},{"ns":"clojure.core.logic","name":"everyg","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":1677,"examples":null,"notes":null,"arglists":["g coll"],"doc":"A pseudo-relation that takes a coll and ensures that the goal g\n succeeds on every element of the collection.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/everyg"},{"ns":"clojure.core.logic","name":"project","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":1327,"examples":null,"macro":true,"notes":null,"arglists":["[& vars] & goals"],"doc":"Extract the values bound to the specified logic vars. Non-relational.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/project"},{"ns":"clojure.core.logic","name":"-run","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":1218,"examples":null,"macro":true,"notes":null,"arglists":["opts [x :as bindings] & goals"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/-run"},{"ns":"clojure.core.logic","name":"get-dom-fd","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2205,"examples":null,"notes":null,"arglists":["a x"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/get-dom-fd"},{"ns":"clojure.core.logic","name":"-nafc","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2701,"examples":null,"notes":null,"arglists":["c args"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/-nafc"},{"ns":"clojure.core.logic","name":"ifa*","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":1361,"examples":null,"macro":true,"notes":null,"arglists":["","[e & gs] & grest"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/ifa*"},{"ns":"clojure.core.logic","name":"trace-lvars","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":1305,"examples":null,"macro":true,"notes":null,"arglists":["title & lvars"],"doc":"Goal for tracing the values of logic variables.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/trace-lvars"},{"ns":"clojure.core.logic","name":"make-cs","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":188,"examples":null,"notes":null,"arglists":[""],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/make-cs"},{"ns":"clojure.core.logic","name":"-inc","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":1077,"examples":null,"macro":true,"notes":null,"arglists":["& rest"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/-inc"},{"ns":"clojure.core.logic","name":"fne","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":1693,"examples":null,"macro":true,"notes":null,"arglists":["& rest"],"doc":"Define an anonymous goal fn. Supports pattern matching. All\n patterns will be tried. See conde.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/fne"},{"ns":"clojure.core.logic","name":"lvars","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":729,"examples":null,"notes":null,"arglists":["n"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/lvars"},{"ns":"clojure.core.logic","name":"subst?","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":540,"examples":null,"notes":null,"arglists":["x"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/subst_q"},{"ns":"clojure.core.logic","name":"!=","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2458,"examples":null,"notes":null,"arglists":["u v"],"doc":"Disequality constraint. Ensures that u and v will never\n unify. u and v can be complex terms.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/!="},{"ns":"clojure.core.logic","name":"==","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":1156,"examples":null,"notes":null,"arglists":["u v"],"doc":"A goal that attempts to unify terms u and v.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/=="},{"ns":"clojure.core.logic","name":"env-locals","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":1625,"examples":null,"notes":null,"arglists":["& syms"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/env-locals"},{"ns":"clojure.core.logic","name":"conjo","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2802,"examples":null,"notes":null,"arglists":["coll & args"],"doc":"A constraint version of conj","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/conjo"},{"ns":"clojure.core.logic","name":"remcg","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2049,"examples":null,"notes":null,"arglists":["c"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/remcg"},{"ns":"clojure.core.logic","name":"dissoc-dom","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":33,"examples":null,"notes":null,"arglists":["x k"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/dissoc-dom"},{"ns":"clojure.core.logic","name":"suspended-stream?","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":1857,"examples":null,"notes":null,"arglists":["x"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/suspended-stream_q"},{"ns":"clojure.core.logic","name":"firsto","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":1665,"examples":null,"notes":null,"arglists":["l a"],"doc":"A relation where l is a collection, such that a is the first of l","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/firsto"},{"ns":"clojure.core.logic","name":"map-\u003ESuspendedStream","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":1849,"examples":null,"notes":null,"arglists":["m__8001__auto__"],"doc":"Factory function for class clojure.core.logic.SuspendedStream, taking a map of keywords to field values.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/map-\u003ESuspendedStream"},{"ns":"clojure.core.logic","name":"entangle","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":609,"examples":null,"notes":null,"arglists":["s x y"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/entangle"},{"ns":"clojure.core.logic","name":"run*","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":1242,"examples":null,"macro":true,"notes":null,"arglists":["bindings & goals"],"doc":"Executes goals until results are exhausted.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/run*"},{"ns":"clojure.core.logic","name":"-\u003ESuspendedStream","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":1849,"examples":null,"notes":null,"arglists":["cache ansv* f"],"doc":"Positional factory function for class clojure.core.logic.SuspendedStream.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/-\u003ESuspendedStream"},{"ns":"clojure.core.logic","name":"run-db","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":1247,"examples":null,"macro":true,"notes":null,"arglists":["n db bindings & goals"],"doc":"Executes goals until a maximum of n results are found. Uses a specified logic database.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/run-db"},{"ns":"clojure.core.logic","name":"ground-term?","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2590,"examples":null,"notes":null,"arglists":["x s"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/ground-term_q"},{"ns":"clojure.core.logic","name":"verify-all-bound","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2129,"examples":null,"notes":null,"arglists":["a constrained"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/verify-all-bound"},{"ns":"clojure.core.logic","name":"defnm","file":"clojure/core/logic.clj","type":"macro","column":1,"see-alsos":null,"line":1639,"examples":null,"macro":true,"notes":null,"arglists":["t n & rest"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/defnm"},{"ns":"clojure.core.logic","name":"fix-constraints","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2088,"examples":null,"notes":null,"arglists":["a"],"doc":"A goal to run the constraints in cq until it is empty. Of\n course running a constraint may grow cq so this function\n finds the fixpoint.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/fix-constraints"},{"ns":"clojure.core.logic","name":"subst-val?","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":202,"examples":null,"notes":null,"arglists":["x"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/subst-val_q"},{"ns":"clojure.core.logic","name":"map-\u003ESubstValue","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":197,"examples":null,"notes":null,"arglists":["m__8001__auto__"],"doc":"Factory function for class clojure.core.logic.SubstValue, taking a map of keywords to field values.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/map-\u003ESubstValue"},{"ns":"clojure.core.logic","name":"partial-map?","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":2542,"examples":null,"notes":null,"arglists":["x"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/partial-map_q"},{"ns":"clojure.core.logic","name":"succeed","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":1140,"examples":null,"notes":null,"arglists":["a"],"doc":"A goal that always succeeds.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/succeed"},{"ns":"clojure.core.logic","name":"subst-val","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":205,"examples":null,"notes":null,"arglists":["x","x doms","x doms _meta","x doms eset _meta"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/subst-val"},{"ns":"clojure.core.logic","name":"composeg","file":"clojure/core/logic.clj","type":"function","column":1,"see-alsos":null,"line":1053,"examples":null,"notes":null,"arglists":["","g0 g1"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic/composeg"},{"ns":"clojure.core.logic.fd","name":"interval","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":357,"examples":null,"notes":null,"arglists":["ub","lb ub"],"doc":"Construct an interval for an assignment to a var. intervals may\n be more efficient that the domain type when the range of possiblities\n is large.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/interval"},{"ns":"clojure.core.logic.fd","name":"domain","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":155,"examples":null,"notes":null,"arglists":["& args"],"doc":"Construct a domain for assignment to a var. Arguments should \n be integers given in sorted order. domains may be more efficient \n than intervals when only a few values are possible.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/domain"},{"ns":"clojure.core.logic.fd","name":"interval?","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":351,"examples":null,"notes":null,"arglists":["x"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/interval_q"},{"ns":"clojure.core.logic.fd","name":"-\u003EFiniteDomain","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":64,"examples":null,"notes":null,"arglists":["s min max"],"doc":"Positional factory function for class clojure.core.logic.fd.FiniteDomain.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/-\u003EFiniteDomain"},{"ns":"clojure.core.logic.fd","name":"!=c","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":755,"examples":null,"notes":null,"arglists":["u v"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/!=c"},{"ns":"clojure.core.logic.fd","name":"domc","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":718,"examples":null,"notes":null,"arglists":["x"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/domc"},{"ns":"clojure.core.logic.fd","name":"-member?","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["this n"],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/-member_q"},{"ns":"clojure.core.logic.fd","name":"-\u003EMultiIntervalFD","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":477,"examples":null,"notes":null,"arglists":["min max is"],"doc":"Positional factory function for class clojure.core.logic.fd.MultiIntervalFD.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/-\u003EMultiIntervalFD"},{"ns":"clojure.core.logic.fd","name":"\u003C","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":825,"examples":null,"notes":null,"arglists":["u v"],"doc":"A finite domain constraint. u must be less than v. u and v\n must eventually be given domains if vars.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/\u003C"},{"ns":"clojure.core.logic.fd","name":"get-dom","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":591,"examples":null,"notes":null,"arglists":["a x"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/get-dom"},{"ns":"clojure.core.logic.fd","name":"expand","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":1113,"examples":null,"notes":null,"arglists":["form"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/expand"},{"ns":"clojure.core.logic.fd","name":"dom","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":631,"examples":null,"notes":null,"arglists":["x dom"],"doc":"Assign a var x a domain.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/dom"},{"ns":"clojure.core.logic.fd","name":"-\u003EIntervalFD","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":231,"examples":null,"notes":null,"arglists":["lb ub"],"doc":"Positional factory function for class clojure.core.logic.fd.IntervalFD.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/-\u003EIntervalFD"},{"ns":"clojure.core.logic.fd","name":"resolve-storable-dom","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":607,"examples":null,"notes":null,"arglists":["a x dom domp"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/resolve-storable-dom"},{"ns":"clojure.core.logic.fd","name":"difference*","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":408,"examples":null,"notes":null,"arglists":["is js"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/difference*"},{"ns":"clojure.core.logic.fd","name":"bounded-listo","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":1085,"examples":null,"notes":null,"arglists":["l n"],"doc":"Ensure that the list l never grows beyond bound n.\n n must have been assigned a domain.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/bounded-listo"},{"ns":"clojure.core.logic.fd","name":"map-sum","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":658,"examples":null,"notes":null,"arglists":["f"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/map-sum"},{"ns":"clojure.core.logic.fd","name":"ext-dom-fd","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":597,"examples":null,"notes":null,"arglists":["a x dom domp"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/ext-dom-fd"},{"ns":"clojure.core.logic.fd","name":"in","file":"clojure/core/logic/fd.clj","type":"macro","column":1,"see-alsos":null,"line":646,"examples":null,"macro":true,"notes":null,"arglists":["& xs-and-dom"],"doc":"Assign vars to domain. The domain must come last.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/in"},{"ns":"clojure.core.logic.fd","name":"distinctc","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":1042,"examples":null,"notes":null,"arglists":["v*"],"doc":"The real distinct constraint. v* can be seq of logic vars and\n values or it can be a logic var itself. This constraint does not \n run until v* has become ground. When it has become ground we group\n v* into a set of logic vars and a sorted set of known singleton \n values. We then construct the individual constraint for each var.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/distinctc"},{"ns":"clojure.core.logic.fd","name":"multi-interval","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":573,"examples":null,"notes":null,"arglists":["","i0","i0 i1","i0 i1 & ir"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/multi-interval"},{"ns":"clojure.core.logic.fd","name":"-intervals","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["this"],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/-intervals"},{"ns":"clojure.core.logic.fd","name":"-intersection","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["this that"],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/-intersection"},{"ns":"clojure.core.logic.fd","name":"\u003C=","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":819,"examples":null,"notes":null,"arglists":["u v"],"doc":"A finite domain constraint. u must be less than or equal to v.\n u and v must eventually be given domains if vars.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/\u003C="},{"ns":"clojure.core.logic.fd","name":"normalize-intervals","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":561,"examples":null,"notes":null,"arglists":["is"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/normalize-intervals"},{"ns":"clojure.core.logic.fd","name":"intersection*","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":369,"examples":null,"notes":null,"arglists":["is js"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/intersection*"},{"ns":"clojure.core.logic.fd","name":"*","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":976,"examples":null,"notes":null,"arglists":["x y product"],"doc":"A finite domain constraint for multiplication and\n thus division. x, y & product must be eventually be given \n domains if vars.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/*"},{"ns":"clojure.core.logic.fd","name":"-drop-one","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["this"],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/-drop-one"},{"ns":"clojure.core.logic.fd","name":"interval-\u003C","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":42,"examples":null,"notes":null,"arglists":["i j"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/interval-\u003C"},{"ns":"clojure.core.logic.fd","name":"-distinct","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":1028,"examples":null,"notes":null,"arglists":["x y* n*"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/-distinct"},{"ns":"clojure.core.logic.fd","name":"singleton-dom?","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":604,"examples":null,"notes":null,"arglists":["x"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/singleton-dom_q"},{"ns":"clojure.core.logic.fd","name":"\u003C=c","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":792,"examples":null,"notes":null,"arglists":["u v"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/\u003C=c"},{"ns":"clojure.core.logic.fd","name":"quot","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":983,"examples":null,"notes":null,"arglists":["u v w"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/quot"},{"ns":"clojure.core.logic.fd","name":"binops-\u003Efd","file":"clojure/core/logic/fd.clj","type":"var","column":1,"see-alsos":null,"line":1099,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/binops-\u003Efd"},{"ns":"clojure.core.logic.fd","name":"eq","file":"clojure/core/logic/fd.clj","type":"macro","column":1,"see-alsos":null,"line":1156,"examples":null,"macro":true,"notes":null,"arglists":["& forms"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/eq"},{"ns":"clojure.core.logic.fd","name":"eq-form","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":1151,"examples":null,"notes":null,"arglists":["form"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/eq-form"},{"ns":"clojure.core.logic.fd","name":"\u003E","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":833,"examples":null,"notes":null,"arglists":["u v"],"doc":"A finite domain constraint. u must be greater than v. u and v\n must eventually be given domains if vars.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/\u003E"},{"ns":"clojure.core.logic.fd","name":"IInterval","file":"clojure/core/logic/fd.clj","type":"var","column":1,"see-alsos":null,"line":16,"examples":null,"notes":null,"arglists":[],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/IInterval"},{"ns":"clojure.core.logic.fd","name":"eq*","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":1122,"examples":null,"notes":null,"arglists":["form vars","form vars out"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/eq*"},{"ns":"clojure.core.logic.fd","name":"-drop-before","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["this n"],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/-drop-before"},{"ns":"clojure.core.logic.fd","name":"process-dom","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":616,"examples":null,"notes":null,"arglists":["x dom domp"],"doc":"If x is a var we update its domain. If it's an integer\n we check that it's a member of the given domain. dom is\n then new domain, it should have already been calculated from\n domp which was the previous domain.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/process-dom"},{"ns":"clojure.core.logic.fd","name":"ISet","file":"clojure/core/logic/fd.clj","type":"var","column":1,"see-alsos":null,"line":28,"examples":null,"notes":null,"arglists":[],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/ISet"},{"ns":"clojure.core.logic.fd","name":"-","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":906,"examples":null,"notes":null,"arglists":["u v w"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/-"},{"ns":"clojure.core.logic.fd","name":"sorted-set-\u003Edomain","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":148,"examples":null,"notes":null,"arglists":["s"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/sorted-set-\u003Edomain"},{"ns":"clojure.core.logic.fd","name":"interval-\u003C=","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":45,"examples":null,"notes":null,"arglists":["i j"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/interval-\u003C="},{"ns":"clojure.core.logic.fd","name":"-domc","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":692,"examples":null,"notes":null,"arglists":["x"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/-domc"},{"ns":"clojure.core.logic.fd","name":"list-sorted?","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":1031,"examples":null,"notes":null,"arglists":["pred ls"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/list-sorted_q"},{"ns":"clojure.core.logic.fd","name":"-lb","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["this"],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/-lb"},{"ns":"clojure.core.logic.fd","name":"==c","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":721,"examples":null,"notes":null,"arglists":["u v"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/==c"},{"ns":"clojure.core.logic.fd","name":"extend-to-fd","file":"clojure/core/logic/fd.clj","type":"macro","column":1,"see-alsos":null,"line":169,"examples":null,"macro":true,"notes":null,"arglists":["t"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/extend-to-fd"},{"ns":"clojure.core.logic.fd","name":"-disjoint?","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["this that"],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/-disjoint_q"},{"ns":"clojure.core.logic.fd","name":"disjoint?*","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":449,"examples":null,"notes":null,"arglists":["is js"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/disjoint_q*"},{"ns":"clojure.core.logic.fd","name":"\u003E=","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":839,"examples":null,"notes":null,"arglists":["u v"],"doc":"A finite domain constraint. u must be greater than or equal to v.\n u and v must eventually be given domains if vars.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/\u003E="},{"ns":"clojure.core.logic.fd","name":"distinct","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":1077,"examples":null,"notes":null,"arglists":["v*"],"doc":"A finite domain constraint that will guarantee that \n all vars that occur in v* will be unified with unique \n values. v* need not be ground. Any vars in v* should\n eventually be given a domain.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/distinct"},{"ns":"clojure.core.logic.fd","name":"-distinctc","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":986,"examples":null,"notes":null,"arglists":["x y* n*"],"doc":"The real *individual* distinct constraint. x is a var that now is bound to\n a single value. y* were the non-singleton bound vars that existed at the\n construction of the constraint. n* is the set of singleton domain values \n that existed at the construction of the constraint. We use categorize to \n determine the current non-singleton bound vars and singleton vlaues. if x\n is in n* or the new singletons we have failed. If not we simply remove \n the value of x from the remaining non-singleton domains bound to vars.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/-distinctc"},{"ns":"clojure.core.logic.fd","name":"bounds","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":39,"examples":null,"notes":null,"arglists":["i"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/bounds"},{"ns":"clojure.core.logic.fd","name":"interval-\u003E=","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":51,"examples":null,"notes":null,"arglists":["i j"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/interval-\u003E="},{"ns":"clojure.core.logic.fd","name":"to-vals","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":668,"examples":null,"notes":null,"arglists":["dom"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/to-vals"},{"ns":"clojure.core.logic.fd","name":"-difference","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["this that"],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/-difference"},{"ns":"clojure.core.logic.fd","name":"-\u003Efd","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":1147,"examples":null,"notes":null,"arglists":["vars exprs"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/-\u003Efd"},{"ns":"clojure.core.logic.fd","name":"interval-\u003E","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":48,"examples":null,"notes":null,"arglists":["i j"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/interval-\u003E"},{"ns":"clojure.core.logic.fd","name":"+","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":900,"examples":null,"notes":null,"arglists":["x y sum"],"doc":"A finite domain constraint for addition and subtraction.\n x, y & sum must eventually be given domains if vars.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/+"},{"ns":"clojure.core.logic.fd","name":"-ub","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["this"],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/-ub"},{"ns":"clojure.core.logic.fd","name":"binops","file":"clojure/core/logic/fd.clj","type":"var","column":1,"see-alsos":null,"line":1111,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/binops"},{"ns":"clojure.core.logic.fd","name":"unify-with-domain*","file":"clojure/core/logic/fd.clj","type":"var","column":1,"see-alsos":null,"line":34,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/unify-with-domain*"},{"ns":"clojure.core.logic.fd","name":"finite-domain?","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":145,"examples":null,"notes":null,"arglists":["x"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/finite-domain_q"},{"ns":"clojure.core.logic.fd","name":"!=","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":786,"examples":null,"notes":null,"arglists":["u v"],"doc":"A finite domain constraint. u and v must not be equal. u and v\n must eventually be given domains if vars.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/!="},{"ns":"clojure.core.logic.fd","name":"==","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":749,"examples":null,"notes":null,"arglists":["u v"],"doc":"A finite domain constraint. u and v must be equal. u and v must\n eventually be given domains if vars.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/=="},{"ns":"clojure.core.logic.fd","name":"*c","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":913,"examples":null,"notes":null,"arglists":["u v w"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/*c"},{"ns":"clojure.core.logic.fd","name":"ISortedDomain","file":"clojure/core/logic/fd.clj","type":"var","column":1,"see-alsos":null,"line":23,"examples":null,"notes":null,"arglists":[],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/ISortedDomain"},{"ns":"clojure.core.logic.fd","name":"-keep-before","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["this n"],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/-keep-before"},{"ns":"clojure.core.logic.fd","name":"IIntervals","file":"clojure/core/logic/fd.clj","type":"var","column":1,"see-alsos":null,"line":20,"examples":null,"notes":null,"arglists":[],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/IIntervals"},{"ns":"clojure.core.logic.fd","name":"+c","file":"clojure/core/logic/fd.clj","type":"function","column":1,"see-alsos":null,"line":849,"examples":null,"notes":null,"arglists":["u v w"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.fd/+c"},{"ns":"clojure.core.logic.pldb","name":"with-dbs","file":"clojure/core/logic/pldb.clj","type":"macro","column":1,"see-alsos":null,"line":8,"examples":null,"macro":true,"notes":null,"arglists":["dbs & body"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.pldb/with-dbs"},{"ns":"clojure.core.logic.pldb","name":"db","file":"clojure/core/logic/pldb.clj","type":"function","column":1,"see-alsos":null,"line":125,"examples":null,"notes":null,"arglists":["& facts"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.pldb/db"},{"ns":"clojure.core.logic.pldb","name":"index-for-query","file":"clojure/core/logic/pldb.clj","type":"function","column":1,"see-alsos":null,"line":41,"examples":null,"notes":null,"arglists":["s q indexes"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.pldb/index-for-query"},{"ns":"clojure.core.logic.pldb","name":"indexed?","file":"clojure/core/logic/pldb.clj","type":"function","column":1,"see-alsos":null,"line":31,"examples":null,"notes":null,"arglists":["v"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.pldb/indexed_q"},{"ns":"clojure.core.logic.pldb","name":"db-facts","file":"clojure/core/logic/pldb.clj","type":"function","column":1,"see-alsos":null,"line":122,"examples":null,"notes":null,"arglists":["base-db & facts"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.pldb/db-facts"},{"ns":"clojure.core.logic.pldb","name":"facts-for","file":"clojure/core/logic/pldb.clj","type":"function","column":1,"see-alsos":null,"line":16,"examples":null,"notes":null,"arglists":["dbs kname"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.pldb/facts-for"},{"ns":"clojure.core.logic.pldb","name":"contains-lvar?","file":"clojure/core/logic/pldb.clj","type":"function","column":1,"see-alsos":null,"line":35,"examples":null,"notes":null,"arglists":["x"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.pldb/contains-lvar_q"},{"ns":"clojure.core.logic.pldb","name":"empty-db","file":"clojure/core/logic/pldb.clj","type":"var","column":1,"see-alsos":null,"line":6,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.pldb/empty-db"},{"ns":"clojure.core.logic.pldb","name":"ground?","file":"clojure/core/logic/pldb.clj","type":"function","column":1,"see-alsos":null,"line":38,"examples":null,"notes":null,"arglists":["s term"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.pldb/ground_q"},{"ns":"clojure.core.logic.pldb","name":"rel-key","file":"clojure/core/logic/pldb.clj","type":"function","column":1,"see-alsos":null,"line":23,"examples":null,"notes":null,"arglists":["rel"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.pldb/rel-key"},{"ns":"clojure.core.logic.pldb","name":"db-rel","file":"clojure/core/logic/pldb.clj","type":"macro","column":1,"see-alsos":null,"line":48,"examples":null,"macro":true,"notes":null,"arglists":["name & args"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.pldb/db-rel"},{"ns":"clojure.core.logic.pldb","name":"rel-indexes","file":"clojure/core/logic/pldb.clj","type":"function","column":1,"see-alsos":null,"line":28,"examples":null,"notes":null,"arglists":["rel"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.pldb/rel-indexes"},{"ns":"clojure.core.logic.pldb","name":"facts-using-index","file":"clojure/core/logic/pldb.clj","type":"function","column":1,"see-alsos":null,"line":19,"examples":null,"notes":null,"arglists":["dbs kname index val"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.pldb/facts-using-index"},{"ns":"clojure.core.logic.pldb","name":"db-retractions","file":"clojure/core/logic/pldb.clj","type":"function","column":1,"see-alsos":null,"line":128,"examples":null,"notes":null,"arglists":["base-db & retractions"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.pldb/db-retractions"},{"ns":"clojure.core.logic.pldb","name":"db-fact","file":"clojure/core/logic/pldb.clj","type":"function","column":1,"see-alsos":null,"line":79,"examples":null,"notes":null,"arglists":["db rel & args"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.pldb/db-fact"},{"ns":"clojure.core.logic.pldb","name":"with-db","file":"clojure/core/logic/pldb.clj","type":"macro","column":1,"see-alsos":null,"line":12,"examples":null,"macro":true,"notes":null,"arglists":["db & body"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.pldb/with-db"},{"ns":"clojure.core.logic.pldb","name":"db-retraction","file":"clojure/core/logic/pldb.clj","type":"function","column":1,"see-alsos":null,"line":100,"examples":null,"notes":null,"arglists":["db rel & args"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.logic.pldb/db-retraction"},{"ns":"clojure.core.protocols","name":"IKVReduce","file":"clojure/core/protocols.clj","type":"var","column":1,"see-alsos":null,"line":174,"examples":null,"notes":null,"arglists":[],"doc":"Protocol for concrete associative types that can reduce themselves\n via a function of key and val faster than first/next recursion over map\n entries. Called by clojure.core/reduce-kv, and has same\n semantics (just different arg order).","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.protocols/IKVReduce"},{"ns":"clojure.core.protocols","name":"Navigable","file":"clojure/core/protocols.clj","type":"var","column":1,"see-alsos":null,"line":193,"examples":null,"notes":null,"arglists":[],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.protocols/Navigable"},{"ns":"clojure.core.protocols","name":"nav","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["coll k v"],"doc":"return (possibly transformed) v in the context of coll and k (a key/index or nil),\ndefaults to returning v.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.protocols/nav"},{"ns":"clojure.core.protocols","name":"Datafiable","file":"clojure/core/protocols.clj","type":"var","column":1,"see-alsos":null,"line":181,"examples":null,"notes":null,"arglists":[],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.protocols/Datafiable"},{"ns":"clojure.core.protocols","name":"CollReduce","file":"clojure/core/protocols.clj","type":"var","column":1,"see-alsos":null,"line":13,"examples":null,"notes":null,"arglists":[],"doc":"Protocol for collection types that can implement reduce faster than\n first/next recursion. Called by clojure.core/reduce. Baseline\n implementation defined in terms of Iterable.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.protocols/CollReduce"},{"ns":"clojure.core.protocols","name":"datafy","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["o"],"doc":"return a representation of o as data (default identity)","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.protocols/datafy"},{"ns":"clojure.core.protocols","name":"coll-reduce","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["coll f","coll f val"],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.protocols/coll-reduce"},{"ns":"clojure.core.protocols","name":"internal-reduce","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["seq f start"],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.protocols/internal-reduce"},{"ns":"clojure.core.protocols","name":"iterator-reduce!","file":"clojure/core/protocols.clj","type":"function","column":1,"see-alsos":null,"line":34,"examples":null,"notes":null,"arglists":["iter f","iter f val"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.protocols/iterator-reduce!"},{"ns":"clojure.core.protocols","name":"InternalReduce","file":"clojure/core/protocols.clj","type":"var","column":1,"see-alsos":null,"line":19,"examples":null,"notes":[{"updated-at":1386465477000,"body":"http://muhammadkhojaye.blogspot.com","created-at":1386465477000,"author":{"login":"peternortan","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c7d95a3a7a7090ffdc29428a2c424b17?r=PG&default=identicon"},"_id":"542692edf6e94c6970522014"}],"arglists":[],"doc":"Protocol for concrete seq types that can reduce themselves\n faster than first/next recursion. Called by clojure.core/reduce.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.protocols/InternalReduce"},{"ns":"clojure.core.protocols","name":"kv-reduce","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["amap f init"],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.protocols/kv-reduce"},{"ns":"clojure.core.reducers","name":"reduce","file":"clojure/core/reducers.clj","type":"function","column":1,"see-alsos":null,"line":38,"examples":null,"notes":null,"arglists":["f coll","f init coll"],"doc":"Like core/reduce except:\n When init is not provided, (f) is used.\n Maps are reduced with reduce-kv","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.reducers/reduce"},{"added":"1.5","ns":"clojure.core.reducers","name":"take","file":"clojure/core/reducers.clj","type":"function","column":1,"see-alsos":null,"line":201,"examples":null,"notes":null,"arglists":["n","n coll"],"doc":"Ends the reduction of coll after consuming n values.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.reducers/take"},{"added":"1.5","ns":"clojure.core.reducers","name":"map","file":"clojure/core/reducers.clj","type":"function","column":1,"see-alsos":null,"line":128,"examples":null,"notes":null,"arglists":["f","f coll"],"doc":"Applies f to every value in the reduction of coll. Foldable.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.reducers/map"},{"added":"1.5","ns":"clojure.core.reducers","name":"foldcat","file":"clojure/core/reducers.clj","type":"function","column":1,"see-alsos":null,"line":281,"examples":null,"notes":null,"arglists":["coll"],"doc":"Equivalent to (fold cat append! coll)","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.reducers/foldcat"},{"added":"1.5","ns":"clojure.core.reducers","name":"reducer","file":"clojure/core/reducers.clj","type":"function","column":1,"see-alsos":null,"line":67,"examples":null,"notes":null,"arglists":["coll xf"],"doc":"Given a reducible collection, and a transformation function xf,\n returns a reducible collection, where any supplied reducing\n fn will be transformed by xf. xf is a function of reducing fn to\n reducing fn.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.reducers/reducer"},{"added":"1.5","ns":"clojure.core.reducers","name":"mapcat","file":"clojure/core/reducers.clj","type":"function","column":1,"see-alsos":null,"line":138,"examples":null,"notes":null,"arglists":["f","f coll"],"doc":"Applies f to every value in the reduction of coll, concatenating the result\n colls of (f val). Foldable.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.reducers/mapcat"},{"added":"1.5","ns":"clojure.core.reducers","name":"cat","file":"clojure/core/reducers.clj","type":"function","column":1,"see-alsos":null,"line":255,"examples":null,"notes":null,"arglists":["","ctor","left right"],"doc":"A high-performance combining fn that yields the catenation of the\n reduced values. The result is reducible, foldable, seqable and\n counted, providing the identity collections are reducible, seqable\n and counted. The single argument version will build a combining fn\n with the supplied identity constructor. Tests for identity\n with (zero? (count x)). See also foldcat.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.reducers/cat"},{"added":"1.5","ns":"clojure.core.reducers","name":"take-while","file":"clojure/core/reducers.clj","type":"function","column":1,"see-alsos":null,"line":189,"examples":null,"notes":null,"arglists":["pred","pred coll"],"doc":"Ends the reduction of coll when (pred val) returns logical false.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.reducers/take-while"},{"added":"1.5","ns":"clojure.core.reducers","name":"remove","file":"clojure/core/reducers.clj","type":"function","column":1,"see-alsos":null,"line":167,"examples":null,"notes":null,"arglists":["pred","pred coll"],"doc":"Removes values in the reduction of coll for which (pred val)\n returns logical true. Foldable.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.reducers/remove"},{"ns":"clojure.core.reducers","name":"pool","file":"clojure/core/reducers.clj","type":"var","column":1,"see-alsos":null,"line":22,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.reducers/pool"},{"ns":"clojure.core.reducers","name":"CollFold","file":"clojure/core/reducers.clj","type":"var","column":1,"see-alsos":null,"line":48,"examples":null,"notes":null,"arglists":[],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.reducers/CollFold"},{"added":"1.5","ns":"clojure.core.reducers","name":"folder","file":"clojure/core/reducers.clj","type":"function","column":1,"see-alsos":null,"line":81,"examples":null,"notes":null,"arglists":["coll xf"],"doc":"Given a foldable collection, and a transformation function xf,\n returns a foldable collection, where any supplied reducing\n fn will be transformed by xf. xf is a function of reducing fn to\n reducing fn.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.reducers/folder"},{"added":"1.5","ns":"clojure.core.reducers","name":"append!","file":"clojure/core/reducers.clj","type":"function","column":1,"see-alsos":null,"line":275,"examples":null,"notes":null,"arglists":["acc x"],"doc":".adds x to acc and returns acc","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.reducers/append!"},{"ns":"clojure.core.reducers","name":"-\u003ECat","file":"clojure/core/reducers.clj","type":"function","column":1,"see-alsos":null,"line":230,"examples":null,"notes":null,"arglists":["cnt left right"],"doc":"Positional factory function for class clojure.core.reducers.Cat.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.reducers/-\u003ECat"},{"added":"1.5","ns":"clojure.core.reducers","name":"drop","file":"clojure/core/reducers.clj","type":"function","column":1,"see-alsos":null,"line":215,"examples":null,"notes":null,"arglists":["n","n coll"],"doc":"Elides the first n values from the reduction of coll.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.reducers/drop"},{"added":"1.5","ns":"clojure.core.reducers","name":"fold","file":"clojure/core/reducers.clj","type":"function","column":1,"see-alsos":null,"line":51,"examples":null,"notes":null,"arglists":["reducef coll","combinef reducef coll","n combinef reducef coll"],"doc":"Reduces a collection using a (potentially parallel) reduce-combine\n strategy. The collection is partitioned into groups of approximately\n n (default 512), each of which is reduced with reducef (with a seed\n value obtained by calling (combinef) with no arguments). The results\n of these reductions are then reduced with combinef (default\n reducef). combinef must be associative, and, when called with no\n arguments, (combinef) must produce its identity element. These\n operations may be performed in parallel, but the results will\n preserve order.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.reducers/fold"},{"added":"1.5","ns":"clojure.core.reducers","name":"flatten","file":"clojure/core/reducers.clj","type":"function","column":1,"see-alsos":null,"line":174,"examples":null,"notes":null,"arglists":["","coll"],"doc":"Takes any nested combination of sequential things (lists, vectors,\n etc.) and returns their contents as a single, flat foldable\n collection.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.reducers/flatten"},{"added":"1.5","ns":"clojure.core.reducers","name":"filter","file":"clojure/core/reducers.clj","type":"function","column":1,"see-alsos":null,"line":154,"examples":null,"notes":null,"arglists":["pred","pred coll"],"doc":"Retains values in the reduction of coll for which (pred val)\n returns logical true. Foldable.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.reducers/filter"},{"ns":"clojure.core.reducers","name":"fjtask","file":"clojure/core/reducers.clj","type":"function","column":1,"see-alsos":null,"line":24,"examples":null,"notes":null,"arglists":["f"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.reducers/fjtask"},{"added":"1.5","ns":"clojure.core.reducers","name":"monoid","file":"clojure/core/reducers.clj","type":"function","column":1,"see-alsos":null,"line":287,"examples":null,"notes":null,"arglists":["op ctor"],"doc":"Builds a combining fn out of the supplied operator and identity\n constructor. op must be associative and ctor called with no args\n must return an identity value for it.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.reducers/monoid"},{"ns":"clojure.core.reducers","name":"coll-fold","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["coll n combinef reducef"],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.reducers/coll-fold"},{"ns":"clojure.core.server","name":"stop-server","file":"clojure/core/server.clj","type":"function","column":1,"see-alsos":null,"line":126,"examples":null,"notes":null,"arglists":["","name"],"doc":"Stop server with name or use the server-name from *session* if none supplied.\n Returns true if server stopped successfully, nil if not found, or throws if\n there is an error closing the socket.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.server/stop-server"},{"ns":"clojure.core.server","name":"repl-init","file":"clojure/core/server.clj","type":"function","column":1,"see-alsos":null,"line":166,"examples":null,"notes":null,"arglists":[""],"doc":"Initialize repl in user namespace and make standard repl requires.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.server/repl-init"},{"ns":"clojure.core.server","name":"start-server","file":"clojure/core/server.clj","type":"function","column":1,"see-alsos":null,"line":85,"examples":null,"notes":null,"arglists":["opts"],"doc":"Start a socket server given the specified opts:\n :address Host or address, string, defaults to loopback address\n :port Port, integer, required\n :name Name, required\n :accept Namespaced symbol of the accept function to invoke, required\n :args Vector of args to pass to accept function\n :bind-err Bind *err* to socket out stream?, defaults to true\n :server-daemon Is server thread a daemon?, defaults to true\n :client-daemon Are client threads daemons?, defaults to true\n Returns server socket.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.server/start-server"},{"ns":"clojure.core.server","name":"start-servers","file":"clojure/core/server.clj","type":"function","column":1,"see-alsos":null,"line":160,"examples":null,"notes":null,"arglists":["system-props"],"doc":"Start all servers specified in the system properties.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.server/start-servers"},{"ns":"clojure.core.server","name":"stop-servers","file":"clojure/core/server.clj","type":"function","column":1,"see-alsos":null,"line":140,"examples":null,"notes":null,"arglists":[""],"doc":"Stop all servers ignores all errors, and returns nil.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.server/stop-servers"},{"ns":"clojure.core.server","name":"repl-read","file":"clojure/core/server.clj","type":"function","column":1,"see-alsos":null,"line":172,"examples":null,"notes":null,"arglists":["request-prompt request-exit"],"doc":"Enhanced :read hook for repl supporting :repl/quit.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.server/repl-read"},{"ns":"clojure.core.server","name":"*session*","file":"clojure/core/server.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":24,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.core.server/*session*"},{"added":"1.10","ns":"clojure.core.server","name":"io-prepl","file":"clojure/core/server.clj","type":"function","column":1,"see-alsos":null,"line":275,"examples":null,"notes":null,"arglists":["& {:keys [valf], :or {valf pr-str}}"],"doc":"prepl bound to *in* and *out*, suitable for use with e.g. server/repl (socket-repl).\n :ret and :tap vals will be processed by valf, a fn of one argument\n or a symbol naming same (default pr-str)\n\n Alpha, subject to change.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.server/io-prepl"},{"added":"1.10","ns":"clojure.core.server","name":"prepl","file":"clojure/core/server.clj","type":"function","column":1,"see-alsos":null,"line":194,"examples":null,"notes":null,"arglists":["in-reader out-fn & {:keys [stdin]}"],"doc":"a REPL with structured output (for programs)\n reads forms to eval from in-reader (a LineNumberingPushbackReader)\n Closing the input or passing the form :repl/quit will cause it to return\n\n Calls out-fn with data, one of:\n {:tag :ret\n :val val ;;eval result, or Throwable-\u003Emap data if exception thrown\n :ns ns-name-string\n :ms long ;;eval time in milliseconds\n :form string ;;iff successfully read\n :exception true ;;iff exception thrown\n }\n {:tag :out\n :val string} ;chars from during-eval *out*\n {:tag :err\n :val string} ;chars from during-eval *err*\n {:tag :tap\n :val val} ;values from tap\u003E\n\n You might get more than one :out or :err per eval, but exactly one :ret\n tap output can happen at any time (i.e. between evals)\n If during eval an attempt is made to read *in* it will read from in-reader unless :stdin is supplied\n\n Alpha, subject to change.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.server/prepl"},{"ns":"clojure.core.server","name":"repl","file":"clojure/core/server.clj","type":"function","column":1,"see-alsos":null,"line":183,"examples":null,"notes":null,"arglists":[""],"doc":"REPL with predefined hooks for attachable socket server.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.server/repl"},{"added":"1.10","ns":"clojure.core.server","name":"remote-prepl","file":"clojure/core/server.clj","type":"function","column":1,"see-alsos":null,"line":298,"examples":null,"notes":null,"arglists":["host port in-reader out-fn & {:keys [valf readf], :or {valf read-string, readf (fn* [p1__9123# p2__9124#] (read p1__9123# false p2__9124#))}}"],"doc":"Implements a prepl on in-reader and out-fn by forwarding to a\n remote [io-]prepl over a socket. Messages will be read by readf, a\n fn of a LineNumberingPushbackReader and EOF value or a symbol naming\n same (default #(read %1 false %2)),\n :ret and :tap vals will be processed by valf, a fn of one argument\n or a symbol naming same (default read-string). If that function\n throws, :val will be unprocessed.\n\n Alpha, subject to change.","library-url":"https://github.com/clojure/clojure","href":"/clojure.core.server/remote-prepl"},{"added":"1.3","ns":"clojure.data","name":"diff","file":"clojure/data.clj","type":"function","column":1,"see-alsos":null,"line":124,"examples":[{"author":{"login":"joshrotenberg","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/aa968cafce96d1810cb1014c7545d4a5?r=PG&default=identicon"},"editors":[],"body":"(use 'clojure.data)\n(def uno {:same \"same\", :different \"one\"})\n(def dos {:same \"same\", :different \"two\", :onlyhere \"whatever\"})\n(diff uno dos)\n=\u003E ({:different \"one\"} {:onlyhere \"whatever\", :different \"two\"} {:same \"same\"})\n;; {different in uno} { different or unique in dos } {same in both}\n(diff {:a 1} {:a 1 :b 2})\n=\u003E (nil {:b 2} {:a 1})\n;; the first contains nothing unique, but only the second contains :b\n;; and both contain :a","created-at":1321070124000,"updated-at":1321070124000,"_id":"542692d6c026201cdc3270d7"}],"notes":null,"arglists":["a b"],"doc":"Recursively compares a and b, returning a tuple of\n [things-only-in-a things-only-in-b things-in-both].\n Comparison rules:\n\n * For equal a and b, return [nil nil a].\n * Maps are subdiffed where keys match and values differ.\n * Sets are never subdiffed.\n * All sequential things are treated as associative collections\n by their indexes, with results returned as vectors.\n * Everything else (including strings!) is treated as\n an atom and compared for equality.","library-url":"https://github.com/clojure/clojure","href":"/clojure.data/diff"},{"added":"1.3","ns":"clojure.data","name":"equality-partition","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["x"],"doc":"Implementation detail. Subject to change.","library-url":"https://github.com/clojure/clojure","href":"/clojure.data/equality-partition"},{"added":"1.3","ns":"clojure.data","name":"EqualityPartition","file":"clojure/data.clj","type":"var","column":1,"see-alsos":null,"line":69,"examples":null,"notes":null,"arglists":[],"doc":"Implementation detail. Subject to change.","library-url":"https://github.com/clojure/clojure","href":"/clojure.data/EqualityPartition"},{"added":"1.3","ns":"clojure.data","name":"diff-similar","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["a b"],"doc":"Implementation detail. Subject to change.","library-url":"https://github.com/clojure/clojure","href":"/clojure.data/diff-similar"},{"added":"1.3","ns":"clojure.data","name":"Diff","file":"clojure/data.clj","type":"var","column":1,"see-alsos":null,"line":73,"examples":null,"notes":null,"arglists":[],"doc":"Implementation detail. Subject to change.","library-url":"https://github.com/clojure/clojure","href":"/clojure.data/Diff"},{"ns":"clojure.data.csv","name":"read-csv","file":"clojure/data/csv.clj","type":"function","column":1,"see-alsos":null,"line":87,"examples":null,"notes":null,"arglists":["input & options"],"doc":"Reads CSV-data from input (String or java.io.Reader) into a lazy\n sequence of vectors.\n\n Valid options are\n :separator (default \\,)\n :quote (default \\\")","library-url":"https://github.com/clojure/clojure","href":"/clojure.data.csv/read-csv"},{"ns":"clojure.data.csv","name":"Read-CSV-From","file":"clojure/data/csv.clj","type":"var","column":1,"see-alsos":null,"line":66,"examples":null,"notes":null,"arglists":[],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.data.csv/Read-CSV-From"},{"ns":"clojure.data.csv","name":"read-csv-from","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["input sep quote"],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.data.csv/read-csv-from"},{"ns":"clojure.data.csv","name":"write-csv","file":"clojure/data/csv.clj","type":"function","column":1,"see-alsos":null,"line":127,"examples":null,"notes":null,"arglists":["writer data & options"],"doc":"Writes data to writer in CSV-format.\n\n Valid options are\n :separator (Default \\,)\n :quote (Default \\\")\n :quote? (A predicate function which determines if a string should be quoted. Defaults to quoting only when necessary.)\n :newline (:lf (default) or :cr+lf)","library-url":"https://github.com/clojure/clojure","href":"/clojure.data.csv/write-csv"},{"ns":"clojure.datafy","name":"nav","file":"clojure/datafy.clj","type":"function","column":1,"see-alsos":null,"line":30,"examples":null,"notes":null,"arglists":["coll k v"],"doc":"Returns (possibly transformed) v in the context of coll and k (a\n key/index or nil). Callers should attempt to provide the key/index\n context k for Indexed/Associative/ILookup colls if possible, but not\n to fabricate one e.g. for sequences (pass nil). nav returns the\n value of clojure.core.protocols/nav.","library-url":"https://github.com/clojure/clojure","href":"/clojure.datafy/nav"},{"ns":"clojure.datafy","name":"datafy","file":"clojure/datafy.clj","type":"function","column":1,"see-alsos":null,"line":15,"examples":null,"notes":null,"arglists":["x"],"doc":"Attempts to return x as data.\n datafy will return the value of clojure.core.protocols/datafy. If\n the value has been transformed and the result supports\n metadata, :clojure.datafy/obj will be set on the metadata to the\n original value of x, and :clojure.datafy/class to the name of the\n class of x, as a symbol.","library-url":"https://github.com/clojure/clojure","href":"/clojure.datafy/datafy"},{"added":"1.5","ns":"clojure.edn","name":"read","file":"clojure/edn.clj","type":"function","column":1,"see-alsos":null,"line":14,"examples":null,"notes":null,"arglists":["","stream","opts stream"],"doc":"Reads the next object from stream, which must be an instance of\n java.io.PushbackReader or some derivee. stream defaults to the\n current value of *in*.\n\n Reads data in the edn format (subset of Clojure data):\n http://edn-format.org\n\n opts is a map that can include the following keys:\n :eof - value to return on end-of-file. When not supplied, eof throws an exception.\n :readers - a map of tag symbols to data-reader functions to be considered before default-data-readers.\n When not supplied, only the default-data-readers will be used.\n :default - A function of two args, that will, if present and no reader is found for a tag,\n be called with the tag and the value.","library-url":"https://github.com/clojure/clojure","href":"/clojure.edn/read"},{"added":"1.5","ns":"clojure.edn","name":"read-string","file":"clojure/edn.clj","type":"function","column":1,"see-alsos":[{"created-at":1412284709546,"author":{"login":"phreed","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/211644?v=2"},"to-var":{"ns":"clojure.edn","name":"read","library-url":"https://github.com/clojure/clojure"},"_id":"542dc125e4b05f4d257a2994"},{"created-at":1412284813516,"author":{"login":"phreed","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/211644?v=2"},"to-var":{"ns":"clojure.core","name":"prn-str","library-url":"https://github.com/clojure/clojure"},"_id":"542dc18de4b05f4d257a2998"}],"line":37,"examples":[{"body":";; The following code is a subset of that found at\n;; http://www.compoundtheory.com/clojure-edn-walkthrough\n;; It illustrates the fact that the readers \n;; 'read' and 'read-string' have symmetric writers\n;; 'prn' and 'prn-str'.\n\n(ns edn-example.core\n (require [clojure.edn :as edn]))\n \n(def sample-map {:foo \"bar\" :bar \"foo\"})\n \n;; Here you can see that the 'prn-str' is the writer...\n(defn convert-sample-map-to-edn\n \"Converting a Map to EDN\"\n []\n ;; yep, converting a map to EDN is that simple\"\n (prn-str sample-map))\n \n(println \"Let's convert a map to EDN: \" (convert-sample-map-to-edn))\n;=\u003E Let's convert a map to EDN: {:foo \"bar\", :bar \"foo\"}\n \n;; ...and the reader is 'read-string'\n(println \"Now let's covert the map back: \" (edn/read-string (convert-sample-map-to-edn)))\n;=\u003E Now let's covert the map back: {:foo bar, :bar foo}","author":{"login":"phreed","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/211644?v=2"},"created-at":1412284690591,"updated-at":1412285328892,"editors":[{"login":"phreed","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/211644?v=2"}],"_id":"542dc112e4b05f4d257a2993"}],"notes":null,"arglists":["s","opts s"],"doc":"Reads one object from the string s. Returns nil when s is nil or empty.\n\n Reads data in the edn format (subset of Clojure data):\n http://edn-format.org\n\n opts is a map as per clojure.edn/read","library-url":"https://github.com/clojure/clojure","href":"/clojure.edn/read-string"},{"added":"1.0","ns":"clojure.inspector","name":"inspect-table","file":"clojure/inspector.clj","type":"function","column":1,"see-alsos":[{"created-at":1331449134000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.pprint","name":"print-table","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521aff"},{"created-at":1331449142000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.inspector","name":"inspect-tree","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b00"}],"line":100,"examples":null,"notes":null,"arglists":["data"],"doc":"creates a graphical (Swing) inspector on the supplied regular\n data, which must be a sequential data structure of data structures\n of equal length","library-url":"https://github.com/clojure/clojure","href":"/clojure.inspector/inspect-table"},{"ns":"clojure.inspector","name":"atom?","file":"clojure/inspector.clj","type":"function","column":1,"see-alsos":[{"created-at":1341044327000,"author":{"login":"klauern","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/76c55292df5e9df9042eaf89ac35954b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"isa?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d24"}],"line":19,"examples":[{"author":{"login":"OnesimusUnbound","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fa4c391db0d2d1744cc2cd0d787dd3d?r=PG&default=identicon"},"editors":[],"body":";; atom? returns true if the form passed does not \n;; implement IPersistentCollection. The atom referred \n;; here is not the atom used in managing mutable state \n\nuser=\u003E (use `[clojure.inspector :include (atom?)])\n\nuser=\u003E (atom? 1)\ntrue\n\nuser=\u003E (atom? \\a)\ntrue\n\nuser=\u003E (atom? \"hello world\")\ntrue\n\nuser=\u003E (atom? :keyword)\ntrue\n\nuser=\u003E (atom? nil)\ntrue\n\nuser=\u003E (atom? '())\nfalse\n\nuser=\u003E (atom? [1, 3, 5])\nfalse\n\nuser=\u003E (atom? #{\\a \\e \\i \\o \\u})\nfalse\n\nuser=\u003E (atom? {:x 16 :y 25})\nfalse","created-at":1313787533000,"updated-at":1313787533000,"_id":"542692d0c026201cdc326eb1"}],"notes":null,"arglists":["x"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.inspector/atom_q"},{"ns":"clojure.inspector","name":"list-provider","file":"clojure/inspector.clj","type":"var","column":1,"see-alsos":null,"line":112,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.inspector/list-provider"},{"ns":"clojure.inspector","name":"is-leaf","file":"clojure/inspector.clj","type":"var","column":1,"see-alsos":null,"line":31,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.inspector/is-leaf"},{"ns":"clojure.inspector","name":"old-table-model","file":"clojure/inspector.clj","type":"function","column":1,"see-alsos":null,"line":72,"examples":null,"notes":null,"arglists":["data"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.inspector/old-table-model"},{"ns":"clojure.inspector","name":"tree-model","file":"clojure/inspector.clj","type":"function","column":1,"see-alsos":null,"line":56,"examples":null,"notes":null,"arglists":["data"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.inspector/tree-model"},{"added":"1.0","ns":"clojure.inspector","name":"inspect","file":"clojure/inspector.clj","type":"function","column":1,"see-alsos":null,"line":154,"examples":null,"notes":null,"arglists":["x"],"doc":"creates a graphical (Swing) inspector on the supplied object","library-url":"https://github.com/clojure/clojure","href":"/clojure.inspector/inspect"},{"ns":"clojure.inspector","name":"collection-tag","file":"clojure/inspector.clj","type":"function","column":1,"see-alsos":null,"line":22,"examples":null,"notes":null,"arglists":["x"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.inspector/collection-tag"},{"ns":"clojure.inspector","name":"get-child-count","file":"clojure/inspector.clj","type":"var","column":1,"see-alsos":null,"line":33,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.inspector/get-child-count"},{"added":"1.0","ns":"clojure.inspector","name":"inspect-tree","file":"clojure/inspector.clj","type":"function","column":1,"see-alsos":[{"created-at":1331449151000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.inspector","name":"inspect-table","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f47"}],"line":91,"examples":null,"notes":null,"arglists":["data"],"doc":"creates a graphical (Swing) inspector on the supplied hierarchical data","library-url":"https://github.com/clojure/clojure","href":"/clojure.inspector/inspect-tree"},{"ns":"clojure.inspector","name":"get-child","file":"clojure/inspector.clj","type":"var","column":1,"see-alsos":null,"line":32,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.inspector/get-child"},{"ns":"clojure.inspector","name":"list-model","file":"clojure/inspector.clj","type":"function","column":1,"see-alsos":null,"line":129,"examples":null,"notes":null,"arglists":["provider"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.inspector/list-model"},{"ns":"clojure.inspector","name":"table-model","file":"clojure/inspector.clj","type":"var","column":1,"see-alsos":null,"line":139,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.inspector/table-model"},{"ns":"clojure.instant","name":"validated","file":"clojure/instant.clj","type":"function","column":1,"see-alsos":null,"line":139,"examples":null,"notes":null,"arglists":["new-instance"],"doc":"Return a function which constructs an instant by calling constructor\nafter first validating that those arguments are in range and otherwise\nplausible. The resulting function will throw an exception if called\nwith invalid arguments.","library-url":"https://github.com/clojure/clojure","href":"/clojure.instant/validated"},{"ns":"clojure.instant","name":"read-instant-timestamp","file":"clojure/instant.clj","type":"function","column":1,"see-alsos":null,"line":288,"examples":null,"notes":null,"arglists":["cs"],"doc":"To read an instant as a java.sql.Timestamp, bind *data-readers* to a\nmap with this var as the value for the 'inst key. Timestamp preserves\nfractional seconds with nanosecond precision. The timezone offset will\nbe used to convert into UTC.","library-url":"https://github.com/clojure/clojure","href":"/clojure.instant/read-instant-timestamp"},{"ns":"clojure.instant","name":"read-instant-calendar","file":"clojure/instant.clj","type":"function","column":1,"see-alsos":null,"line":281,"examples":null,"notes":null,"arglists":["cs"],"doc":"To read an instant as a java.util.Calendar, bind *data-readers* to a map with\nthis var as the value for the 'inst key. Calendar preserves the timezone\noffset.","library-url":"https://github.com/clojure/clojure","href":"/clojure.instant/read-instant-calendar"},{"ns":"clojure.instant","name":"read-instant-date","file":"clojure/instant.clj","type":"function","column":1,"see-alsos":null,"line":274,"examples":null,"notes":null,"arglists":["cs"],"doc":"To read an instant as a java.util.Date, bind *data-readers* to a map with\nthis var as the value for the 'inst key. The timezone offset will be used\nto convert into UTC.","library-url":"https://github.com/clojure/clojure","href":"/clojure.instant/read-instant-date"},{"ns":"clojure.instant","name":"parse-timestamp","file":"clojure/instant.clj","type":"function","column":1,"see-alsos":null,"line":53,"examples":null,"notes":null,"arglists":["new-instant cs"],"doc":"Parse a string containing an RFC3339-like like timestamp.\n\nThe function new-instant is called with the following arguments.\n\n min max default\n --- ------------ -------\n years 0 9999 N/A (s must provide years)\n months 1 12 1\n days 1 31 1 (actual max days depends\n hours 0 23 0 on month and year)\n minutes 0 59 0\n seconds 0 60 0 (though 60 is only valid\n nanoseconds 0 999999999 0 when minutes is 59)\n offset-sign -1 1 0\n offset-hours 0 23 0\n offset-minutes 0 59 0\n\nThese are all integers and will be non-nil. (The listed defaults\nwill be passed if the corresponding field is not present in s.)\n\nGrammar (of s):\n\n date-fullyear = 4DIGIT\n date-month = 2DIGIT ; 01-12\n date-mday = 2DIGIT ; 01-28, 01-29, 01-30, 01-31 based on\n ; month/year\n time-hour = 2DIGIT ; 00-23\n time-minute = 2DIGIT ; 00-59\n time-second = 2DIGIT ; 00-58, 00-59, 00-60 based on leap second\n ; rules\n time-secfrac = '.' 1*DIGIT\n time-numoffset = ('+' / '-') time-hour ':' time-minute\n time-offset = 'Z' / time-numoffset\n\n time-part = time-hour [ ':' time-minute [ ':' time-second\n [time-secfrac] [time-offset] ] ]\n\n timestamp = date-year [ '-' date-month [ '-' date-mday\n [ 'T' time-part ] ] ]\n\nUnlike RFC3339:\n\n - we only parse the timestamp format\n - timestamp can elide trailing components\n - time-offset is optional (defaults to +00:00)\n\nThough time-offset is syntactically optional, a missing time-offset\nwill be treated as if the time-offset zero (+00:00) had been\nspecified.\n","library-url":"https://github.com/clojure/clojure","href":"/clojure.instant/parse-timestamp"},{"added":"1.2","ns":"clojure.java.browse","name":"browse-url","file":"clojure/java/browse.clj","type":"function","column":1,"see-alsos":null,"line":68,"examples":[{"author":{"login":"abhin4v","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4d29918c109bc75d2a1fd8420660d72b?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (use 'clojure.java.browse)\n\nuser=\u003E (browse-url \"http://clojuredocs.org\")\n","created-at":1283270758000,"updated-at":1285494149000,"_id":"542692d0c026201cdc326eb2"}],"notes":null,"arglists":["url"],"doc":"Open url in a browser","library-url":"https://github.com/clojure/clojure","href":"/clojure.java.browse/browse-url"},{"ns":"clojure.java.browse","name":"*open-url-script*","file":"clojure/java/browse.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":42,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.java.browse/*open-url-script*"},{"ns":"clojure.java.io","name":"default-streams-impl","file":"clojure/java/io.clj","type":"var","column":1,"see-alsos":null,"line":167,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.java.io/default-streams-impl"},{"added":"1.2","ns":"clojure.java.io","name":"make-output-stream","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["x opts"],"doc":"Creates a BufferedOutputStream. See also IOFactory docs.","library-url":"https://github.com/clojure/clojure","href":"/clojure.java.io/make-output-stream"},{"added":"1.2","ns":"clojure.java.io","name":"make-parents","file":"clojure/java/io.clj","type":"function","column":1,"see-alsos":null,"line":441,"examples":null,"notes":null,"arglists":["f & more"],"doc":"Given the same arg(s) as for file, creates all parent directories of\n the file they represent.","library-url":"https://github.com/clojure/clojure","href":"/clojure.java.io/make-parents"},{"added":"1.2","ns":"clojure.java.io","name":"delete-file","file":"clojure/java/io.clj","type":"function","column":1,"see-alsos":[{"created-at":1329988386000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.java.io","name":"file","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cb9"},{"created-at":1329988390000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.java.io","name":"copy","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cba"}],"line":433,"examples":[{"author":{"login":"shockbob","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/16046bb426a0fd26cbc876970fd8f746?r=PG&default=identicon"},"editors":[],"body":";; create a file using spit, then show its contents using slurp\n;; delete it and verify that it has been deleted by trying to print its\n;; contents again\n\nuser=\u003E (require '[clojure.java.io :as io])\nnil\nuser=\u003E (spit \"stuff.txt\" \"blurp\")\nnil\nuser=\u003E (println (slurp \"stuff.txt\"))\nblurp\nnil\nuser=\u003E (io/delete-file \"stuff.txt\")\ntrue\nuser=\u003E (println (slurp \"stuff.txt\"))\njava.io.FileNotFoundException: stuff.txt (The system cannot find the file specif\nied) (NO_SOURCE_FILE:0)\nuser=\u003E","created-at":1313906436000,"updated-at":1313906436000,"_id":"542692d0c026201cdc326eb9"}],"notes":null,"arglists":["f & [silently]"],"doc":"Delete file f. If silently is nil or false, raise an exception on failure, else return the value of silently.","library-url":"https://github.com/clojure/clojure","href":"/clojure.java.io/delete-file"},{"added":"1.2","ns":"clojure.java.io","name":"input-stream","file":"clojure/java/io.clj","type":"function","column":1,"see-alsos":[{"created-at":1329988244000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.java.io","name":"reader","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521a9b"},{"created-at":1329988273000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.java.io","name":"output-stream","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521a9c"},{"created-at":1329988761000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.java.io","name":"IOFactory","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521a9d"},{"created-at":1331903198000,"author":{"login":"Pierre","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/dc0590890ca22fee047f8e2598c2568d?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"with-open","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521a9e"},{"created-at":1331903424000,"author":{"login":"Pierre","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/dc0590890ca22fee047f8e2598c2568d?r=PG&default=identicon"},"to-var":{"ns":"clojure.java.io","name":"make-input-stream","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521a9f"}],"line":124,"examples":null,"notes":null,"tag":"java.io.InputStream","arglists":["x & opts"],"doc":"Attempts to coerce its argument into an open java.io.InputStream.\n Default implementations always return a java.io.BufferedInputStream.\n\n Default implementations are defined for InputStream, File, URI, URL,\n Socket, byte array, and String arguments.\n\n If the argument is a String, it tries to resolve it first as a URI, then\n as a local file name. URIs with a 'file' protocol are converted to\n local file names.\n\n Should be used inside with-open to ensure the InputStream is properly\n closed.","library-url":"https://github.com/clojure/clojure","href":"/clojure.java.io/input-stream"},{"added":"1.2","ns":"clojure.java.io","name":"make-writer","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["x opts"],"doc":"Creates a BufferedWriter. See also IOFactory docs.","library-url":"https://github.com/clojure/clojure","href":"/clojure.java.io/make-writer"},{"added":"1.2","ns":"clojure.java.io","name":"as-relative-path","file":"clojure/java/io.clj","type":"function","column":1,"see-alsos":null,"line":411,"examples":null,"notes":null,"tag":"java.lang.String","arglists":["x"],"doc":"Take an as-file-able thing and return a string if it is\n a relative path, else IllegalArgumentException.","library-url":"https://github.com/clojure/clojure","href":"/clojure.java.io/as-relative-path"},{"added":"1.2","ns":"clojure.java.io","name":"copy","file":"clojure/java/io.clj","type":"function","column":1,"see-alsos":[{"created-at":1329988342000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.java.io","name":"file","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ccd"}],"line":394,"examples":[{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"}],"body":"(ns your-project\n (:require [clojure.java.io :as io]))\n\n(defn copy-file [source-path dest-path]\n (io/copy (io/file source-path) (io/file dest-path)))\n\n(copy-file \"/home/username/squirrel.txt\" \"/home/username/burt-reynolds.txt\")","created-at":1306503567000,"updated-at":1360648156000,"_id":"542692d0c026201cdc326eb4"}],"notes":null,"arglists":["input output & opts"],"doc":"Copies input to output. Returns nil or throws IOException.\n Input may be an InputStream, Reader, File, byte[], char[], or String.\n Output may be an OutputStream, Writer, or File.\n\n Options are key/value pairs and may be one of\n\n :buffer-size buffer size to use, default is 1024.\n :encoding encoding to use if converting between\n byte and char streams. \n\n Does not close any streams except those it opens itself \n (on a File).","library-url":"https://github.com/clojure/clojure","href":"/clojure.java.io/copy"},{"added":"1.2","ns":"clojure.java.io","name":"as-file","type":"function","see-alsos":[{"created-at":1332830735000,"author":{"login":"eric","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2b0c9ae6f1da9716451e7c86bc87230b?r=PG&default=identicon"},"to-var":{"ns":"clojure.java.io","name":"file","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521eb4"}],"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (use 'clojure.java.io)\nuser=\u003E (.exists (as-file \"myfile.txt\"))\nfalse","created-at":1285050867000,"updated-at":1332951931000,"_id":"542692d0c026201cdc326eba"}],"notes":null,"tag":"java.io.File","arglists":["x"],"doc":"Coerce argument to a file.","library-url":"https://github.com/clojure/clojure","href":"/clojure.java.io/as-file"},{"added":"1.2","ns":"clojure.java.io","name":"output-stream","file":"clojure/java/io.clj","type":"function","column":1,"see-alsos":[{"created-at":1329988282000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.java.io","name":"writer","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b21"},{"created-at":1329988289000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.java.io","name":"input-stream","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b22"},{"created-at":1329988768000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.java.io","name":"IOFactory","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b23"}],"line":141,"examples":[{"author":{"login":"Omer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/dae0f434afde5246ccb030cdec81fb71?r=PG&default=identicon"},"editors":[{"login":"Omer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/dae0f434afde5246ccb030cdec81fb71?r=PG&default=identicon"}],"body":"(:use [clojure.java.io :only [output-stream]])\n\n(defn use-output-stream []\n (with-open [o (output-stream \"test.txt\")]\n (.write o 65))) ; Writes 'A'","created-at":1338273014000,"updated-at":1338273742000,"_id":"542692d6c026201cdc3270d9"}],"notes":null,"tag":"java.io.OutputStream","arglists":["x & opts"],"doc":"Attempts to coerce its argument into an open java.io.OutputStream.\n Default implementations always return a java.io.BufferedOutputStream.\n\n Default implementations are defined for OutputStream, File, URI, URL,\n Socket, and String arguments.\n\n If the argument is a String, it tries to resolve it first as a URI, then\n as a local file name. URIs with a 'file' protocol are converted to\n local file names.\n\n Should be used inside with-open to ensure the OutputStream is\n properly closed.","library-url":"https://github.com/clojure/clojure","href":"/clojure.java.io/output-stream"},{"added":"1.2","ns":"clojure.java.io","name":"make-reader","type":"function","see-alsos":null,"examples":null,"notes":[{"updated-at":1393559963000,"body":"Don't use this. You probably want [reader](reader) instead.","created-at":1393559963000,"author":{"login":"TheAlchemist","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/43b98f8119f22e58791a57950145b051?r=PG&default=identicon"},"_id":"542692edf6e94c697052201e"}],"tag":null,"arglists":["x opts"],"doc":"Creates a BufferedReader. See also IOFactory docs.","library-url":"https://github.com/clojure/clojure","href":"/clojure.java.io/make-reader"},{"added":"1.2","ns":"clojure.java.io","name":"Coercions","file":"clojure/java/io.clj","type":"var","column":1,"see-alsos":null,"line":38,"examples":null,"notes":null,"arglists":[],"doc":"Coerce between various 'resource-namish' things.","library-url":"https://github.com/clojure/clojure","href":"/clojure.java.io/Coercions"},{"added":"1.2","ns":"clojure.java.io","name":"file","file":"clojure/java/io.clj","type":"function","column":1,"see-alsos":[{"created-at":1329988433000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"file-seq","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dfc"},{"created-at":1329988641000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.java.io","name":"reader","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dfd"},{"created-at":1329988645000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.java.io","name":"writer","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dfe"},{"created-at":1330337356000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.java.io","name":"delete-file","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dff"}],"line":421,"examples":[{"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"editors":[],"body":"user\u003E (clojure.java.io/file \"/tmp/foo\")\n#\u003CFile /tmp/foo\u003E\n\nuser\u003E (clojure.java.io/file \"http://asdf.com\")\n#\u003CFile http:/asdf.com\u003E\n\nuser\u003E (clojure.java.io/file \"/tmp/foo\" \"bar\")\n#\u003CFile /tmp/foo/bar\u003E","created-at":1293673542000,"updated-at":1293673542000,"_id":"542692d0c026201cdc326eb7"},{"author":{"login":"cloojure","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1ad3de25d00d953de6e8c82f554cdbf5?r=PG&default=identicon"},"editors":[],"body":"; Use clojure.java.io to read in resources from the classpath\n\n(ns rescue.core\n (:require [clojure.java.io :as io] ))\n\n; Populate the file on the command line: \n; echo \"Hello Resources!\" \u003E resources/hello.txt\n(def data-file (io/file\n (io/resource \n \"hello.txt\" )))\n(defn -main []\n (println (slurp data-file)) )\n; When do \"lein run\"\n; =\u003E Hello Resources!","created-at":1399010194000,"updated-at":1399010194000,"_id":"542692d6c026201cdc3270d8"}],"notes":null,"tag":"java.io.File","arglists":["arg","parent child","parent child & more"],"doc":"Returns a java.io.File, passing each arg to as-file. Multiple-arg\n versions treat the first argument as parent and subsequent args as\n children relative to the parent.","library-url":"https://github.com/clojure/clojure","href":"/clojure.java.io/file"},{"added":"1.2","ns":"clojure.java.io","name":"make-input-stream","type":"function","see-alsos":[{"created-at":1331903445000,"author":{"login":"Pierre","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/dc0590890ca22fee047f8e2598c2568d?r=PG&default=identicon"},"to-var":{"ns":"clojure.java.io","name":"IOFactory","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d61"}],"examples":null,"notes":null,"tag":null,"arglists":["x opts"],"doc":"Creates a BufferedInputStream. See also IOFactory docs.","library-url":"https://github.com/clojure/clojure","href":"/clojure.java.io/make-input-stream"},{"added":"1.2","ns":"clojure.java.io","name":"IOFactory","file":"clojure/java/io.clj","type":"var","column":1,"see-alsos":[{"created-at":1329988722000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.java.io","name":"reader","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bdc"},{"created-at":1329988725000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.java.io","name":"writer","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bdd"},{"created-at":1329988729000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.java.io","name":"input-stream","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bde"},{"created-at":1329988733000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.java.io","name":"output-stream","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bdf"}],"line":72,"examples":null,"notes":null,"arglists":[],"doc":"Factory functions that create ready-to-use, buffered versions of\n the various Java I/O stream types, on top of anything that can\n be unequivocally converted to the requested kind of stream.\n\n Common options include\n \n :append true to open stream in append mode\n :encoding string name of encoding to use, e.g. \"UTF-8\".\n\n Callers should generally prefer the higher level API provided by\n reader, writer, input-stream, and output-stream.","library-url":"https://github.com/clojure/clojure","href":"/clojure.java.io/IOFactory"},{"added":"1.2","ns":"clojure.java.io","name":"resource","file":"clojure/java/io.clj","type":"function","column":1,"see-alsos":null,"line":449,"examples":[{"author":{"login":"cloojure","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1ad3de25d00d953de6e8c82f554cdbf5?r=PG&default=identicon"},"editors":[{"login":"cloojure","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1ad3de25d00d953de6e8c82f554cdbf5?r=PG&default=identicon"}],"body":"; Use clojure.java.io/resource to read resources from the classpath:\n\n(ns rescue.core\n (:require [clojure.java.io :as io] ))\n\n; Populate the file on the command line: \n; echo \"Hello Resources!\" \u003E resources/hello.txt\n(def data-file (io/file\n (io/resource \n \"hello.txt\" )))\n(defn -main []\n (println (slurp data-file)) )\n; When do \"lein run\"\n; =\u003E Hello Resources!","created-at":1399010149000,"updated-at":1399010240000,"_id":"542692d6c026201cdc3270dc"}],"notes":null,"tag":"java.net.URL","arglists":["n","n loader"],"doc":"Returns the URL for a named resource. Use the context class loader\n if no loader is specified.","library-url":"https://github.com/clojure/clojure","href":"/clojure.java.io/resource"},{"added":"1.2","ns":"clojure.java.io","name":"writer","file":"clojure/java/io.clj","type":"function","column":1,"see-alsos":[{"created-at":1324516890000,"author":{"login":"cgray","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7fe6255dbe4806a588cc06a5ba4a5d82?r=PG&default=identicon"},"to-var":{"ns":"clojure.java.io","name":"reader","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e40"},{"created-at":1329988746000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.java.io","name":"IOFactory","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e41"},{"created-at":1330170599000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.java.io","name":"output-stream","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e42"},{"created-at":1334795963000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"spit","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e43"}],"line":107,"examples":[{"author":{"login":"weiyongqing123","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8341059515e9e257bbb8da3c9fc158c2?r=PG&default=identicon"},"editors":[],"body":"(defn write-file []\n (with-open [w (clojure.java.io/writer \"f:/w.txt\" :append true)]\n (.write w (str \"hello\" \"world\"))))","created-at":1329302480000,"updated-at":1329302480000,"_id":"542692d6c026201cdc3270de"}],"notes":null,"tag":"java.io.Writer","arglists":["x & opts"],"doc":"Attempts to coerce its argument into an open java.io.Writer.\n Default implementations always return a java.io.BufferedWriter.\n\n Default implementations are provided for Writer, BufferedWriter,\n OutputStream, File, URI, URL, Socket, and String.\n\n If the argument is a String, it tries to resolve it first as a URI, then\n as a local file name. URIs with a 'file' protocol are converted to\n local file names.\n\n Should be used inside with-open to ensure the Writer is properly\n closed.","library-url":"https://github.com/clojure/clojure","href":"/clojure.java.io/writer"},{"added":"1.2","ns":"clojure.java.io","name":"as-url","type":"function","see-alsos":null,"examples":[{"author":{"login":"Jeff Rose","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/567898c496278341be69087507d5ed24?r=PG&default=identicon"},"editors":[],"body":"(use '[clojure.java.io :only (as-url)])\n(import 'java.io.File)\n\nuser=\u003E (as-url nil)\nnil\n\nuser=\u003E (as-url (File. \"/tmp\"))\n#\u003CURL file:/tmp/\u003E\n\nuser=\u003E (as-url \"http://clojuredocs.org\")\n#\u003CURL http://clojuredocs.org\u003E\n\nuser=\u003E (as-url \"http://clojuredocs.org:8080\")\n#\u003CURL http://clojuredocs.org:8080\u003E\n\nuser=\u003E (as-url \"clojuredocs.org\")\n#\u003CCompilerException java.net.MalformedURLException: no protocol: clojuredocs.org\u003E\n\n\n\n\n\n","created-at":1306270061000,"updated-at":1306270061000,"_id":"542692d0c026201cdc326ebc"}],"notes":null,"tag":"java.net.URL","arglists":["x"],"doc":"Coerce argument to a URL.","library-url":"https://github.com/clojure/clojure","href":"/clojure.java.io/as-url"},{"added":"1.2","ns":"clojure.java.io","name":"reader","file":"clojure/java/io.clj","type":"function","column":1,"see-alsos":[{"created-at":1324516916000,"author":{"login":"cgray","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7fe6255dbe4806a588cc06a5ba4a5d82?r=PG&default=identicon"},"to-var":{"ns":"clojure.java.io","name":"writer","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cce"},{"created-at":1329988254000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.java.io","name":"input-stream","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ccf"},{"created-at":1329988703000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.java.io","name":"IOFactory","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cd0"},{"created-at":1334796117000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"slurp","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cd1"}],"line":89,"examples":[{"author":{"login":"steveminer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d28543d134185d12d4006a74738d233e?r=PG&default=identicon"},"editors":[],"body":"(with-open [rdr (clojure.java.io/reader \"/tmp/foo.txt\")]\n (reduce conj [] (line-seq rdr)))","created-at":1290297729000,"updated-at":1290297729000,"_id":"542692d0c026201cdc326eb8"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (with-open [rdr (clojure.java.io/reader \"http://www.google.com\")]\n (printf \"%s\\n\" (clojure.string/join \"\\n\" (line-seq rdr))))\n","created-at":1324315042000,"updated-at":1324315042000,"_id":"542692d6c026201cdc3270db"}],"notes":[{"updated-at":1387185171000,"body":"Java documentation links for the listed argument types that have “default implementations�:\r\n\r\n* [`Reader`](http://docs.oracle.com/javase/7/docs/api/java/io/Reader.html)\r\n* [`BufferedReader`](http://docs.oracle.com/javase/7/docs/api/java/io/BufferedReader.html)\r\n* [`InputStream`](http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html)\r\n* [`File`](http://docs.oracle.com/javase/7/docs/api/java/io/File.html)\r\n* [`URI`](http://docs.oracle.com/javase/7/docs/api/java/net/URI.html)\r\n* [`URL`](http://docs.oracle.com/javase/7/docs/api/java/net/URL.html)\r\n* [`Socket`](http://docs.oracle.com/javase/7/docs/api/java/net/Socket.html)\r\n* byte arrays (`byte[]`)\r\n* character arrays (`char[]`)\r\n* [`String`](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html) (resolved as a URI or a local file name)","created-at":1387185171000,"author":{"login":"roryokane","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5b2b185c814bb25f2f95a1152e58f033?r=PG&default=identicon"},"_id":"542692edf6e94c6970522016"}],"tag":"java.io.Reader","arglists":["x & opts"],"doc":"Attempts to coerce its argument into an open java.io.Reader.\n Default implementations always return a java.io.BufferedReader.\n\n Default implementations are provided for Reader, BufferedReader,\n InputStream, File, URI, URL, Socket, byte arrays, character arrays,\n and String.\n\n If argument is a String, it tries to resolve it first as a URI, then\n as a local file name. URIs with a 'file' protocol are converted to\n local file names.\n\n Should be used inside with-open to ensure the Reader is properly\n closed.","library-url":"https://github.com/clojure/clojure","href":"/clojure.java.io/reader"},{"added":"1.2","ns":"clojure.java.javadoc","name":"javadoc","file":"clojure/java/javadoc.clj","type":"function","column":1,"see-alsos":[{"created-at":1332796364000,"author":{"login":"Olivenmann","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d5b1703fb08dd81e4cb2f653a3aaf10b?r=PG&default=identicon"},"to-var":{"ns":"clojure.repl","name":"doc","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cb0"}],"line":92,"examples":[{"author":{"login":"abhin4v","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4d29918c109bc75d2a1fd8420660d72b?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (use 'clojure.java.javadoc)\nnil\n\nuser=\u003E (javadoc String)\n\"http://java.sun.com/javase/6/docs/api/java/lang/String.html\"\n\nuser=\u003E (javadoc (java.util.Date.))\n\"http://java.sun.com/javase/6/docs/api/java/util/Date.html\"\n","created-at":1283270938000,"updated-at":1285492232000,"_id":"542692d0c026201cdc326ebd"},{"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"editors":[],"body":"user\u003E (javadoc 1)\n\"http://java.sun.com/javase/7/docs/api/java/lang/Long.html\"\n\n(javadoc \"abc\")\n\"http://java.sun.com/javase/7/docs/api/java/lang/String.html\"","created-at":1397981916000,"updated-at":1397981916000,"_id":"542692d6c026201cdc3270e0"},{"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"editors":[],"body":"user\u003E (javadoc org.joda.time.DateTime)\n\"http://www.google.com/search?btnI=I%27m%20Feeling%20Lucky&q=allinurl:org/joda/time/DateTime.html\"","created-at":1397981945000,"updated-at":1397981945000,"_id":"542692d6c026201cdc3270e1"}],"notes":null,"arglists":["class-or-object"],"doc":"Opens a browser window displaying the javadoc for the argument.\n Tries *local-javadocs* first, then *remote-javadocs*.","library-url":"https://github.com/clojure/clojure","href":"/clojure.java.javadoc/javadoc"},{"added":"1.2","ns":"clojure.java.javadoc","name":"add-local-javadoc","file":"clojure/java/javadoc.clj","type":"function","column":1,"see-alsos":null,"line":47,"examples":null,"notes":null,"arglists":["path"],"doc":"Adds to the list of local Javadoc paths.","library-url":"https://github.com/clojure/clojure","href":"/clojure.java.javadoc/add-local-javadoc"},{"ns":"clojure.java.javadoc","name":"*core-java-api*","file":"clojure/java/javadoc.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":21,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.java.javadoc/*core-java-api*"},{"ns":"clojure.java.javadoc","name":"*feeling-lucky-url*","file":"clojure/java/javadoc.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":16,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.java.javadoc/*feeling-lucky-url*"},{"ns":"clojure.java.javadoc","name":"*local-javadocs*","file":"clojure/java/javadoc.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":19,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.java.javadoc/*local-javadocs*"},{"added":"1.2","ns":"clojure.java.javadoc","name":"add-remote-javadoc","file":"clojure/java/javadoc.clj","type":"function","column":1,"see-alsos":null,"line":53,"examples":[{"author":{"login":"linxiangyu","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2c7492645426ece4ae86fde83d61bd03?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (use 'clojure.java.javadoc)\n\tnil\n\nuser=\u003E (add-remote-javadoc \"org.apache.commons.csv.\" \"http://commons.apache.org/proper/commons-csv/apidocs/index.html\")\n\t{\"java.\" \"http://java.sun.com/javase/6/docs/api/\", \"javax.\" \"http://java.sun.com/javase/6/docs/api/\", \"org.apache.commons.codec.\" \"http://commons.apache.org/codec/api-release/\", \"org.apache.commons.csv.\" \"http://commons.apache.org/proper/commons-csv/apidocs/index.html\", \"org.apache.commons.io.\" \"http://commons.apache.org/io/api-release/\", \"org.apache.commons.lang.\" \"http://commons.apache.org/lang/api-release/\", \"org.ietf.jgss.\" \"http://java.sun.com/javase/6/docs/api/\", \"org.omg.\" \"http://java.sun.com/javase/6/docs/api/\", \"org.w3c.dom.\" \"http://java.sun.com/javase/6/docs/api/\", \"org.xml.sax.\" \"http://java.sun.com/javase/6/docs/api/\"}","created-at":1369812981000,"updated-at":1369812981000,"_id":"542692d6c026201cdc3270df"}],"notes":null,"arglists":["package-prefix url"],"doc":"Adds to the list of remote Javadoc URLs. package-prefix is the\n beginning of the package name that has docs at this URL.","library-url":"https://github.com/clojure/clojure","href":"/clojure.java.javadoc/add-remote-javadoc"},{"ns":"clojure.java.javadoc","name":"*remote-javadocs*","file":"clojure/java/javadoc.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":33,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.java.javadoc/*remote-javadocs*"},{"ns":"clojure.java.javadoc","name":"*feeling-lucky*","file":"clojure/java/javadoc.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":17,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.java.javadoc/*feeling-lucky*"},{"added":"1.12","ns":"clojure.java.process","name":"stderr","file":"clojure/java/process.clj","type":"function","column":1,"see-alsos":null,"line":108,"examples":null,"notes":null,"arglists":["process"],"doc":"Given a process, return the stderr of the external process (an InputStream)","library-url":"https://github.com/clojure/clojure","href":"/clojure.java.process/stderr"},{"added":"1.12","ns":"clojure.java.process","name":"from-file","file":"clojure/java/process.clj","type":"function","column":1,"see-alsos":null,"line":46,"examples":null,"notes":null,"arglists":["f"],"doc":"Coerce f to a file per clojure.java.io/file and return a ProcessBuilder.Redirect reading from the file.\n This can be passed to 'start' in :in.","library-url":"https://github.com/clojure/clojure","href":"/clojure.java.process/from-file"},{"added":"1.12","ns":"clojure.java.process","name":"stdout","file":"clojure/java/process.clj","type":"function","column":1,"see-alsos":null,"line":102,"examples":null,"notes":null,"arglists":["process"],"doc":"Given a process, return the stdout of the external process (an InputStream)","library-url":"https://github.com/clojure/clojure","href":"/clojure.java.process/stdout"},{"added":"1.12","ns":"clojure.java.process","name":"stdin","file":"clojure/java/process.clj","type":"function","column":1,"see-alsos":null,"line":96,"examples":null,"notes":null,"arglists":["process"],"doc":"Given a process, return the stdin of the external process (an OutputStream)","library-url":"https://github.com/clojure/clojure","href":"/clojure.java.process/stdin"},{"added":"1.12","ns":"clojure.java.process","name":"exit-ref","file":"clojure/java/process.clj","type":"function","column":1,"see-alsos":null,"line":114,"examples":null,"notes":null,"arglists":["process"],"doc":"Given a Process (the output of 'start'), return a reference that can be\n used to wait for process completion then returns the exit value.","library-url":"https://github.com/clojure/clojure","href":"/clojure.java.process/exit-ref"},{"added":"1.12","ns":"clojure.java.process","name":"exec","file":"clojure/java/process.clj","type":"function","column":1,"see-alsos":null,"line":163,"examples":null,"notes":null,"arglists":["& opts+args"],"doc":"Execute a command and on successful exit, return the captured output,\n else throw RuntimeException. Args are the same as 'start' and options\n if supplied override the default 'exec' settings.","library-url":"https://github.com/clojure/clojure","href":"/clojure.java.process/exec"},{"added":"1.12","ns":"clojure.java.process","name":"start","file":"clojure/java/process.clj","type":"function","column":1,"see-alsos":null,"line":53,"examples":null,"notes":null,"arglists":["& opts+args"],"doc":"Start an external command, defined in args.\n The process environment vars are inherited from the parent by\n default (use :clear-env to clear them).\n\n If needed, provide options in map as first arg:\n :in - a ProcessBuilder.Redirect (default = :pipe) or :inherit\n :out - a ProcessBuilder.Redirect (default = :pipe) or :inherit :discard\n :err - a ProcessBuilder.Redirect (default = :pipe) or :inherit :discard :stdout\n :dir - current directory when the process runs (default=\".\")\n :clear-env - if true, remove all inherited parent env vars\n :env - {env-var value} of environment variables to set (all strings)\n\n Returns the java.lang.Process.","library-url":"https://github.com/clojure/clojure","href":"/clojure.java.process/start"},{"added":"1.12","ns":"clojure.java.process","name":"to-file","file":"clojure/java/process.clj","type":"function","column":1,"see-alsos":null,"line":36,"examples":null,"notes":null,"arglists":["f & {:keys [append], :as opts}"],"doc":"Coerce f to a file per clojure.java.io/file and return a ProcessBuilder.Redirect writing to the file.\n Set ':append' in opts to append. This can be passed to 'start' in :out or :err.","library-url":"https://github.com/clojure/clojure","href":"/clojure.java.process/to-file"},{"ns":"clojure.java.process","name":"io-task","file":"clojure/java/process.clj","type":"function","column":1,"see-alsos":null,"line":142,"examples":null,"notes":null,"arglists":["f"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.java.process/io-task"},{"added":"1.2","ns":"clojure.java.shell","name":"sh","file":"clojure/java/shell.clj","type":"function","column":1,"see-alsos":[{"created-at":1332915179000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.java.shell","name":"with-sh-dir","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e1b"},{"created-at":1332915183000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.java.shell","name":"with-sh-env","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e1c"},{"created-at":1336536810000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"future","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e1d"}],"line":79,"examples":[{"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"editors":[{"login":"juergenhoetzel","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2736dfffc803c704dcf25b45ff63cede?r=PG&default=identicon"},{"login":"Chouser","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7a0192050ed6488670acfd3f59405c10?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (use '[clojure.java.shell :only [sh]])\n\n;; Note: The actual output you see from a command like this will look messier.\n;; The output below has had all newline characters replaced with line\n;; breaks. You would see a big long string with \\n characters in the middle.\nuser=\u003E (sh \"ls\" \"-aul\")\n\n{:exit 0, \n :out \"total 64\ndrwxr-xr-x 11 zkim staff 374 Jul 5 13:21 .\ndrwxr-xr-x 25 zkim staff 850 Jul 5 13:02 ..\ndrwxr-xr-x 12 zkim staff 408 Jul 5 13:02 .git\n-rw-r--r-- 1 zkim staff 13 Jul 5 13:02 .gitignore\n-rw-r--r-- 1 zkim staff 12638 Jul 5 13:02 LICENSE.html\n-rw-r--r-- 1 zkim staff 4092 Jul 5 13:02 README.md\ndrwxr-xr-x 2 zkim staff 68 Jul 5 13:15 classes\ndrwxr-xr-x 5 zkim staff 170 Jul 5 13:15 lib\n-rw-r--r--@ 1 zkim staff 3396 Jul 5 13:03 pom.xml\n-rw-r--r--@ 1 zkim staff 367 Jul 5 13:15 project.clj\ndrwxr-xr-x 4 zkim staff 136 Jul 5 13:15 src\n\", :err \"\"}","created-at":1278383022000,"updated-at":1332916119000,"_id":"542692d0c026201cdc326ebf"},{"author":{"login":"secondplanet","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/6c3417477c007600db59c4a94718ee43?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (use '[clojure.java.shell :only [sh]])\n\nuser=\u003E (println (:out (sh \"cowsay\" \"Printing a command-line output\")))\n\n _________________________________ \n\u003C Printing a command-line output. \u003E\n --------------------------------- \n \\ ^__^\n \\ (oo)\\_______\n (__)\\ )\\/\\\n ||----w |\n || ||\n\nnil","created-at":1313622736000,"updated-at":1313622736000,"_id":"542692d0c026201cdc326ec4"},{"author":{"login":"franks42","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b3ee701dd6c481e5d310467ddfe62c48?r=PG&default=identicon"},"editors":[{"login":"franks42","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b3ee701dd6c481e5d310467ddfe62c48?r=PG&default=identicon"},{"login":"franks42","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b3ee701dd6c481e5d310467ddfe62c48?r=PG&default=identicon"},{"login":"franks42","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b3ee701dd6c481e5d310467ddfe62c48?r=PG&default=identicon"},{"login":"franks42","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b3ee701dd6c481e5d310467ddfe62c48?r=PG&default=identicon"}],"body":"user=\u003E (use '[clojure.java.shell :only [sh]])\nnil\n\n;; note that the options, like :in, have to go at the end of arglist\n;; advantage of piping-in thru stdin is less need for quoting/escaping\nuser=\u003E (println (:out (sh \"cat\" \"-\" :in \"Printing input from stdin with funny chars like ' \\\" $@ & \")))\nPrinting input from stdin with funny chars like ' \" $@ & \nnil","created-at":1331269027000,"updated-at":1331270505000,"_id":"542692d6c026201cdc3270e2"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":";; sh is implemented using Clojure futures. See examples for 'future'\n;; for discussion of an undesirable 1-minute wait that can occur before\n;; your standalone Clojure program exits if you do not use shutdown-agents.","created-at":1336536805000,"updated-at":1336536828000,"_id":"542692d6c026201cdc3270e7"},{"author":{"login":"octopusgrabbus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fd31b8bcea99fa7b0711fbc424587774?r=PG&default=identicon"},"editors":[],"body":"(sh \"pwd\" :dir \"/home/ics/icsdev\")\n{:exit 0, :out \"/home/ics/icsdev\\n\", :err \"\"}","created-at":1398214606000,"updated-at":1398214606000,"_id":"542692d6c026201cdc3270e9"},{"author":{"login":"octopusgrabbus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fd31b8bcea99fa7b0711fbc424587774?r=PG&default=identicon"},"editors":[],"body":"(require '[clojure.java.shell :as shell])\n(shell/sh \"sh\" \"-c\" \"cd /etc; pwd\")\n{:exit 0, :out \"/etc\\n\", :err \"\"}","created-at":1398221530000,"updated-at":1398221530000,"_id":"542692d6c026201cdc3270ea"}],"notes":null,"arglists":["& args"],"doc":"Passes the given strings to Runtime.exec() to launch a sub-process.\n\n Options are\n\n :in may be given followed by any legal input source for\n clojure.java.io/copy, e.g. InputStream, Reader, File, byte[],\n or String, to be fed to the sub-process's stdin.\n :in-enc option may be given followed by a String, used as a character\n encoding name (for example \"UTF-8\" or \"ISO-8859-1\") to\n convert the input string specified by the :in option to the\n sub-process's stdin. Defaults to UTF-8.\n If the :in option provides a byte array, then the bytes are passed\n unencoded, and this option is ignored.\n :out-enc option may be given followed by :bytes or a String. If a\n String is given, it will be used as a character encoding\n name (for example \"UTF-8\" or \"ISO-8859-1\") to convert\n the sub-process's stdout to a String which is returned.\n If :bytes is given, the sub-process's stdout will be stored\n in a byte array and returned. Defaults to UTF-8.\n :env override the process env with a map (or the underlying Java\n String[] if you are a masochist).\n :dir override the process dir with a String or java.io.File.\n\n You can bind :env or :dir for multiple operations using with-sh-env\n and with-sh-dir.\n\n sh returns a map of\n :exit =\u003E sub-process's exit code\n :out =\u003E sub-process's stdout (as byte[] or String)\n :err =\u003E sub-process's stderr (String via platform default encoding)","library-url":"https://github.com/clojure/clojure","href":"/clojure.java.shell/sh"},{"ns":"clojure.java.shell","name":"*sh-dir*","file":"clojure/java/shell.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":18,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.java.shell/*sh-dir*"},{"added":"1.2","ns":"clojure.java.shell","name":"with-sh-dir","file":"clojure/java/shell.clj","type":"macro","column":1,"see-alsos":[{"created-at":1332915149000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.java.shell","name":"sh","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f48"}],"line":21,"examples":null,"macro":true,"notes":null,"arglists":["dir & forms"],"doc":"Sets the directory for use with sh, see sh for details.","library-url":"https://github.com/clojure/clojure","href":"/clojure.java.shell/with-sh-dir"},{"ns":"clojure.java.shell","name":"*sh-env*","file":"clojure/java/shell.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":19,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.java.shell/*sh-env*"},{"added":"1.2","ns":"clojure.java.shell","name":"with-sh-env","file":"clojure/java/shell.clj","type":"macro","column":1,"see-alsos":[{"created-at":1332915161000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.java.shell","name":"sh","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f58"}],"line":28,"examples":null,"macro":true,"notes":null,"arglists":["env & forms"],"doc":"Sets the environment for use with sh, see sh for details.","library-url":"https://github.com/clojure/clojure","href":"/clojure.java.shell/with-sh-env"},{"ns":"clojure.main","name":"main","file":"clojure/main.clj","type":"function","column":1,"see-alsos":null,"line":617,"examples":null,"notes":null,"arglists":["& args"],"doc":"Usage: java -cp clojure.jar clojure.main [init-opt*] [main-opt] [arg*]\n\n With no options or args, runs an interactive Read-Eval-Print Loop\n\n init options:\n -i, --init path Load a file or resource\n -e, --eval string Evaluate expressions in string; print non-nil values\n --report target Report uncaught exception to \"file\" (default), \"stderr\",\n or \"none\", overrides System property clojure.main.report\n\n main options:\n -m, --main ns-name Call the -main function from a namespace with args\n -r, --repl Run a repl\n path Run a script from a file or resource\n - Run a script from standard input\n -h, -?, --help Print this help message and exit\n\n operation:\n\n - Establishes thread-local bindings for commonly set!-able vars\n - Enters the user namespace\n - Binds *command-line-args* to a seq of strings containing command line\n args that appear after any main option\n - Runs all init options in order\n - Calls a -main function or runs a repl or script if requested\n\n The init options may be repeated and mixed freely, but must appear before\n any main option. The appearance of any eval option before running a repl\n suppresses the usual repl greeting message: \"Clojure ~(clojure-version)\".\n\n Paths may be absolute or relative in the filesystem or relative to\n classpath. Classpath-relative paths have prefix of @ or @/","library-url":"https://github.com/clojure/clojure","href":"/clojure.main/main"},{"ns":"clojure.main","name":"with-bindings","file":"clojure/main.clj","type":"macro","column":1,"see-alsos":[{"created-at":1374149313000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"binding","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521a83"},{"created-at":1374149334000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"with-local-vars","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521a84"},{"created-at":1374149343000,"author":{"login":"alilee","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2fb0196dc5a7cd3a5cc73f1b9941c209?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"with-redefs-fn","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521a85"}],"line":76,"examples":null,"macro":true,"notes":null,"arglists":["& body"],"doc":"Executes body in the context of thread-local bindings for several vars\n that often need to be set!: *ns* *warn-on-reflection* *math-context*\n *print-meta* *print-length* *print-level* *compile-path*\n *command-line-args* *1 *2 *3 *e","library-url":"https://github.com/clojure/clojure","href":"/clojure.main/with-bindings"},{"added":"1.3","ns":"clojure.main","name":"stack-element-str","file":"clojure/main.clj","type":"function","column":1,"see-alsos":null,"line":62,"examples":null,"notes":null,"arglists":["el"],"doc":"Returns a (possibly unmunged) string representation of a StackTraceElement","library-url":"https://github.com/clojure/clojure","href":"/clojure.main/stack-element-str"},{"ns":"clojure.main","name":"repl-caught","file":"clojure/main.clj","type":"function","column":1,"see-alsos":null,"line":347,"examples":null,"notes":null,"arglists":["e"],"doc":"Default :caught hook for repl","library-url":"https://github.com/clojure/clojure","href":"/clojure.main/repl-caught"},{"ns":"clojure.main","name":"repl-exception","file":"clojure/main.clj","type":"function","column":1,"see-alsos":null,"line":171,"examples":null,"notes":null,"arglists":["throwable"],"doc":"Returns the root cause of throwables","library-url":"https://github.com/clojure/clojure","href":"/clojure.main/repl-exception"},{"ns":"clojure.main","name":"err-\u003Emsg","file":"clojure/main.clj","type":"function","column":1,"see-alsos":null,"line":342,"examples":null,"notes":null,"arglists":["e"],"doc":"Helper to return an error message string from an exception.","library-url":"https://github.com/clojure/clojure","href":"/clojure.main/err-\u003Emsg"},{"ns":"clojure.main","name":"repl-read","file":"clojure/main.clj","type":"function","column":1,"see-alsos":null,"line":153,"examples":null,"notes":null,"arglists":["request-prompt request-exit"],"doc":"Default :read hook for repl. Reads from *in* which must either be an\n instance of LineNumberingPushbackReader or duplicate its behavior of both\n supporting .unread and collapsing all of CR, LF, and CRLF into a single\n \\newline. repl-read:\n - skips whitespace, then\n - returns request-prompt on start of line, or\n - returns request-exit on end of stream, or\n - reads an object from the input stream, then\n - skips the next input character if it's end of line, then\n - returns the object.","library-url":"https://github.com/clojure/clojure","href":"/clojure.main/repl-read"},{"ns":"clojure.main","name":"load-script","file":"clojure/main.clj","type":"function","column":1,"see-alsos":null,"line":469,"examples":null,"notes":null,"arglists":["path"],"doc":"Loads Clojure source from a file or resource given its path. Paths\n beginning with @ or @/ are considered relative to classpath.","library-url":"https://github.com/clojure/clojure","href":"/clojure.main/load-script"},{"ns":"clojure.main","name":"skip-if-eol","file":"clojure/main.clj","type":"function","column":1,"see-alsos":null,"line":107,"examples":null,"notes":null,"arglists":["s"],"doc":"If the next character on stream s is a newline, skips it, otherwise\n leaves the stream untouched. Returns :line-start, :stream-end, or :body\n to indicate the relative location of the next character on s. The stream\n must either be an instance of LineNumberingPushbackReader or duplicate\n its behavior of both supporting .unread and collapsing all of CR, LF, and\n CRLF to a single \\newline.","library-url":"https://github.com/clojure/clojure","href":"/clojure.main/skip-if-eol"},{"ns":"clojure.main","name":"skip-whitespace","file":"clojure/main.clj","type":"function","column":1,"see-alsos":null,"line":121,"examples":null,"notes":null,"arglists":["s"],"doc":"Skips whitespace characters on stream s. Returns :line-start, :stream-end,\n or :body to indicate the relative location of the next character on s.\n Interprets comma as whitespace and semicolon as comment to end of line.\n Does not interpret #! as comment to end of line because only one\n character of lookahead is available. The stream must either be an\n instance of LineNumberingPushbackReader or duplicate its behavior of both\n supporting .unread and collapsing all of CR, LF, and CRLF to a single\n \\newline.","library-url":"https://github.com/clojure/clojure","href":"/clojure.main/skip-whitespace"},{"ns":"clojure.main","name":"report-error","file":"clojure/main.clj","type":"function","column":1,"see-alsos":null,"line":585,"examples":null,"notes":null,"arglists":["t & {:keys [target], :or {target \"file\"}, :as opts}"],"doc":"Create and output an exception report for a Throwable to target.\n\n Options:\n :target - \"file\" (default), \"stderr\", \"none\"\n\n If file is specified but cannot be written, falls back to stderr.","library-url":"https://github.com/clojure/clojure","href":"/clojure.main/report-error"},{"added":"1.3","ns":"clojure.main","name":"root-cause","file":"clojure/main.clj","type":"function","column":1,"see-alsos":null,"line":35,"examples":null,"notes":null,"arglists":["t"],"doc":"Returns the initial cause of an exception or error by peeling off all of\n its wrappers","library-url":"https://github.com/clojure/clojure","href":"/clojure.main/root-cause"},{"ns":"clojure.main","name":"repl-requires","file":"clojure/main.clj","type":"var","column":1,"see-alsos":null,"line":354,"examples":null,"notes":null,"arglists":[],"doc":"A sequence of lib specs that are applied to `require`\nby default when a new command-line REPL is started.","library-url":"https://github.com/clojure/clojure","href":"/clojure.main/repl-requires"},{"added":"1.3","ns":"clojure.main","name":"demunge","file":"clojure/main.clj","type":"function","column":1,"see-alsos":null,"line":28,"examples":[{"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"editors":[],"body":"(use 'clojure.main)\n\n(demunge \"clojure.core$println\")\n=\u003E\"clojure.core/println\"","created-at":1325041264000,"updated-at":1325041264000,"_id":"542692d6c026201cdc3270eb"}],"notes":null,"arglists":["fn-name"],"doc":"Given a string representation of a fn class,\n as in a stack trace element, returns a readable version.","library-url":"https://github.com/clojure/clojure","href":"/clojure.main/demunge"},{"ns":"clojure.main","name":"with-read-known","file":"clojure/main.clj","type":"macro","column":1,"see-alsos":null,"line":361,"examples":null,"macro":true,"notes":null,"arglists":["& body"],"doc":"Evaluates body with *read-eval* set to a \"known\" value,\n i.e. substituting true for :unknown if necessary.","library-url":"https://github.com/clojure/clojure","href":"/clojure.main/with-read-known"},{"added":"1.10","ns":"clojure.main","name":"ex-str","file":"clojure/main.clj","type":"function","column":1,"see-alsos":null,"line":268,"examples":null,"notes":null,"arglists":["{:clojure.error/keys [phase source path line column symbol class cause spec], :as triage-data}"],"doc":"Returns a string from exception data, as produced by ex-triage.\n The first line summarizes the exception phase and location.\n The subsequent lines describe the cause.","library-url":"https://github.com/clojure/clojure","href":"/clojure.main/ex-str"},{"added":"1.10","ns":"clojure.main","name":"renumbering-read","file":"clojure/main.clj","type":"function","column":1,"see-alsos":null,"line":139,"examples":null,"notes":null,"arglists":["opts reader line-number"],"doc":"Reads from reader, which must be a LineNumberingPushbackReader, while capturing\n the read string. If the read is successful, reset the line number and re-read.\n The line number on re-read is the passed line-number unless :line or\n :clojure.core/eval-file meta are explicitly set on the read value.","library-url":"https://github.com/clojure/clojure","href":"/clojure.main/renumbering-read"},{"ns":"clojure.main","name":"repl","file":"clojure/main.clj","type":"function","column":1,"see-alsos":null,"line":368,"examples":null,"notes":null,"arglists":["& options"],"doc":"Generic, reusable, read-eval-print loop. By default, reads from *in*,\n writes to *out*, and prints exception summaries to *err*. If you use the\n default :read hook, *in* must either be an instance of\n LineNumberingPushbackReader or duplicate its behavior of both supporting\n .unread and collapsing CR, LF, and CRLF into a single \\newline. Options\n are sequential keyword-value pairs. Available options and their defaults:\n\n - :init, function of no arguments, initialization hook called with\n bindings for set!-able vars in place.\n default: #()\n\n - :need-prompt, function of no arguments, called before each\n read-eval-print except the first, the user will be prompted if it\n returns true.\n default: (if (instance? LineNumberingPushbackReader *in*)\n #(.atLineStart *in*)\n #(identity true))\n\n - :prompt, function of no arguments, prompts for more input.\n default: repl-prompt\n\n - :flush, function of no arguments, flushes output\n default: flush\n\n - :read, function of two arguments, reads from *in*:\n - returns its first argument to request a fresh prompt\n - depending on need-prompt, this may cause the repl to prompt\n before reading again\n - returns its second argument to request an exit from the repl\n - else returns the next object read from the input stream\n default: repl-read\n\n - :eval, function of one argument, returns the evaluation of its\n argument\n default: eval\n\n - :print, function of one argument, prints its argument to the output\n default: prn\n\n - :caught, function of one argument, a throwable, called when\n read, eval, or print throws an exception or error\n default: repl-caught","library-url":"https://github.com/clojure/clojure","href":"/clojure.main/repl"},{"ns":"clojure.main","name":"repl-prompt","file":"clojure/main.clj","type":"function","column":1,"see-alsos":null,"line":102,"examples":null,"notes":null,"arglists":[""],"doc":"Default :prompt hook for repl","library-url":"https://github.com/clojure/clojure","href":"/clojure.main/repl-prompt"},{"added":"1.10","ns":"clojure.main","name":"ex-triage","file":"clojure/main.clj","type":"function","column":1,"see-alsos":null,"line":207,"examples":null,"notes":null,"arglists":["datafied-throwable"],"doc":"Returns an analysis of the phase, error, cause, and location of an error that occurred\n based on Throwable data, as returned by Throwable-\u003Emap. All attributes other than phase\n are optional:\n :clojure.error/phase - keyword phase indicator, one of:\n :read-source :compile-syntax-check :compilation :macro-syntax-check :macroexpansion\n :execution :read-eval-result :print-eval-result\n :clojure.error/source - file name (no path)\n :clojure.error/path - source path\n :clojure.error/line - integer line number\n :clojure.error/column - integer column number\n :clojure.error/symbol - symbol being expanded/compiled/invoked\n :clojure.error/class - cause exception class symbol\n :clojure.error/cause - cause exception message\n :clojure.error/spec - explain-data for spec error","library-url":"https://github.com/clojure/clojure","href":"/clojure.main/ex-triage"},{"added":"1.11","ns":"clojure.math","name":"next-after","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":469,"examples":null,"notes":null,"arglists":["start direction"],"doc":"Returns the adjacent floating point number to start in the direction of\n the second argument. If the arguments are equal, the second is returned.\n If either arg is #NaN =\u003E #NaN\n If both arguments are signed zeros =\u003E direction\n If start is +-Double/MIN_VALUE and direction would cause a smaller magnitude\n =\u003E zero with sign matching start\n If start is ##Inf or ##-Inf and direction would cause a smaller magnitude\n =\u003E Double/MAX_VALUE with same sign as start\n If start is equal to +=Double/MAX_VALUE and direction would cause a larger magnitude\n =\u003E ##Inf or ##-Inf with sign matching start\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#nextAfter-double-double-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/next-after"},{"added":"1.11","ns":"clojure.math","name":"to-radians","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":106,"examples":null,"notes":null,"arglists":["deg"],"doc":"Converts an angle in degrees to an approximate equivalent angle in radians.\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#toRadians-double-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/to-radians"},{"added":"1.11","ns":"clojure.math","name":"log","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":136,"examples":null,"notes":null,"arglists":["a"],"doc":"Returns the natural logarithm (base e) of a.\n If a is ##NaN or negative =\u003E ##NaN\n If a is ##Inf =\u003E ##Inf\n If a is zero =\u003E ##-Inf\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#log-double-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/log"},{"added":"1.11","ns":"clojure.math","name":"acos","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":85,"examples":null,"notes":null,"arglists":["a"],"doc":"Returns the arc cosine of a, in the range 0.0 to pi.\n If a is ##NaN or |a|\u003E1 =\u003E ##NaN\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#acos-double-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/acos"},{"added":"1.11","ns":"clojure.math","name":"to-degrees","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":115,"examples":null,"notes":null,"arglists":["r"],"doc":"Converts an angle in radians to an approximate equivalent angle in degrees.\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#toDegrees-double-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/to-degrees"},{"added":"1.11","ns":"clojure.math","name":"floor","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":210,"examples":null,"notes":null,"arglists":["a"],"doc":"Returns the largest double less than or equal to a, and equal to a\n mathematical integer.\n If a is ##NaN or ##Inf or ##-Inf or already equal to an integer =\u003E a\n If a is less than zero but greater than -1.0 =\u003E -0.0\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#floor-double-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/floor"},{"added":"1.11","ns":"clojure.math","name":"atan2","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":233,"examples":null,"notes":null,"arglists":["y x"],"doc":"Returns the angle theta from the conversion of rectangular coordinates (x, y) to polar coordinates (r, theta).\n Computes the phase theta by computing an arc tangent of y/x in the range of -pi to pi.\n For more details on special cases, see:\n https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#atan2-double-double-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/atan2"},{"added":"1.11","ns":"clojure.math","name":"hypot","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":410,"examples":null,"notes":null,"arglists":["x y"],"doc":"Returns sqrt(x^2 + y^2) without intermediate underflow or overflow.\n If x or y is ##Inf or ##-Inf =\u003E ##Inf\n If x or y is ##NaN and neither is ##Inf or ##-Inf =\u003E ##NaN\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#hypot-double-double-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/hypot"},{"added":"1.11","ns":"clojure.math","name":"tanh","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":397,"examples":null,"notes":null,"arglists":["x"],"doc":"Returns the hyperbolic tangent of x, sinh(x)/cosh(x).\n If x is ##NaN =\u003E ##NaN\n If x is zero =\u003E zero, with same sign\n If x is ##Inf =\u003E +1.0\n If x is ##-Inf =\u003E -1.0\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#tanh-double-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/tanh"},{"added":"1.11","ns":"clojure.math","name":"floor-mod","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":341,"examples":null,"notes":null,"arglists":["x y"],"doc":"Integer modulus x - (floorDiv(x, y) * y). Sign matches y and is in the\n range -|y| \u003C r \u003C |y|.\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#floorMod-long-long-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/floor-mod"},{"added":"1.11","ns":"clojure.math","name":"ceil","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":199,"examples":null,"notes":null,"arglists":["a"],"doc":"Returns the smallest double greater than or equal to a, and equal to a\n mathematical integer.\n If a is ##NaN or ##Inf or ##-Inf or already equal to an integer =\u003E a\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#ceil-double-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/ceil"},{"added":"1.11","ns":"clojure.math","name":"atan","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":95,"examples":null,"notes":null,"arglists":["a"],"doc":"Returns the arc tangent of a, in the range of -pi/2 to pi/2.\n If a is ##NaN =\u003E ##NaN\n If a is zero =\u003E zero with the same sign as a\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#atan-double-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/atan"},{"added":"1.11","ns":"clojure.math","name":"multiply-exact","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":295,"examples":null,"notes":null,"arglists":["x y"],"doc":"Returns the product of x and y, throws ArithmeticException on overflow.\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#multiplyExact-long-long-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/multiply-exact"},{"added":"1.11","ns":"clojure.math","name":"expm1","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":421,"examples":null,"notes":null,"arglists":["x"],"doc":"Returns e^x - 1. Near 0, expm1(x)+1 is more accurate to e^x than exp(x).\n If x is ##NaN =\u003E ##NaN\n If x is ##Inf =\u003E #Inf\n If x is ##-Inf =\u003E -1.0\n If x is zero =\u003E x\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#expm1-double-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/expm1"},{"added":"1.11","ns":"clojure.math","name":"get-exponent","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":458,"examples":null,"notes":null,"arglists":["d"],"doc":"Returns the exponent of d.\n If d is ##NaN, ##Inf, ##-Inf =\u003E Double/MAX_EXPONENT + 1\n If d is zero or subnormal =\u003E Double/MIN_EXPONENT - 1\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#getExponent-double-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/get-exponent"},{"added":"1.11","ns":"clojure.math","name":"add-exact","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":277,"examples":null,"notes":null,"arglists":["x y"],"doc":"Returns the sum of x and y, throws ArithmeticException on overflow.\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#addExact-long-long-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/add-exact"},{"added":"1.11","ns":"clojure.math","name":"cos","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":53,"examples":null,"notes":null,"arglists":["a"],"doc":"Returns the cosine of an angle.\n If a is ##NaN, ##-Inf, ##Inf =\u003E ##NaN\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#cos-double-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/cos"},{"added":"1.11","ns":"clojure.math","name":"log10","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":148,"examples":null,"notes":null,"arglists":["a"],"doc":"Returns the logarithm (base 10) of a.\n If a is ##NaN or negative =\u003E ##NaN\n If a is ##Inf =\u003E ##Inf\n If a is zero =\u003E ##-Inf\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#log10-double-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/log10"},{"added":"1.11","ns":"clojure.math","name":"tan","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":63,"examples":null,"notes":null,"arglists":["a"],"doc":"Returns the tangent of an angle.\n If a is ##NaN, ##-Inf, ##Inf =\u003E ##NaN\n If a is zero =\u003E zero with the same sign as a\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#tan-double-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/tan"},{"added":"1.11","ns":"clojure.math","name":"cbrt","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":172,"examples":null,"notes":null,"arglists":["a"],"doc":"Returns the cube root of a.\n If a is ##NaN =\u003E ##NaN\n If a is ##Inf or ##-Inf =\u003E a\n If a is zero =\u003E zero with sign matching a\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#cbrt-double-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/cbrt"},{"added":"1.11","ns":"clojure.math","name":"sqrt","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":160,"examples":null,"notes":null,"arglists":["a"],"doc":"Returns the positive square root of a.\n If a is ##NaN or negative =\u003E ##NaN\n If a is ##Inf =\u003E ##Inf\n If a is zero =\u003E a\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#sqrt-double-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/sqrt"},{"added":"1.11","ns":"clojure.math","name":"decrement-exact","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":313,"examples":null,"notes":null,"arglists":["a"],"doc":"Returns a decremented by 1, throws ArithmeticException on overflow.\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#decrementExact-long-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/decrement-exact"},{"added":"1.11","ns":"clojure.math","name":"PI","file":"clojure/math.clj","type":"var","column":1,"see-alsos":null,"line":33,"examples":null,"notes":null,"tag":"double","arglists":[],"doc":"Constant for pi, the ratio of the circumference of a circle to its diameter.\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#PI","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/PI"},{"added":"1.11","ns":"clojure.math","name":"next-down","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":499,"examples":null,"notes":null,"arglists":["d"],"doc":"Returns the adjacent double of d in the direction of ##-Inf.\n If d is ##NaN =\u003E ##NaN\n If d is ##-Inf =\u003E ##-Inf\n If d is zero =\u003E -Double/MIN_VALUE\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#nextDown-double-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/next-down"},{"added":"1.11","ns":"clojure.math","name":"pow","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":244,"examples":null,"notes":null,"arglists":["a b"],"doc":"Returns the value of a raised to the power of b.\n For more details on special cases, see:\n https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#pow-double-double-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/pow"},{"added":"1.11","ns":"clojure.math","name":"next-up","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":487,"examples":null,"notes":null,"arglists":["d"],"doc":"Returns the adjacent double of d in the direction of ##Inf.\n If d is ##NaN =\u003E ##NaN\n If d is ##Inf =\u003E ##Inf\n If d is zero =\u003E Double/MIN_VALUE\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#nextUp-double-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/next-up"},{"added":"1.11","ns":"clojure.math","name":"exp","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":124,"examples":null,"notes":null,"arglists":["a"],"doc":"Returns Euler's number e raised to the power of a.\n If a is ##NaN =\u003E ##NaN\n If a is ##Inf =\u003E ##Inf\n If a is ##-Inf =\u003E +0.0\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#exp-double-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/exp"},{"added":"1.11","ns":"clojure.math","name":"subtract-exact","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":286,"examples":null,"notes":null,"arglists":["x y"],"doc":"Returns the difference of x and y, throws ArithmeticException on overflow.\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#subtractExact-long-long-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/subtract-exact"},{"added":"1.11","ns":"clojure.math","name":"cosh","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":385,"examples":null,"notes":null,"arglists":["x"],"doc":"Returns the hyperbolic cosine of x, (e^x + e^-x)/2.\n If x is ##NaN =\u003E ##NaN\n If x is ##Inf or ##-Inf =\u003E ##Inf\n If x is zero =\u003E 1.0\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#cosh-double-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/cosh"},{"added":"1.11","ns":"clojure.math","name":"scalb","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":511,"examples":null,"notes":null,"arglists":["d scaleFactor"],"doc":"Returns d * 2^scaleFactor, scaling by a factor of 2. If the exponent\n is between Double/MIN_EXPONENT and Double/MAX_EXPONENT, the answer is exact.\n If d is ##NaN =\u003E ##NaN\n If d is ##Inf or ##-Inf =\u003E ##Inf or ##-Inf respectively\n If d is zero =\u003E zero of same sign as d\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#nextDown-double-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/scalb"},{"added":"1.11","ns":"clojure.math","name":"log1p","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":434,"examples":null,"notes":null,"arglists":["x"],"doc":"Returns ln(1+x). For small values of x, log1p(x) is more accurate than\n log(1.0+x).\n If x is ##NaN or \u003C -1 =\u003E ##NaN\n If x is ##Inf =\u003E ##Inf\n If x is -1 =\u003E ##-Inf\n If x is 0 =\u003E 0 with sign matching x\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#log1p-double-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/log1p"},{"added":"1.11","ns":"clojure.math","name":"asin","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":74,"examples":null,"notes":null,"arglists":["a"],"doc":"Returns the arc sine of an angle, in the range -pi/2 to pi/2.\n If a is ##NaN or |a|\u003E1 =\u003E ##NaN\n If a is zero =\u003E zero with the same sign as a\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#asin-double-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/asin"},{"added":"1.11","ns":"clojure.math","name":"copy-sign","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":448,"examples":null,"notes":null,"arglists":["magnitude sign"],"doc":"Returns a double with the magnitude of the first argument and the sign of\n the second.\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#copySign-double-double-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/copy-sign"},{"added":"1.11","ns":"clojure.math","name":"round","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":254,"examples":null,"notes":null,"arglists":["a"],"doc":"Returns the closest long to a. If equally close to two values, return the one\n closer to ##Inf.\n If a is ##NaN =\u003E 0\n If a is ##-Inf or \u003C Long/MIN_VALUE =\u003E Long/MIN_VALUE\n If a is ##Inf or \u003E Long/MAX_VALUE =\u003E Long/MAX_VALUE\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#round-double-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/round"},{"added":"1.11","ns":"clojure.math","name":"negate-exact","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":322,"examples":null,"notes":null,"arglists":["a"],"doc":"Returns the negation of a, throws ArithmeticException on overflow.\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#negateExact-long-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/negate-exact"},{"added":"1.11","ns":"clojure.math","name":"E","file":"clojure/math.clj","type":"var","column":1,"see-alsos":null,"line":24,"examples":null,"notes":null,"tag":"double","arglists":[],"doc":"Constant for e, the base for natural logarithms.\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#E","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/E"},{"added":"1.11","ns":"clojure.math","name":"IEEE-remainder","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":184,"examples":null,"notes":null,"arglists":["dividend divisor"],"doc":"Returns the remainder per IEEE 754 such that\n remainder = dividend - divisor * n\n where n is the integer closest to the exact value of dividend / divisor.\n If two integers are equally close, then n is the even one.\n If the remainder is zero, sign will match dividend.\n If dividend or divisor is ##NaN, or dividend is ##Inf or ##-Inf, or divisor is zero =\u003E ##NaN\n If dividend is finite and divisor is infinite =\u003E dividend\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#IEEEremainder-double-double-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/IEEE-remainder"},{"added":"1.11","ns":"clojure.math","name":"sinh","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":374,"examples":null,"notes":null,"arglists":["x"],"doc":"Returns the hyperbolic sine of x, (e^x - e^-x)/2.\n If x is ##NaN =\u003E ##NaN\n If x is ##Inf or ##-Inf or zero =\u003E x\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#sinh-double-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/sinh"},{"added":"1.11","ns":"clojure.math","name":"rint","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":222,"examples":null,"notes":null,"arglists":["a"],"doc":"Returns the double closest to a and equal to a mathematical integer.\n If two values are equally close, return the even one.\n If a is ##NaN or ##Inf or ##-Inf or zero =\u003E a\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#rint-double-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/rint"},{"added":"1.11","ns":"clojure.math","name":"ulp","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":351,"examples":null,"notes":null,"arglists":["d"],"doc":"Returns the size of an ulp (unit in last place) for d.\n If d is ##NaN =\u003E ##NaN\n If d is ##Inf or ##-Inf =\u003E ##Inf\n If d is zero =\u003E Double/MIN_VALUE\n If d is +/- Double/MAX_VALUE =\u003E 2^971\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#ulp-double-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/ulp"},{"added":"1.11","ns":"clojure.math","name":"sin","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":42,"examples":null,"notes":null,"arglists":["a"],"doc":"Returns the sine of an angle.\n If a is ##NaN, ##-Inf, ##Inf =\u003E ##NaN\n If a is zero =\u003E zero with the same sign as a\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#sin-double-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/sin"},{"added":"1.11","ns":"clojure.math","name":"increment-exact","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":304,"examples":null,"notes":null,"arglists":["a"],"doc":"Returns a incremented by 1, throws ArithmeticException on overflow.\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#incrementExact-long-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/increment-exact"},{"added":"1.11","ns":"clojure.math","name":"random","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":267,"examples":null,"notes":null,"arglists":[""],"doc":"Returns a positive double between 0.0 and 1.0, chosen pseudorandomly with\n approximately random distribution.\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#random--","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/random"},{"added":"1.11","ns":"clojure.math","name":"floor-div","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":331,"examples":null,"notes":null,"arglists":["x y"],"doc":"Integer division that rounds to negative infinity (as opposed to zero).\n The special case (floorDiv Long/MIN_VALUE -1) overflows and returns Long/MIN_VALUE.\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#floorDiv-long-long-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/floor-div"},{"added":"1.11","ns":"clojure.math","name":"signum","file":"clojure/math.clj","type":"function","column":1,"see-alsos":null,"line":364,"examples":null,"notes":null,"arglists":["d"],"doc":"Returns the signum function of d - zero for zero, 1.0 if \u003E0, -1.0 if \u003C0.\n If d is ##NaN =\u003E ##NaN\n See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#signum-double-","library-url":"https://github.com/clojure/clojure","href":"/clojure.math/signum"},{"added":"1.2","ns":"clojure.pprint","name":"pprint","file":"clojure/pprint/pprint_base.clj","type":"function","column":1,"see-alsos":[{"created-at":1329988989000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.pprint","name":"pp","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e21"},{"created-at":1331448999000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.pprint","name":"print-table","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e22"}],"line":241,"examples":[{"author":{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"geofffilippi","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/caad97b26450a04c6925249cda76fd74?r=PG&default=identicon"}],"body":"user=\u003E (def *map* (zipmap \n [:a :b :c :d :e] \n (repeat \n (zipmap [:a :b :c :d :e] \n (take 5 (range))))))\n#'user/*map*\nuser=\u003E *map*\n{:e {:e 4, :d 3, :c 2, :b 1, :a 0}, :d {:e 4, :d 3, :c 2, :b 1, :a 0}, :c {:e 4, :d 3, :c 2, :b 1, :a 0}, :b {:e 4, :d 3, :c 2, :b 1, :a 0}, :a {:e 4, :d 3, :c 2, :b 1, :a 0}}\n\nuser=\u003E (clojure.pprint/pprint *map*)\n{:e {:e 4, :d 3, :c 2, :b 1, :a 0},\n :d {:e 4, :d 3, :c 2, :b 1, :a 0},\n :c {:e 4, :d 3, :c 2, :b 1, :a 0},\n :b {:e 4, :d 3, :c 2, :b 1, :a 0},\n :a {:e 4, :d 3, :c 2, :b 1, :a 0}}\nnil\n","created-at":1279160964000,"updated-at":1375976550000,"_id":"542692d0c026201cdc326ec5"}],"notes":null,"arglists":["object","object writer"],"doc":"Pretty print object to the optional output writer. If the writer is not provided, \nprint the object to the currently bound value of *out*.","library-url":"https://github.com/clojure/clojure","href":"/clojure.pprint/pprint"},{"added":"1.2","ns":"clojure.pprint","name":"simple-dispatch","file":"clojure/pprint/dispatch.clj","type":"function","column":1,"see-alsos":null,"line":174,"examples":null,"notes":null,"arglists":["object"],"doc":"The pretty print dispatch function for simple data structure format.","library-url":"https://github.com/clojure/clojure","href":"/clojure.pprint/simple-dispatch"},{"added":"1.2","ns":"clojure.pprint","name":"get-pretty-writer","file":"clojure/pprint/cl_format.clj","type":"function","column":1,"see-alsos":null,"line":1203,"examples":null,"notes":null,"arglists":["writer"],"doc":"Returns the java.io.Writer passed in wrapped in a pretty writer proxy, unless it's \nalready a pretty writer. Generally, it is unnecessary to call this function, since pprint,\nwrite, and cl-format all call it if they need to. However if you want the state to be \npreserved across calls, you will want to wrap them with this. \n\nFor example, when you want to generate column-aware output with multiple calls to cl-format, \ndo it like in this example:\n\n (defn print-table [aseq column-width]\n (binding [*out* (get-pretty-writer *out*)]\n (doseq [row aseq]\n (doseq [col row]\n (cl-format true \"~4D~7,vT\" col column-width))\n (prn))))\n\nNow when you run:\n\n user\u003E (print-table (map #(vector % (* % %) (* % % %)) (range 1 11)) 8)\n\nIt prints a table of squares and cubes for the numbers from 1 to 10:\n\n 1 1 1 \n 2 4 8 \n 3 9 27 \n 4 16 64 \n 5 25 125 \n 6 36 216 \n 7 49 343 \n 8 64 512 \n 9 81 729 \n 10 100 1000","library-url":"https://github.com/clojure/clojure","href":"/clojure.pprint/get-pretty-writer"},{"added":"1.2","ns":"clojure.pprint","name":"*print-suppress-namespaces*","file":"clojure/pprint/pprint_base.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":72,"examples":[{"author":{"login":"philos99","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1de5617efb013ca7c9cf8e5646818ffa?r=PG&default=identicon"},"editors":[{"login":"philos99","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1de5617efb013ca7c9cf8e5646818ffa?r=PG&default=identicon"}],"body":"(require '[clojure.pprint :as pp])\n\n(defmacro plus [n1 n2]\n `(+ ~n1 ~n2))\n\n(macroexpand-1 '(plus 3 4))\n;=\u003E (clojure.core/+ 3 4)\n\n\n(alter-var-root #'pp/*print-suppress-namespaces* (constantly true))\n\n(macroexpand-1 '(plus 3 4))\n;=\u003E (clojure.core/+ 3 4)\n\n;; comes into effect only in pprint.\n(pp/pprint (macroexpand-1 '(plus 3 4)))\n;=\u003E (+ 3 4)\n","created-at":1397944252000,"updated-at":1397944707000,"_id":"542692d6c026201cdc3270ec"}],"notes":null,"arglists":[],"doc":"Don't print namespaces with symbols. This is particularly useful when \npretty printing the results of macro expansions","library-url":"https://github.com/clojure/clojure","href":"/clojure.pprint/*print-suppress-namespaces*"},{"added":"1.2","ns":"clojure.pprint","name":"*print-pretty*","file":"clojure/pprint/pprint_base.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":30,"examples":null,"notes":null,"arglists":[],"doc":"Bind to true if you want write to use pretty printing","library-url":"https://github.com/clojure/clojure","href":"/clojure.pprint/*print-pretty*"},{"added":"1.2","ns":"clojure.pprint","name":"*print-pprint-dispatch*","file":"clojure/pprint/pprint_base.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":34,"examples":null,"notes":null,"arglists":[],"doc":"The pretty print dispatch function. Use with-pprint-dispatch or set-pprint-dispatch\nto modify.","library-url":"https://github.com/clojure/clojure","href":"/clojure.pprint/*print-pprint-dispatch*"},{"added":"1.2","ns":"clojure.pprint","name":"pprint-newline","file":"clojure/pprint/pprint_base.clj","type":"function","column":1,"see-alsos":null,"line":329,"examples":null,"notes":null,"arglists":["kind"],"doc":"Print a conditional newline to a pretty printing stream. kind specifies if the \nnewline is :linear, :miser, :fill, or :mandatory. \n\nThis function is intended for use when writing custom dispatch functions.\n\nOutput is sent to *out* which must be a pretty printing writer.","library-url":"https://github.com/clojure/clojure","href":"/clojure.pprint/pprint-newline"},{"added":"1.2","ns":"clojure.pprint","name":"code-dispatch","file":"clojure/pprint/dispatch.clj","type":"function","column":1,"see-alsos":null,"line":476,"examples":null,"notes":null,"arglists":["object"],"doc":"The pretty print dispatch function for pretty printing Clojure code.","library-url":"https://github.com/clojure/clojure","href":"/clojure.pprint/code-dispatch"},{"added":"1.3","ns":"clojure.pprint","name":"print-length-loop","file":"clojure/pprint/pprint_base.clj","type":"macro","column":1,"see-alsos":null,"line":391,"examples":null,"macro":true,"notes":null,"arglists":["bindings & body"],"doc":"A version of loop that iterates at most *print-length* times. This is designed \nfor use in pretty-printer dispatch functions.","library-url":"https://github.com/clojure/clojure","href":"/clojure.pprint/print-length-loop"},{"added":"1.2","ns":"clojure.pprint","name":"pprint-tab","file":"clojure/pprint/pprint_base.clj","type":"function","column":1,"see-alsos":null,"line":356,"examples":null,"notes":null,"arglists":["kind colnum colinc"],"doc":"Tab at this point in the pretty printing stream. kind specifies whether the tab\nis :line, :section, :line-relative, or :section-relative. \n\nColnum and colinc specify the target column and the increment to move the target\nforward if the output is already past the original target.\n\nThis function is intended for use when writing custom dispatch functions.\n\nOutput is sent to *out* which must be a pretty printing writer.\n\nTHIS FUNCTION IS NOT YET IMPLEMENTED.","library-url":"https://github.com/clojure/clojure","href":"/clojure.pprint/pprint-tab"},{"added":"1.2","ns":"clojure.pprint","name":"pprint-logical-block","file":"clojure/pprint/pprint_base.clj","type":"macro","column":1,"see-alsos":null,"line":302,"examples":null,"macro":true,"notes":null,"arglists":["options* body"],"doc":"Execute the body as a pretty printing logical block with output to *out* which \nmust be a pretty printing writer. When used from pprint or cl-format, this can be \nassumed. \n\nThis function is intended for use when writing custom dispatch functions.\n\nBefore the body, the caller can optionally specify options: :prefix, :per-line-prefix, \nand :suffix.","library-url":"https://github.com/clojure/clojure","href":"/clojure.pprint/pprint-logical-block"},{"added":"1.3","ns":"clojure.pprint","name":"print-table","file":"clojure/pprint/print_table.clj","type":"function","column":1,"see-alsos":[{"created-at":1331448986000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.pprint","name":"pprint","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e86"},{"created-at":1331449122000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.inspector","name":"inspect-table","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e87"}],"line":11,"examples":[{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (use 'clojure.pprint)\nnil\n\n;; By default, columns are in the order returned by (keys (first rows))\nuser=\u003E (print-table [{:a 1 :b 2 :c 3} {:b 5 :a 7 :c \"dog\"}])\n=============\n:a | :c | :b\n=============\n1 | 3 | 2 \n7 | dog | 5 \n=============\nnil\n\n;; If there are keys not in the first row, and/or you want to specify only\n;; some, or in a particular order, give the desired keys as the first arg.\nuser=\u003E (print-table [:b :a] [{:a 1 :b 2 :c 3} {:b 5 :a 7 :c \"dog\"}])\n=======\n:b | :a\n=======\n2 | 1 \n5 | 7 \n=======\nnil\n","created-at":1329889278000,"updated-at":1331449061000,"_id":"542692d6c026201cdc3270f1"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (use 'clojure.pprint 'clojure.reflect)\nnil\nuser=\u003E (def x (:members (reflect clojure.lang.BigInt)))\n#'user/x\nuser=\u003E (print-table [:name :type :flags] (sort-by :name x))\n======================================================================\n:name | :type | :flags \n======================================================================\nONE | clojure.lang.BigInt | #{:static :public :final}\nZERO | clojure.lang.BigInt | #{:static :public :final}\nadd | | #{:public} \nbipart | java.math.BigInteger | #{:public :final} \nbitLength | | #{:public} \nbyteValue | | #{:public} \nclojure.lang.BigInt | | #{:private} \ndoubleValue | | #{:public} \nequals | | #{:public} \nfloatValue | | #{:public} \nfromBigInteger | | #{:static :public} \nfromLong | | #{:static :public} \nhashCode | | #{:public} \nintValue | | #{:public} \nlongValue | | #{:public} \nlpart | long | #{:public :final} \nlt | | #{:public} \nmultiply | | #{:public} \nquotient | | #{:public} \nremainder | | #{:public} \nshortValue | | #{:public} \ntoBigInteger | | #{:public} \ntoString | | #{:public} \nvalueOf | | #{:static :public} \n======================================================================\nnil\n","created-at":1329889427000,"updated-at":1329889427000,"_id":"542692d6c026201cdc3270f3"}],"notes":null,"arglists":["ks rows","rows"],"doc":"Prints a collection of maps in a textual table. Prints table headings\n ks, and then a line of output for each row, corresponding to the keys\n in ks. If ks are not specified, use the keys of the first item in rows.","library-url":"https://github.com/clojure/clojure","href":"/clojure.pprint/print-table"},{"added":"1.2","ns":"clojure.pprint","name":"pp","file":"clojure/pprint/pprint_base.clj","type":"macro","column":1,"see-alsos":null,"line":254,"examples":[{"author":{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (zipmap \n [:a :b :c :d :e] \n (repeat \n (zipmap \n [:a :b :c :d :e] \n (take 5 (range)))))\n{:e {:e 4, :d 3, :c 2, :b 1, :a 0}, :d {:e 4, :d 3, :c 2, :b 1, :a 0}, :c {:e 4, :d 3, :c 2, :b 1, :a 0}, :b {:e 4, :d 3, :c 2, :b 1, :a 0}, :a {:e 4, :d 3, :c 2, :b 1, :a 0}}\n\nuser=\u003E (clojure.pprint/pp)\n{:e {:e 4, :d 3, :c 2, :b 1, :a 0},\n :d {:e 4, :d 3, :c 2, :b 1, :a 0},\n :c {:e 4, :d 3, :c 2, :b 1, :a 0},\n :b {:e 4, :d 3, :c 2, :b 1, :a 0},\n :a {:e 4, :d 3, :c 2, :b 1, :a 0}}\nnil\n","created-at":1279160860000,"updated-at":1285501102000,"_id":"542692d0c026201cdc326ec8"}],"macro":true,"notes":null,"arglists":[""],"doc":"A convenience macro that pretty prints the last thing output. This is\nexactly equivalent to (pprint *1).","library-url":"https://github.com/clojure/clojure","href":"/clojure.pprint/pp"},{"added":"1.2","ns":"clojure.pprint","name":"set-pprint-dispatch","file":"clojure/pprint/pprint_base.clj","type":"function","column":1,"see-alsos":null,"line":260,"examples":null,"notes":null,"arglists":["function"],"doc":"Set the pretty print dispatch function to a function matching (fn [obj] ...)\nwhere obj is the object to pretty print. That function will be called with *out* set\nto a pretty printing writer to which it should do its printing.\n\nFor example functions, see simple-dispatch and code-dispatch in \nclojure.pprint.dispatch.clj.","library-url":"https://github.com/clojure/clojure","href":"/clojure.pprint/set-pprint-dispatch"},{"added":"1.2","ns":"clojure.pprint","name":"fresh-line","file":"clojure/pprint/cl_format.clj","type":"function","column":1,"see-alsos":null,"line":1245,"examples":null,"notes":null,"arglists":[""],"doc":"Make a newline if *out* is not already at the beginning of the line. If *out* is\nnot a pretty writer (which keeps track of columns), this function always outputs a newline.","library-url":"https://github.com/clojure/clojure","href":"/clojure.pprint/fresh-line"},{"added":"1.2","ns":"clojure.pprint","name":"formatter-out","file":"clojure/pprint/cl_format.clj","type":"macro","column":1,"see-alsos":null,"line":1936,"examples":null,"macro":true,"notes":null,"arglists":["format-in"],"doc":"Makes a function which can directly run format-in. The function is\nfn [& args] ... and returns nil. This version of the formatter macro is\ndesigned to be used with *out* set to an appropriate Writer. In particular,\nthis is meant to be used as part of a pretty printer dispatch method.\n\nformat-in can be either a control string or a previously compiled format.","library-url":"https://github.com/clojure/clojure","href":"/clojure.pprint/formatter-out"},{"added":"1.2","ns":"clojure.pprint","name":"formatter","file":"clojure/pprint/cl_format.clj","type":"macro","column":1,"see-alsos":null,"line":1916,"examples":null,"macro":true,"notes":null,"arglists":["format-in"],"doc":"Makes a function which can directly run format-in. The function is\nfn [stream & args] ... and returns nil unless the stream is nil (meaning \noutput to a string) in which case it returns the resulting string.\n\nformat-in can be either a control string or a previously compiled format.","library-url":"https://github.com/clojure/clojure","href":"/clojure.pprint/formatter"},{"added":"1.2","ns":"clojure.pprint","name":"pprint-indent","file":"clojure/pprint/pprint_base.clj","type":"function","column":1,"see-alsos":null,"line":341,"examples":null,"notes":null,"arglists":["relative-to n"],"doc":"Create an indent at this point in the pretty printing stream. This defines how \nfollowing lines are indented. relative-to can be either :block or :current depending \nwhether the indent should be computed relative to the start of the logical block or\nthe current column position. n is an offset. \n\nThis function is intended for use when writing custom dispatch functions.\n\nOutput is sent to *out* which must be a pretty printing writer.","library-url":"https://github.com/clojure/clojure","href":"/clojure.pprint/pprint-indent"},{"added":"1.2","ns":"clojure.pprint","name":"*print-radix*","file":"clojure/pprint/pprint_base.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":80,"examples":null,"notes":null,"arglists":[],"doc":"Print a radix specifier in front of integers and rationals. If *print-base* is 2, 8, \nor 16, then the radix specifier used is #b, #o, or #x, respectively. Otherwise the \nradix specifier is in the form #XXr where XX is the decimal value of *print-base* ","library-url":"https://github.com/clojure/clojure","href":"/clojure.pprint/*print-radix*"},{"added":"1.2","ns":"clojure.pprint","name":"cl-format","file":"clojure/pprint/cl_format.clj","type":"function","column":1,"see-alsos":[{"created-at":1330170813000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"printf","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f44"},{"created-at":1330170818000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"format","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f45"}],"line":27,"examples":[{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":";; Formatting integers, with options, in one of many bases.\n\n;; First arg true sends formatted output to *out*\nuser=\u003E (cl-format true \"~5d\\n\" 3)\n 3\nnil\n\n;; First arg nil or false causes formatted output to be returned as string\nuser=\u003E (cl-format nil \"~5d\" 3)\n\" 3\"\n\nuser=\u003E (cl-format nil \"Pad with leading zeros ~5,'0d\" 3)\n\"Pad with leading zeros 00003\"\n\nuser=\u003E (cl-format nil \"Pad with leading asterisks ~5,'*d\" 3)\n\"Pad with leading asterisks ****3\"\n\n;; If there is a way to specify left-justifying a number in a single\n;; format string, please add it here. It can be done by using one\n;; cl-format invocation to get a formatted number as a string, and\n;; then use the ~\u003Cwidth\u003Ea specifier on the result.\nuser=\u003E (cl-format nil \"~15a\" (cl-format nil \"~:d\" 1234567))\n\"1,234,567 \"\n\nuser=\u003E (cl-format nil \"Always print the sign ~5@d\" 3)\n\"Always print the sign +3\"\n\nuser=\u003E (cl-format nil \"Use comma group-separator every 3 digits ~12:d\" 1234567)\n\"Use comma group-separator every 3 digits 1,234,567\"\n\nuser=\u003E (cl-format nil \"decimal ~d binary ~b octal ~o hex ~x\" 63 63 63 63)\n\"decimal 63 binary 111111 octal 77 hex 3f\"\n\nuser=\u003E (cl-format nil \"base 7 ~7r with width and zero pad ~7,15,'0r\" 63 63)\n\"base 7 120 with width and zero pad 000000000000120\"\n\n;; No need for you to do any conversions to use cl-format with BigInt,\n;; BigInteger, or BigDecimal.\nuser=\u003E (cl-format nil \"cl-format handles BigInts ~15d\" 12345678901234567890)\n\"cl-format handles BigInts 12345678901234567890\"\n\nuser=\u003E (cl-format nil \"Be aware of auto-conversion ~8,'0d ~8,'0d\" 2.4 -5/4)\n\"Be aware of auto-conversion 000002.4 0000-5/4\"\n\n;; This might look like a bug, but it is actually behavior specified by the\n;; Common Lisp HyperSpec mentioned in the docs above. If you don't want that\n;; behavior (format \"%08d\" -2) might suit your purposes better.\nuser=\u003E (cl-format nil \"~8,'0d\" -2)\n\"000000-2\"","created-at":1332481954000,"updated-at":1332482468000,"_id":"542692d6c026201cdc3270ee"}],"notes":null,"arglists":["writer format-in & args"],"doc":"An implementation of a Common Lisp compatible format function. cl-format formats its\narguments to an output stream or string based on the format control string given. It \nsupports sophisticated formatting of structured data.\n\nWriter is an instance of java.io.Writer, true to output to *out* or nil to output \nto a string, format-in is the format control string and the remaining arguments \nare the data to be formatted.\n\nThe format control string is a string to be output with embedded 'format directives' \ndescribing how to format the various arguments passed in.\n\nIf writer is nil, cl-format returns the formatted result string. Otherwise, cl-format \nreturns nil.\n\nFor example:\n (let [results [46 38 22]]\n (cl-format true \"There ~[are~;is~:;are~]~:* ~d result~:p: ~{~d~^, ~}~%\" \n (count results) results))\n\nPrints to *out*:\n There are 3 results: 46, 38, 22\n\nDetailed documentation on format control strings is available in the \"Common Lisp the \nLanguage, 2nd edition\", Chapter 22 (available online at:\nhttp://www.cs.cmu.edu/afs/cs.cmu.edu/project/ai-repository/ai/html/cltl/clm/node200.html#SECTION002633000000000000000) \nand in the Common Lisp HyperSpec at \nhttp://www.lispworks.com/documentation/HyperSpec/Body/22_c.htm\n","library-url":"https://github.com/clojure/clojure","href":"/clojure.pprint/cl-format"},{"added":"1.2","ns":"clojure.pprint","name":"*print-miser-width*","file":"clojure/pprint/pprint_base.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":47,"examples":null,"notes":null,"arglists":[],"doc":"The column at which to enter miser style. Depending on the dispatch table, \nmiser style add newlines in more places to try to keep lines short allowing for further \nlevels of nesting.","library-url":"https://github.com/clojure/clojure","href":"/clojure.pprint/*print-miser-width*"},{"added":"1.2","ns":"clojure.pprint","name":"write","file":"clojure/pprint/pprint_base.clj","type":"function","column":1,"see-alsos":null,"line":197,"examples":null,"notes":null,"arglists":["object & kw-args"],"doc":"Write an object subject to the current bindings of the printer control variables.\nUse the kw-args argument to override individual variables for this call (and any \nrecursive calls). Returns the string result if :stream is nil or nil otherwise.\n\nThe following keyword arguments can be passed with values:\n Keyword Meaning Default value\n :stream Writer for output or nil true (indicates *out*)\n :base Base to use for writing rationals Current value of *print-base*\n :circle* If true, mark circular structures Current value of *print-circle*\n :length Maximum elements to show in sublists Current value of *print-length*\n :level Maximum depth Current value of *print-level*\n :lines* Maximum lines of output Current value of *print-lines*\n :miser-width Width to enter miser mode Current value of *print-miser-width*\n :dispatch The pretty print dispatch function Current value of *print-pprint-dispatch*\n :pretty If true, do pretty printing Current value of *print-pretty*\n :radix If true, prepend a radix specifier Current value of *print-radix*\n :readably* If true, print readably Current value of *print-readably*\n :right-margin The column for the right margin Current value of *print-right-margin*\n :suppress-namespaces If true, no namespaces in symbols Current value of *print-suppress-namespaces*\n\n * = not yet supported\n","library-url":"https://github.com/clojure/clojure","href":"/clojure.pprint/write"},{"added":"1.2","ns":"clojure.pprint","name":"*print-right-margin*","file":"clojure/pprint/pprint_base.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":40,"examples":null,"notes":null,"arglists":[],"doc":"Pretty printing will try to avoid anything going beyond this column.\nSet it to nil to have pprint let the line be arbitrarily long. This will ignore all \nnon-mandatory newlines.","library-url":"https://github.com/clojure/clojure","href":"/clojure.pprint/*print-right-margin*"},{"added":"1.2","ns":"clojure.pprint","name":"write-out","file":"clojure/pprint/pprint_base.clj","type":"function","column":1,"see-alsos":null,"line":171,"examples":null,"notes":null,"arglists":["object"],"doc":"Write an object to *out* subject to the current bindings of the printer control \nvariables. Use the kw-args argument to override individual variables for this call (and \nany recursive calls).\n\n*out* must be a PrettyWriter if pretty printing is enabled. This is the responsibility\nof the caller.\n\nThis method is primarily intended for use by pretty print dispatch functions that \nalready know that the pretty printer will have set up their environment appropriately.\nNormal library clients should use the standard \"write\" interface. ","library-url":"https://github.com/clojure/clojure","href":"/clojure.pprint/write-out"},{"added":"1.2","ns":"clojure.pprint","name":"with-pprint-dispatch","file":"clojure/pprint/pprint_base.clj","type":"macro","column":1,"see-alsos":null,"line":274,"examples":null,"macro":true,"notes":null,"arglists":["function & body"],"doc":"Execute body with the pretty print dispatch function bound to function.","library-url":"https://github.com/clojure/clojure","href":"/clojure.pprint/with-pprint-dispatch"},{"added":"1.2","ns":"clojure.pprint","name":"*print-base*","file":"clojure/pprint/pprint_base.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":87,"examples":null,"notes":null,"arglists":[],"doc":"The base to use for printing integers and rationals.","library-url":"https://github.com/clojure/clojure","href":"/clojure.pprint/*print-base*"},{"ns":"clojure.reflect","name":"-\u003EField","file":"clojure/reflect/java.clj","type":"function","column":1,"see-alsos":null,"line":154,"examples":null,"notes":null,"arglists":["name type declaring-class flags"],"doc":"Positional factory function for class clojure.reflect.Field.","library-url":"https://github.com/clojure/clojure","href":"/clojure.reflect/-\u003EField"},{"ns":"clojure.reflect","name":"-\u003EMethod","file":"clojure/reflect/java.clj","type":"function","column":1,"see-alsos":null,"line":134,"examples":null,"notes":null,"arglists":["name return-type declaring-class parameter-types exception-types flags"],"doc":"Positional factory function for class clojure.reflect.Method.","library-url":"https://github.com/clojure/clojure","href":"/clojure.reflect/-\u003EMethod"},{"ns":"clojure.reflect","name":"TypeReference","file":"clojure/reflect.clj","type":"var","column":1,"see-alsos":null,"line":48,"examples":null,"notes":null,"arglists":[],"doc":"A TypeReference can be unambiguously converted to a type name on\n the host platform.\n\n All typerefs are normalized into symbols. If you need to\n normalize a typeref yourself, call typesym.","library-url":"https://github.com/clojure/clojure","href":"/clojure.reflect/TypeReference"},{"added":"1.3","ns":"clojure.reflect","name":"reflect","file":"clojure/reflect.clj","type":"function","column":1,"see-alsos":[{"created-at":1332916378000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.pprint","name":"print-table","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e88"}],"line":115,"examples":[{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (use 'clojure.reflect 'clojure.pprint)\nnil\nuser=\u003E (def r (reflect *in*))\n#'user/r\nuser=\u003E (count (:members r))\n9\nuser=\u003E (pprint (map class (:members r)))\n(clojure.reflect.Constructor\n clojure.reflect.Method\n clojure.reflect.Field\n clojure.reflect.Field\n clojure.reflect.Method\n clojure.reflect.Method\n clojure.reflect.Method\n clojure.reflect.Method\n clojure.reflect.Field)\nnil\nuser=\u003E (pprint r)\n{:bases #{java.io.PushbackReader},\n :flags #{:public},\n :members\n #{{:name clojure.lang.LineNumberingPushbackReader,\n :declaring-class clojure.lang.LineNumberingPushbackReader,\n :parameter-types [java.io.Reader],\n :exception-types [],\n :flags #{:public}}\n {:name read,\n :return-type int,\n :declaring-class clojure.lang.LineNumberingPushbackReader,\n :parameter-types [],\n :exception-types [java.io.IOException],\n :flags #{:public}}\n {:name _atLineStart,\n :type boolean,\n :declaring-class clojure.lang.LineNumberingPushbackReader,\n :flags #{:private}}\n {:name newline,\n :type int,\n :declaring-class clojure.lang.LineNumberingPushbackReader,\n :flags #{:private :static :final}}\n {:name unread,\n :return-type void,\n :declaring-class clojure.lang.LineNumberingPushbackReader,\n :parameter-types [int],\n :exception-types [java.io.IOException],\n :flags #{:public}}\n {:name readLine,\n :return-type java.lang.String,\n :declaring-class clojure.lang.LineNumberingPushbackReader,\n :parameter-types [],\n :exception-types [java.io.IOException],\n :flags #{:public}}\n {:name atLineStart,\n :return-type boolean,\n :declaring-class clojure.lang.LineNumberingPushbackReader,\n :parameter-types [],\n :exception-types [],\n :flags #{:public}}\n {:name getLineNumber,\n :return-type int,\n :declaring-class clojure.lang.LineNumberingPushbackReader,\n :parameter-types [],\n :exception-types [],\n :flags #{:public}}\n {:name _prev,\n :type boolean,\n :declaring-class clojure.lang.LineNumberingPushbackReader,\n :flags #{:private}}}}\nnil\n","created-at":1329989405000,"updated-at":1329989405000,"_id":"542692d6c026201cdc3270f4"}],"notes":null,"arglists":["obj & options"],"doc":"Alpha - subject to change.\n Reflect on the type of obj (or obj itself if obj is a class).\n Return value and options are the same as for type-reflect. ","library-url":"https://github.com/clojure/clojure","href":"/clojure.reflect/reflect"},{"ns":"clojure.reflect","name":"map-\u003EField","file":"clojure/reflect/java.clj","type":"function","column":1,"see-alsos":null,"line":154,"examples":null,"notes":null,"arglists":["m__8001__auto__"],"doc":"Factory function for class clojure.reflect.Field, taking a map of keywords to field values.","library-url":"https://github.com/clojure/clojure","href":"/clojure.reflect/map-\u003EField"},{"ns":"clojure.reflect","name":"map-\u003EMethod","file":"clojure/reflect/java.clj","type":"function","column":1,"see-alsos":null,"line":134,"examples":null,"notes":null,"arglists":["m__8001__auto__"],"doc":"Factory function for class clojure.reflect.Method, taking a map of keywords to field values.","library-url":"https://github.com/clojure/clojure","href":"/clojure.reflect/map-\u003EMethod"},{"ns":"clojure.reflect","name":"typename","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["o"],"doc":"Returns Java name as returned by ASM getClassName, e.g. byte[], java.lang.String[]","library-url":"https://github.com/clojure/clojure","href":"/clojure.reflect/typename"},{"ns":"clojure.reflect","name":"-\u003EJavaReflector","file":"clojure/reflect/java.clj","type":"function","column":1,"see-alsos":null,"line":178,"examples":null,"notes":null,"arglists":["classloader"],"doc":"Positional factory function for class clojure.reflect.JavaReflector.","library-url":"https://github.com/clojure/clojure","href":"/clojure.reflect/-\u003EJavaReflector"},{"ns":"clojure.reflect","name":"-\u003EAsmReflector","file":"clojure/reflect/java.clj","type":"function","column":1,"see-alsos":null,"line":208,"examples":null,"notes":null,"arglists":["class-resolver"],"doc":"Positional factory function for class clojure.reflect.AsmReflector.","library-url":"https://github.com/clojure/clojure","href":"/clojure.reflect/-\u003EAsmReflector"},{"ns":"clojure.reflect","name":"resolve-class","type":"function","see-alsos":null,"examples":[{"author":{"login":"weakreference","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/86146f8bd5207b97701c0f16f0017334?r=PG&default=identicon"},"editors":[],"body":";;Check if class c exists on the classpath\n(use '[clojure.reflect :only [resolve-class]])\n\n(defn class-exists? [c] \n (resolve-class (.getContextClassLoader (Thread/currentThread)) c))\n\nuser=\u003E (class-exists? 'org.joda.time.DateTime) \nnil","created-at":1351132479000,"updated-at":1351132479000,"_id":"542692d6c026201cdc3270f5"}],"notes":null,"tag":"java.io.InputStream","arglists":["this name"],"doc":"Given a class name, return that typeref's class bytes as an InputStream.","library-url":"https://github.com/clojure/clojure","href":"/clojure.reflect/resolve-class"},{"ns":"clojure.reflect","name":"flag-descriptors","file":"clojure/reflect/java.clj","type":"var","column":1,"see-alsos":null,"line":77,"examples":null,"notes":null,"arglists":[],"doc":"The Java access bitflags, along with their friendly names and\nthe kinds of objects to which they can apply.","library-url":"https://github.com/clojure/clojure","href":"/clojure.reflect/flag-descriptors"},{"ns":"clojure.reflect","name":"do-reflect","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["reflector typeref"],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.reflect/do-reflect"},{"ns":"clojure.reflect","name":"ClassResolver","file":"clojure/reflect/java.clj","type":"var","column":1,"see-alsos":null,"line":196,"examples":null,"notes":null,"arglists":[],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.reflect/ClassResolver"},{"ns":"clojure.reflect","name":"Reflector","file":"clojure/reflect.clj","type":"var","column":1,"see-alsos":null,"line":44,"examples":null,"notes":null,"arglists":[],"doc":"Protocol for reflection implementers.","library-url":"https://github.com/clojure/clojure","href":"/clojure.reflect/Reflector"},{"ns":"clojure.reflect","name":"-\u003EConstructor","file":"clojure/reflect/java.clj","type":"function","column":1,"see-alsos":null,"line":115,"examples":null,"notes":null,"arglists":["name declaring-class parameter-types exception-types flags"],"doc":"Positional factory function for class clojure.reflect.Constructor.","library-url":"https://github.com/clojure/clojure","href":"/clojure.reflect/-\u003EConstructor"},{"ns":"clojure.reflect","name":"map-\u003EConstructor","file":"clojure/reflect/java.clj","type":"function","column":1,"see-alsos":null,"line":115,"examples":null,"notes":null,"arglists":["m__8001__auto__"],"doc":"Factory function for class clojure.reflect.Constructor, taking a map of keywords to field values.","library-url":"https://github.com/clojure/clojure","href":"/clojure.reflect/map-\u003EConstructor"},{"added":"1.3","ns":"clojure.reflect","name":"type-reflect","file":"clojure/reflect.clj","type":"function","column":1,"see-alsos":null,"line":58,"examples":null,"notes":null,"arglists":["typeref & options"],"doc":"Alpha - subject to change.\n Reflect on a typeref, returning a map with :bases, :flags, and\n :members. In the discussion below, names are always Clojure symbols.\n\n :bases a set of names of the type's bases\n :flags a set of keywords naming the boolean attributes\n of the type.\n :members a set of the type's members. Each member is a map\n and can be a constructor, method, or field.\n\n Keys common to all members:\n :name name of the type \n :declaring-class name of the declarer\n :flags keyword naming boolean attributes of the member\n\n Keys specific to constructors:\n :parameter-types vector of parameter type names\n :exception-types vector of exception type names\n\n Key specific to methods:\n :parameter-types vector of parameter type names\n :exception-types vector of exception type names\n :return-type return type name\n\n Keys specific to fields:\n :type type name\n\n Options:\n\n :ancestors in addition to the keys described above, also\n include an :ancestors key with the entire set of\n ancestors, and add all ancestor members to\n :members.\n :reflector implementation to use. Defaults to JavaReflector,\n AsmReflector is also an option.","library-url":"https://github.com/clojure/clojure","href":"/clojure.reflect/type-reflect"},{"ns":"clojure.repl","name":"source-fn","file":"clojure/repl.clj","type":"function","column":1,"see-alsos":[{"created-at":1353815572000,"author":{"login":"franks42","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b3ee701dd6c481e5d310467ddfe62c48?r=PG&default=identicon"},"to-var":{"ns":"clojure.repl","name":"source","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e83"}],"line":147,"examples":null,"notes":null,"arglists":["x"],"doc":"Returns a string of the source code for the given symbol, if it can\n find it. This requires that the symbol resolve to a Var defined in\n a namespace for which the .clj is in the classpath. Returns nil if\n it can't find the source. For most REPL usage, 'source' is more\n convenient.\n\n Example: (source-fn 'filter)","library-url":"https://github.com/clojure/clojure","href":"/clojure.repl/source-fn"},{"added":"1.0","ns":"clojure.repl","name":"doc","file":"clojure/repl.clj","type":"macro","column":1,"see-alsos":[{"created-at":1342639092000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.repl","name":"source","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521af5"},{"created-at":1342639183000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.repl","name":"dir","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521af6"},{"created-at":1342639337000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.repl","name":"apropos","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521af7"}],"line":131,"examples":[{"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"editors":[],"body":"=\u003E (doc map)\n;; prints in console:\n-------------------------\nclojure.core/map\n([f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & colls])\n Returns a lazy sequence consisting of the result of applying f to the\n set of first items of each coll, followed by applying f to the set\n of second items in each coll, until any one of the colls is\n exhausted. Any remaining items in other colls are ignored. Function\n f should accept number-of-colls arguments.","created-at":1342639164000,"updated-at":1342639164000,"_id":"542692d6c026201cdc3270f7"},{"author":{"login":"ryo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3f7913b563c72083c74030d928ba407e?r=PG&default=identicon"},"editors":[],"body":"user\u003E (doc clojure.core)\n-------------------------\nclojure.core\n Fundamental library of the Clojure language\n","created-at":1398682749000,"updated-at":1398682749000,"_id":"542692d6c026201cdc3270f8"}],"macro":true,"notes":[{"updated-at":1350125867000,"body":"Note that the clojure.repl namespace which contains doc is not loaded by default in Emacs' SLIME mode, because SLIME provides its own doc function via C-c C-d d.","created-at":1350125867000,"author":{"login":"pjlegato","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4ce55cfd8b3ae2f63f5ecbc8fc1c05d4?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fed"}],"arglists":["name"],"doc":"Prints documentation for a var or special form given its name,\n or for a spec if given a keyword","library-url":"https://github.com/clojure/clojure","href":"/clojure.repl/doc"},{"added":"1.3","ns":"clojure.repl","name":"stack-element-str","file":"clojure/repl.clj","type":"function","column":1,"see-alsos":null,"line":227,"examples":null,"notes":null,"arglists":["el"],"doc":"Returns a (possibly unmunged) string representation of a StackTraceElement","library-url":"https://github.com/clojure/clojure","href":"/clojure.repl/stack-element-str"},{"added":"1.0","ns":"clojure.repl","name":"find-doc","file":"clojure/repl.clj","type":"function","column":1,"see-alsos":null,"line":115,"examples":[{"author":{"login":"pimgeek","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fa1bf77254fb5c14b4fd5afd1c11fe53?r=PG&default=identicon"},"editors":[{"login":"pimgeek","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fa1bf77254fb5c14b4fd5afd1c11fe53?r=PG&default=identicon"}],"body":"user=\u003E (find-doc \"data structure\")\n\n-------------------------\nclojure.core/eval\n([form])\n Evaluates the form data structure (not text!) and returns the result.\n-------------------------\nclojure.core/ifn?\n([x])\n Returns true if x implements IFn. Note that many data structures\n (e.g. sets and maps) implement IFn\n","created-at":1365967175000,"updated-at":1365967933000,"_id":"542692d6c026201cdc3270f9"}],"notes":null,"arglists":["re-string-or-pattern"],"doc":"Prints documentation for any var whose documentation or name\n contains a match for re-string-or-pattern","library-url":"https://github.com/clojure/clojure","href":"/clojure.repl/find-doc"},{"ns":"clojure.repl","name":"dir","file":"clojure/repl.clj","type":"macro","column":1,"see-alsos":[{"created-at":1342639192000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.repl","name":"doc","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b24"},{"created-at":1342639197000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.repl","name":"source","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b25"},{"created-at":1342639317000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.repl","name":"apropos","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b26"}],"line":201,"examples":[{"author":{"login":"teyc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bd6e62afb4881ab0f617611b8b65d003?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (require 'clojure.string 'clojure.repl)\n\nuser=\u003E (clojure.repl/dir clojure.string)\nblank?\ncapitalize\nescape\njoin\nlower-case\nreplace\nreplace-first\nreverse\nsplit\nsplit-lines\ntrim\ntrim-newline\ntriml\ntrimr\nupper-case","created-at":1283977504000,"updated-at":1332953035000,"_id":"542692d0c026201cdc326ecf"}],"macro":true,"notes":null,"arglists":["nsname"],"doc":"Prints a sorted directory of public vars in a namespace","library-url":"https://github.com/clojure/clojure","href":"/clojure.repl/dir"},{"added":"1.3","ns":"clojure.repl","name":"pst","file":"clojure/repl.clj","type":"function","column":1,"see-alsos":[{"created-at":1334156025000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"*e","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f5f"}],"line":240,"examples":[{"author":{"login":"pimgeek","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fa1bf77254fb5c14b4fd5afd1c11fe53?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (pst)\nnil\n\nuser=\u003E (/ 1 0)\nArithmeticException Divide by zero clojure.lang.Numbers.divide (Numbers.java:156)\n\nuser=\u003E (pst)\nArithmeticException Divide by zero\n\tclojure.lang.Numbers.divide (Numbers.java:156)\n\tclojure.lang.Numbers.divide (Numbers.java:3691)\n\tuser/eval13 (NO_SOURCE_FILE:7)\n\tclojure.lang.Compiler.eval (Compiler.java:6619)\n\tclojure.lang.Compiler.eval (Compiler.java:6582)\n\tclojure.core/eval (core.clj:2852)\n\tclojure.main/repl/read-eval-print--6588/fn--6591 (main.clj:259)\n\tclojure.main/repl/read-eval-print--6588 (main.clj:259)\n\tclojure.main/repl/fn--6597 (main.clj:277)\n\tclojure.main/repl (main.clj:277)\n\tclojure.main/repl-opt (main.clj:343)\n\tclojure.main/main (main.clj:441)\nnil\n","created-at":1365968672000,"updated-at":1365968672000,"_id":"542692d6c026201cdc3270fb"}],"notes":null,"arglists":["","e-or-depth","e depth"],"doc":"Prints a stack trace of the exception, to the depth requested. If none supplied, uses the root cause of the\n most recent repl exception (*e), and a depth of 12.","library-url":"https://github.com/clojure/clojure","href":"/clojure.repl/pst"},{"ns":"clojure.repl","name":"dir-fn","file":"clojure/repl.clj","type":"function","column":1,"see-alsos":null,"line":195,"examples":[{"author":{"login":"teyc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bd6e62afb4881ab0f617611b8b65d003?r=PG&default=identicon"},"editors":[],"body":"\u003Cpre\u003Euser=\u003E (require 'clojure.repl 'clojure.string)\r\n\r\nuser=\u003E (pprint (clojure.repl/dir-fn 'clojure.string))\r\n(blank?\r\n capitalize\r\n escape\r\n join\r\n lower-case\r\n replace\r\n replace-first\r\n reverse\r\n split\r\n split-lines\r\n trim\r\n trim-newline\r\n triml\r\n trimr\r\n upper-case)\r\nnil\r\n\u003C/pre\u003E","created-at":1283977379000,"updated-at":1283977379000,"_id":"542692d0c026201cdc326ed1"}],"notes":null,"arglists":["ns"],"doc":"Returns a sorted seq of symbols naming public vars in\n a namespace or namespace alias. Looks for aliases in *ns*","library-url":"https://github.com/clojure/clojure","href":"/clojure.repl/dir-fn"},{"ns":"clojure.repl","name":"source","file":"clojure/repl.clj","type":"macro","column":1,"see-alsos":[{"created-at":1342639074000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.repl","name":"doc","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521db6"},{"created-at":1342639176000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.repl","name":"dir","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521db7"},{"created-at":1342639308000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.repl","name":"apropos","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521db8"}],"line":172,"examples":[{"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (source max)\n;; prints in console:\n(defn max\n \"Returns the greatest of the nums.\"\n {:added \"1.0\"}\n ([x] x)\n ([x y] (if (\u003E x y) x y))\n ([x y & more]\n (reduce max (max x y) more)))\n","created-at":1279775890000,"updated-at":1285497544000,"_id":"542692d0c026201cdc326ecb"}],"macro":true,"notes":null,"arglists":["n"],"doc":"Prints the source code for the given symbol, if it can find it.\n This requires that the symbol resolve to a Var defined in a\n namespace for which the .clj is in the classpath.\n\n Example: (source filter)","library-url":"https://github.com/clojure/clojure","href":"/clojure.repl/source"},{"ns":"clojure.repl","name":"set-break-handler!","file":"clojure/repl.clj","type":"function","column":1,"see-alsos":null,"line":279,"examples":null,"notes":null,"arglists":["","f"],"doc":"Register INT signal handler. After calling this, Ctrl-C will cause\n the given function f to be called with a single argument, the signal.\n Uses thread-stopper if no function given.","library-url":"https://github.com/clojure/clojure","href":"/clojure.repl/set-break-handler!"},{"added":"1.3","ns":"clojure.repl","name":"root-cause","file":"clojure/repl.clj","type":"function","column":1,"see-alsos":null,"line":214,"examples":null,"notes":null,"arglists":["t"],"doc":"Returns the initial cause of an exception or error by peeling off all of\n its wrappers","library-url":"https://github.com/clojure/clojure","href":"/clojure.repl/root-cause"},{"added":"1.3","ns":"clojure.repl","name":"demunge","file":"clojure/repl.clj","type":"function","column":1,"see-alsos":null,"line":207,"examples":[{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (-\u003E + class str demunge)\n\"class clojure.core/+\"","created-at":1335431555000,"updated-at":1335431555000,"_id":"542692d6c026201cdc3270f6"}],"notes":null,"arglists":["fn-name"],"doc":"Given a string representation of a fn class,\n as in a stack trace element, returns a readable version.","library-url":"https://github.com/clojure/clojure","href":"/clojure.repl/demunge"},{"ns":"clojure.repl","name":"thread-stopper","file":"clojure/repl.clj","type":"function","column":1,"see-alsos":null,"line":273,"examples":null,"notes":null,"arglists":["","thread"],"doc":"Returns a function that takes one arg and uses that as an exception message\n to stop the given thread. Defaults to the current thread","library-url":"https://github.com/clojure/clojure","href":"/clojure.repl/thread-stopper"},{"ns":"clojure.repl","name":"apropos","file":"clojure/repl.clj","type":"function","column":1,"see-alsos":[{"created-at":1342639345000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.repl","name":"source","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e1e"},{"created-at":1342639350000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.repl","name":"doc","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e1f"},{"created-at":1342639354000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.repl","name":"dir","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e20"}],"line":181,"examples":[{"author":{"login":"teyc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bd6e62afb4881ab0f617611b8b65d003?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (apropos \"temp\")\n()\n\nuser=\u003E (require 'clojure.template)\nnil\n\nuser=\u003E (apropos \"temp\")\n(apply-template do-template)\n","created-at":1283977701000,"updated-at":1285487332000,"_id":"542692d0c026201cdc326ecd"}],"notes":null,"arglists":["str-or-pattern"],"doc":"Given a regular expression or stringable thing, return a seq of all\npublic definitions in all currently-loaded namespaces that match the\nstr-or-pattern.","library-url":"https://github.com/clojure/clojure","href":"/clojure.repl/apropos"},{"added":"1.12","ns":"clojure.repl.deps","name":"add-libs","file":"clojure/repl/deps.clj","type":"function","column":1,"see-alsos":null,"line":35,"examples":null,"notes":null,"arglists":["lib-coords"],"doc":"Given lib-coords, a map of lib to coord, will resolve all transitive deps for the libs\n together and add them to the repl classpath, unlike separate calls to add-lib.","library-url":"https://github.com/clojure/clojure","href":"/clojure.repl.deps/add-libs"},{"added":"1.12","ns":"clojure.repl.deps","name":"sync-deps","file":"clojure/repl/deps.clj","type":"function","column":1,"see-alsos":null,"line":85,"examples":null,"notes":null,"arglists":["& {:as opts}"],"doc":"Calls add-libs with any libs present in deps.edn but not yet present on the classpath.\n\n :aliases - coll of alias keywords to use during the sync","library-url":"https://github.com/clojure/clojure","href":"/clojure.repl.deps/sync-deps"},{"added":"1.12","ns":"clojure.repl.deps","name":"add-lib","file":"clojure/repl/deps.clj","type":"function","column":1,"see-alsos":null,"line":59,"examples":null,"notes":null,"arglists":["lib coord","lib"],"doc":"Given a lib that is not yet on the repl classpath, make it available by\n downloading the library if necessary and adding it to the classloader.\n Libs already on the classpath are not updated. Requires a valid parent\n DynamicClassLoader.\n\n lib - symbol identifying a library, for Maven: groupId/artifactId\n coord - optional map of location information specific to the procurer,\n or latest if not supplied\n\n Returns coll of libs loaded, including transitive (or nil if none).\n\n For info on libs, coords, and versions, see:\n https://clojure.org/reference/deps_and_cli","library-url":"https://github.com/clojure/clojure","href":"/clojure.repl.deps/add-lib"},{"added":"1.0","ns":"clojure.set","name":"union","file":"clojure/set.clj","type":"function","column":1,"see-alsos":[{"created-at":1318523783000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.set","name":"intersection","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b57"},{"created-at":1318525824000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.set","name":"difference","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b58"},{"created-at":1318525832000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.set","name":"superset?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b59"}],"line":20,"examples":[{"author":{"login":"Brian Marick","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a523012f661f603806ab1c22d855216f?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (union)\n#{}\n\nuser=\u003E (union #{1 2})\n#{1 2}\n\nuser=\u003E (union #{1 2} #{2 3})\n#{1 2 3}\n\nuser=\u003E (union #{1 2} #{2 3} #{3 4})\n#{1 2 3 4}\n","created-at":1278994901000,"updated-at":1412048733230,"_id":"542692d0c026201cdc326ed9"}],"notes":null,"arglists":["","s1","s1 s2","s1 s2 & sets"],"doc":"Return a set that is the union of the input sets","library-url":"https://github.com/clojure/clojure","href":"/clojure.set/union"},{"added":"1.0","ns":"clojure.set","name":"map-invert","file":"clojure/set.clj","type":"function","column":1,"see-alsos":null,"line":106,"examples":[{"author":{"login":"Brian Marick","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a523012f661f603806ab1c22d855216f?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; Despite being in clojure.set, this has nothing to do with sets. \n\nuser=\u003E (map-invert {:a 1, :b 2})\n{2 :b, 1 :a}\n\n;; If there are duplicate keys, one is chosen:\n\nuser=\u003E (map-invert {:a 1, :b 1})\n{1 :b}\n\n;; I suspect it'd be unwise to depend on which key survives the clash.","created-at":1278995220000,"updated-at":1285502749000,"_id":"542692d0c026201cdc326ee9"}],"notes":null,"arglists":["m"],"doc":"Returns the map with the vals mapped to the keys.","library-url":"https://github.com/clojure/clojure","href":"/clojure.set/map-invert"},{"added":"1.0","ns":"clojure.set","name":"join","file":"clojure/set.clj","type":"function","column":1,"see-alsos":null,"line":115,"examples":[{"author":{"login":"Brian Marick","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a523012f661f603806ab1c22d855216f?r=PG&default=identicon"},"editors":[{"login":"Brian Marick","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a523012f661f603806ab1c22d855216f?r=PG&default=identicon"},{"login":"Brian Marick","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a523012f661f603806ab1c22d855216f?r=PG&default=identicon"},{"login":"Brian Marick","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a523012f661f603806ab1c22d855216f?r=PG&default=identicon"},{"login":"Brian Marick","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a523012f661f603806ab1c22d855216f?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"morphling","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/90ffa70a579c3e0c398b7523ecdc6a87?r=PG&default=identicon"}],"body":";; This simple example shows each element of the first relation joined\n;; with each element of the second (because they have no columns in common):\n\nuser=\u003E (def first-relation #{ {:a 1} {:a 2} })\nuser=\u003E (def second-relation #{ {:b 1} {:b 2} })\nuser=\u003E (join first-relation second-relation)\n#{{:b 1, :a 1} \n {:b 2, :a 1} \n {:b 1, :a 2} \n {:b 2, :a 2}}\n\n\n;; Here's a larger example, in which a relation mainly about animal ownership\n;; is joined with a relation about animal personality. The join is used to \n;; produce a relation joining information about an animal's personality to \n;; that animal.\n\nuser=\u003E (def animals #{{:name \"betsy\" :owner \"brian\" :kind \"cow\"}\n {:name \"jake\" :owner \"brian\" :kind \"horse\"}\n {:name \"josie\" :owner \"dawn\" :kind \"cow\"}})\n\nuser=\u003E (def personalities #{{:kind \"cow\" :personality \"stoic\"}\n {:kind \"horse\" :personality \"skittish\"}})\n#'user/personalities\nuser=\u003E (join animals personalities)\n\n#{{:owner \"dawn\", :name \"josie\", :kind \"cow\", :personality \"stoic\"}\n {:owner \"brian\", :name \"betsy\", :kind \"cow\", :personality \"stoic\"}\n {:owner \"brian\", :name \"jake\", :kind \"horse\", :personality \"skittish\"}}\n\n\n;; (If cows had two personalities, instead of one, each cow would have \n;; two rows in the output.)\n\n;; Suppose `personalities` used `:species` instead of `:kind`:\n\nuser=\u003E (def personalities #{{:species \"cow\" :personality \"stoic\"}\n {:species \"horse\" :personality \"skittish\"}})\n\n\n;; A simple join would produce results like this:\n\nuser=\u003E (join animals personalities)\n#{{:kind \"horse\", :owner \"brian\", :name \"jake\", :species \"cow\", :personality \"stoic\"}\n {:kind \"cow\", :owner \"dawn\", :name \"josie\", :species \"cow\", :personality \"stoic\"}\n {:kind \"horse\", :owner \"brian\", :name \"jake\", :species \"horse\", :personality \"skittish\"}\n {:kind \"cow\", :owner \"brian\", :name \"betsy\", :species \"cow\", :personality \"stoic\"}\n {:kind \"cow\", :owner \"dawn\", :name \"josie\", :species \"horse\", :personality \"skittish\"}\n {:kind \"cow\", :owner \"brian\", :name \"betsy\", :species \"horse\", :personality \"skittish\"}}\n\n\n;; Notice that \"Jake\" is both a horse and a cow in the first line. That's \n;; likely not what you want. You can tell `join` to only produce output \n;; where the `:kind` value is the same as the `:species` value like this:\n\nuser=\u003E (join animals personalities {:kind :species})\n#{{:kind \"cow\", :owner \"dawn\", :name \"josie\", :species \"cow\", :personality \"stoic\"}\n {:kind \"horse\", :owner \"brian\", :name \"jake\", :species \"horse\", :personality \"skittish\"}\n {:kind \"cow\", :owner \"brian\", :name \"betsy\", :species \"cow\", :personality \"stoic\"}}\n\n\n;; Notice that the `:kind` and `:species` keys both appear in each output map.\n\n","created-at":1278825825000,"updated-at":1287947289000,"_id":"542692d0c026201cdc326edf"}],"notes":null,"arglists":["xrel yrel","xrel yrel km"],"doc":"When passed 2 rels, returns the rel corresponding to the natural\n join. When passed an additional keymap, joins on the corresponding\n keys.","library-url":"https://github.com/clojure/clojure","href":"/clojure.set/join"},{"added":"1.0","ns":"clojure.set","name":"select","file":"clojure/set.clj","type":"function","column":1,"see-alsos":[{"created-at":1321756919000,"author":{"login":"alimoeeny","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9e8dd06976ead4082d2181f3807117e1?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"filter","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d82"}],"line":65,"examples":[{"author":{"login":"Brian Marick","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a523012f661f603806ab1c22d855216f?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (select odd? #{1 2 3} )\n#{1 3}\n","created-at":1278822406000,"updated-at":1285503862000,"_id":"542692d0c026201cdc326edb"}],"notes":null,"arglists":["pred xset"],"doc":"Returns a set of the elements for which pred is true","library-url":"https://github.com/clojure/clojure","href":"/clojure.set/select"},{"added":"1.0","ns":"clojure.set","name":"intersection","file":"clojure/set.clj","type":"function","column":1,"see-alsos":[{"created-at":1318523876000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.set","name":"union","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521aab"},{"created-at":1318525852000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.set","name":"difference","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521aac"},{"created-at":1318525861000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.set","name":"superset?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521aad"},{"created-at":1366429268000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.set","name":"project","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521aae"}],"line":33,"examples":[{"author":{"login":"Brian Marick","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a523012f661f603806ab1c22d855216f?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (intersection #{1})\n#{1}\nuser=\u003E (intersection #{1 2} #{2 3})\n#{2}\nuser=\u003E (intersection #{1 2} #{2 3} #{3 4})\n#{}\nuser=\u003E (intersection #{1 :a} #{:a 3} #{:a})\n#{:a}\n","created-at":1278994500000,"updated-at":1285502828000,"_id":"542692d0c026201cdc326ee7"}],"notes":null,"arglists":["s1","s1 s2","s1 s2 & sets"],"doc":"Return a set that is the intersection of the input sets","library-url":"https://github.com/clojure/clojure","href":"/clojure.set/intersection"},{"added":"1.2","ns":"clojure.set","name":"superset?","file":"clojure/set.clj","type":"function","column":1,"see-alsos":[{"created-at":1338064940000,"author":{"login":"jasonrudolph.com","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c4e34ac0818591402a41b2e9cfb4747b?r=PG&default=identicon"},"to-var":{"ns":"clojure.set","name":"subset?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d31"},{"created-at":1338064955000,"author":{"login":"jasonrudolph.com","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c4e34ac0818591402a41b2e9cfb4747b?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"set","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d32"}],"line":154,"examples":[{"author":{"login":"jasonrudolph.com","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c4e34ac0818591402a41b2e9cfb4747b?r=PG&default=identicon"},"editors":[],"body":"(use '[clojure.set :only [superset?]])\n\nuser=\u003E (superset? #{0} #{0})\ntrue\n\nuser=\u003E (superset? #{0 1} #{0})\ntrue\n\nuser=\u003E (superset? #{0} #{0 1}) \nfalse\n","created-at":1338064647000,"updated-at":1338064647000,"_id":"542692d6c026201cdc3270fc"}],"notes":null,"tag":"java.lang.Boolean","arglists":["set1 set2"],"doc":"Is set1 a superset of set2?","library-url":"https://github.com/clojure/clojure","href":"/clojure.set/superset_q"},{"added":"1.0","ns":"clojure.set","name":"index","file":"clojure/set.clj","type":"function","column":1,"see-alsos":[{"created-at":1290275867000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"hash-map","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b48"},{"created-at":1290275888000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"get","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b49"}],"line":95,"examples":[{"author":{"login":"Brian Marick","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a523012f661f603806ab1c22d855216f?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"taylor.sando","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c127297f5548f7275ded1428aa5518bb?r=PG&default=identicon"},{"login":"taylor.sando","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c127297f5548f7275ded1428aa5518bb?r=PG&default=identicon"},{"login":"taylor.sando","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c127297f5548f7275ded1428aa5518bb?r=PG&default=identicon"}],"body":"(use '[clojure.set :only (index)])\n\n;; Suppose you have a set of descriptions of the weights of animals:\n\nuser=\u003E (def weights #{ {:name 'betsy :weight 1000}\n {:name 'jake :weight 756}\n {:name 'shyq :weight 1000} })\n\n\n;; You want the names of all the animals that weight 1000. One way to do \n;; that uses `index`. First, you can group the set elements (the maps) so\n;; that those with the same weights are in the same group.\n\nuser=\u003E (def by-weight (index weights [:weight]))\n#'user/by-weight\n\n;; index returns a map. The keys are maps themselves, where {:weight 756} and {:weight 1000} are taken from the maps in the weights set. The values in the map returned by index are sets that contain map entries from the above weights set.\n\nuser=\u003E by-weight\n{{:weight 756} #{{:name jake, :weight 756}}, \n {:weight 1000} #{{:name shyq, :weight 1000} \n {:name betsy, :weight 1000}}}\n\n\n;; To better visualize the by-weight map that is returned by index, you can query it using get, using {:weight 756} as the key. This will return all the maps (animals) that contain a weight of 756. In this case, there is only one result, which is a set containing a single map. \n\nuser=\u003E (get by-weight {:weight 756})\n#{{:name jake, :weight 756}}\n\n\n;; To see that there are two animals with a weight of 1000, you can query by-weight with the key {:weight 1000}. This returns a set containing two maps.\n\nuser=\u003E (get by-weight {:weight 1000})\n#{{:name shyq, :weight 1000} {:name betsy :weight 1000}}\n \n\n;; You can verify by using count\n\nuser=\u003E (count (get by-weight {:weight 1000}))\n2\n\n\n;; To get the names of those two animals we can map a name-extracting function\n;; over the set of two maps. Since a keyword in a map is also a function that\n;; returns its corresponding value, we can just use `:name` as our function:\n\nuser=\u003E (map :name (get by-weight {:weight 1000}))\n(shyq betsy)\n","created-at":1278996864000,"updated-at":1349528162000,"_id":"542692d0c026201cdc326ef1"}],"notes":null,"arglists":["xrel ks"],"doc":"Returns a map of the distinct values of ks in the xrel mapped to a\n set of the maps in xrel with the corresponding values of ks.","library-url":"https://github.com/clojure/clojure","href":"/clojure.set/index"},{"added":"1.2","ns":"clojure.set","name":"subset?","file":"clojure/set.clj","type":"function","column":1,"see-alsos":[{"created-at":1293674668000,"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"set?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521a98"},{"created-at":1293674671000,"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"set","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521a99"},{"created-at":1338064920000,"author":{"login":"jasonrudolph.com","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c4e34ac0818591402a41b2e9cfb4747b?r=PG&default=identicon"},"to-var":{"ns":"clojure.set","name":"superset?","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521a9a"}],"line":146,"examples":[{"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"editors":[],"body":"user\u003E (clojure.set/subset? #{2 3} #{1 2 3 4})\ntrue\n\nuser\u003E (clojure.set/subset? #{2 4} #{1 2 3 4})\ntrue\n\nuser\u003E (clojure.set/subset? #{2 5} #{1 2 3 4})\nfalse","created-at":1293674661000,"updated-at":1293674661000,"_id":"542692d0c026201cdc326ee6"}],"notes":null,"tag":"java.lang.Boolean","arglists":["set1 set2"],"doc":"Is set1 a subset of set2?","library-url":"https://github.com/clojure/clojure","href":"/clojure.set/subset_q"},{"added":"1.0","ns":"clojure.set","name":"rename","file":"clojure/set.clj","type":"function","column":1,"see-alsos":[{"created-at":1313707898000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.set","name":"rename-keys","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e1a"}],"line":89,"examples":[{"author":{"login":"Brian Marick","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a523012f661f603806ab1c22d855216f?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; Here's a relation with two keys (think \"column names\" in SQL), :a and :b\n\nuser=\u003E (def relation #{ {:a 1, :b 1} {:a 2, :b 2} })\n\n\n;; I decide that :a is a stupid name and that :new-a would be better. \n;; Here's how I make a new relation with the renamed key:\n\nuser=\u003E (rename relation {:a :new-a})\n#{{:new-a 1, :b 1} {:new-a 2, :b 2}}\n\n","created-at":1278824834000,"updated-at":1285503801000,"_id":"542692d0c026201cdc326eef"}],"notes":null,"arglists":["xrel kmap"],"doc":"Returns a rel of the maps in xrel with the keys in kmap renamed to the vals in kmap","library-url":"https://github.com/clojure/clojure","href":"/clojure.set/rename"},{"added":"1.0","ns":"clojure.set","name":"rename-keys","file":"clojure/set.clj","type":"function","column":1,"see-alsos":[{"created-at":1313707906000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.set","name":"rename","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d90"}],"line":78,"examples":[{"author":{"login":"Brian Marick","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a523012f661f603806ab1c22d855216f?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"Stathis Sideris","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/299a3fab7a1a2d6644455dedae9fce0a?r=PG&default=identicon"}],"body":"user=\u003E (rename-keys {:a 1, :b 2} {:a :new-a, :b :new-b})\n{:new-a 1, :new-b 2}\n\n\n;; The behavior when the second map contains a key not in the first is interesting.\n;; I suspect you shouldn't depend on it. (Clojure 1.1 - no longer happens in 1.2.1)\n\nuser=\u003E (rename-keys {:a 1} {:b :new-b})\n{ :a 1, :new-b nil}\n","created-at":1278824415000,"updated-at":1350332324000,"_id":"542692d0c026201cdc326ed2"},{"author":{"login":"steveminer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d28543d134185d12d4006a74738d233e?r=PG&default=identicon"},"editors":[{"login":"steveminer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d28543d134185d12d4006a74738d233e?r=PG&default=identicon"},{"login":"steveminer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d28543d134185d12d4006a74738d233e?r=PG&default=identicon"},{"login":"steveminer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d28543d134185d12d4006a74738d233e?r=PG&default=identicon"}],"body":";; You need to be careful about key collisions. You probably shouldn't \n;; depend on the exact behavior.\nuser=\u003E (rename-keys {:a 1 :b 2} {:a :b})\n{:b 1}\n\nuser=\u003E (rename-keys {:a 1 :b 2} {:a :b :b :a})\n{:a 1}\n\n;; You can work around key collisions by using an array-map to control\n;; the order of the renamings.\nuser=\u003E (rename-keys {:a 1 :b 2 :c 3} (array-map :a :tmp :b :a :tmp :b))\n{:b 1, :a 2, :c 3}\n","created-at":1305262334000,"updated-at":1305333268000,"_id":"542692d0c026201cdc326ed5"}],"notes":null,"arglists":["map kmap"],"doc":"Returns the map with the keys in kmap renamed to the vals in kmap","library-url":"https://github.com/clojure/clojure","href":"/clojure.set/rename-keys"},{"added":"1.0","ns":"clojure.set","name":"project","file":"clojure/set.clj","type":"function","column":1,"see-alsos":null,"line":72,"examples":[{"author":{"login":"Brian Marick","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a523012f661f603806ab1c22d855216f?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; `project` strips out unwanted key/value pairs from a set of maps. \n;; Suppose you have these descriptions of cows:\n\nuser=\u003E (def cows #{ {:name \"betsy\" :id 33} {:name \"panda\" :id 34} })\n#'user/cows\n\n;; You care only about the names. So you can get them like this:\n\nuser=\u003E (project cows [:name])\n#{{:name \"panda\"} {:name \"betsy\"}}\n","created-at":1278995532000,"updated-at":1285502725000,"_id":"542692d0c026201cdc326edd"}],"notes":[{"updated-at":1320358713000,"body":"is there a function that is like project, but returns a set of hash-maps with with all the keys but the ones project was given?","created-at":1320358713000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fd1"},{"updated-at":1349530376000,"body":"This doesn't exist in clojure.set, but I think it would be what you wanted.\r\n\r\n\u003Cpre\u003E\r\n(defn project-not [xrel ks]\r\n ;; convert the given key sequence into a hash-set\r\n ;; This represents keys that you don't want included\r\n (let [ks-set (into #{} ks)]\r\n ;; Do a projection on the keys that are not in ks\r\n (clojure.set/project xrel\r\n ;; Assumes xrel is a set of maps\r\n ;; Grab the first map and extract the keys\r\n ;; Then remove any keys that are in ks-set\r\n ;; This will leave the remaining keys for\r\n ;; projection\r\n (remove #(ks-set %) (keys (first xrel))))))\r\n\r\nuser\u003E (project-not cows [:id])\r\n#{{:name \"panda\" {:name \"betsy\"}}\r\n\u003C/pre\u003E","created-at":1349530376000,"author":{"login":"taylor.sando","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c127297f5548f7275ded1428aa5518bb?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fe9"},{"updated-at":1366672505000,"body":"it strikes me as being very odd that the key set is a vector as opposed to vargs\r\n","created-at":1366672505000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"_id":"542692edf6e94c6970522001"}],"arglists":["xrel ks"],"doc":"Returns a rel of the elements of xrel with only the keys in ks","library-url":"https://github.com/clojure/clojure","href":"/clojure.set/project"},{"added":"1.0","ns":"clojure.set","name":"difference","file":"clojure/set.clj","type":"function","column":1,"see-alsos":[{"created-at":1318525779000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.set","name":"union","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ce2"},{"created-at":1318525788000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.set","name":"intersection","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ce3"},{"created-at":1318525910000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.set","name":"superset?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ce4"},{"created-at":1366429247000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.set","name":"project","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ce5"}],"line":49,"examples":[{"author":{"login":"Brian Marick","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a523012f661f603806ab1c22d855216f?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (difference #{1 2 3})\n#{1 2 3}\nuser=\u003E (difference #{1 2} #{2 3})\n#{1}\nuser=\u003E (difference #{1 2 3} #{1} #{1 4} #{3})\n#{2}","created-at":1278822538000,"updated-at":1332952529000,"_id":"542692d0c026201cdc326eeb"},{"author":{"login":"devijvers","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/81018e4231ac1ce8b7a9e6d377092656?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (difference (set (keys {:1 1 :2 2 :3 3})) (set (keys {:1 1 :2 2})))\n#{:3}\nuser=\u003E (difference (set (keys {:1 1 :2 2})) (set (keys {:1 1 :2 2 :3 3})))\n#{}","created-at":1279384603000,"updated-at":1332952542000,"_id":"542692d0c026201cdc326eed"}],"notes":null,"arglists":["s1","s1 s2","s1 s2 & sets"],"doc":"Return a set that is the first set without elements of the remaining sets","library-url":"https://github.com/clojure/clojure","href":"/clojure.set/difference"},{"ns":"clojure.spec.alpha","name":"form","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":180,"examples":null,"notes":null,"arglists":["spec"],"doc":"returns the spec as data","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/form"},{"ns":"clojure.spec.alpha","name":"&","file":"clojure/spec/alpha.clj","type":"macro","column":1,"see-alsos":null,"line":658,"examples":null,"macro":true,"notes":null,"arglists":["re & preds"],"doc":"takes a regex op re, and predicates. Returns a regex-op that consumes\n input as per re but subjects the resulting value to the\n conjunction of the predicates, and any conforming they might perform.","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/&"},{"ns":"clojure.spec.alpha","name":"nilable-impl","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":1834,"examples":null,"notes":null,"arglists":["form pred gfn"],"doc":"Do not call this directly, use 'nilable'","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/nilable-impl"},{"ns":"clojure.spec.alpha","name":"*recursion-limit*","file":"clojure/spec/alpha.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":26,"examples":null,"notes":null,"arglists":[],"doc":"A soft limit on how many times a branching spec (or/alt/*/opt-keys/multi-spec)\n can be recursed through during generation. After this a\n non-recursive branch will be chosen.","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/*recursion-limit*"},{"ns":"clojure.spec.alpha","name":"*coll-error-limit*","file":"clojure/spec/alpha.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":40,"examples":null,"notes":null,"arglists":[],"doc":"The number of errors reported by explain in a collection spec'ed with 'every'","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/*coll-error-limit*"},{"ns":"clojure.spec.alpha","name":"fspec","file":"clojure/spec/alpha.clj","type":"macro","column":1,"see-alsos":null,"line":674,"examples":null,"macro":true,"notes":null,"arglists":["& {:keys [args ret fn gen], :or {ret (quote clojure.core/any?)}}"],"doc":"takes :args :ret and (optional) :fn kwargs whose values are preds\n and returns a spec whose conform/explain take a fn and validates it\n using generative testing. The conformed value is always the fn itself.\n\n See 'fdef' for a single operation that creates an fspec and\n registers it, as well as a full description of :args, :ret and :fn\n\n fspecs can generate functions that validate the arguments and\n fabricate a return value compliant with the :ret spec, ignoring\n the :fn spec if present.\n\n Optionally takes :gen generator-fn, which must be a fn of no args\n that returns a test.check generator.","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/fspec"},{"ns":"clojure.spec.alpha","name":"explain-printer","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":234,"examples":null,"notes":null,"arglists":["ed"],"doc":"Default printer for explain-data. nil indicates a successful validation.","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/explain-printer"},{"ns":"clojure.spec.alpha","name":"Specize","file":"clojure/spec/alpha.clj","type":"var","column":1,"see-alsos":null,"line":128,"examples":null,"notes":null,"arglists":[],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/Specize"},{"ns":"clojure.spec.alpha","name":"every","file":"clojure/spec/alpha.clj","type":"macro","column":1,"see-alsos":null,"line":520,"examples":null,"macro":true,"notes":null,"arglists":["pred & {:keys [into kind count max-count min-count distinct gen-max gen], :as opts}"],"doc":"takes a pred and validates collection elements against that pred.\n\n Note that 'every' does not do exhaustive checking, rather it samples\n *coll-check-limit* elements. Nor (as a result) does it do any\n conforming of elements. 'explain' will report at most *coll-error-limit*\n problems. Thus 'every' should be suitable for potentially large\n collections.\n\n Takes several kwargs options that further constrain the collection:\n\n :kind - a pred that the collection type must satisfy, e.g. vector?\n (default nil) Note that if :kind is specified and :into is\n not, this pred must generate in order for every to generate.\n :count - specifies coll has exactly this count (default nil)\n :min-count, :max-count - coll has count (\u003C= min-count count max-count) (defaults nil)\n :distinct - all the elements are distinct (default nil)\n\n And additional args that control gen\n\n :gen-max - the maximum coll size to generate (default 20)\n :into - one of [], (), {}, #{} - the default collection to generate into\n (default: empty coll as generated by :kind pred if supplied, else [])\n \n Optionally takes :gen generator-fn, which must be a fn of no args that\n returns a test.check generator\n\n See also - coll-of, every-kv\n","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/every"},{"ns":"clojure.spec.alpha","name":"keys*","file":"clojure/spec/alpha.clj","type":"macro","column":1,"see-alsos":null,"line":1794,"examples":null,"macro":true,"notes":null,"arglists":["& kspecs"],"doc":"takes the same arguments as spec/keys and returns a regex op that matches sequences of key/values,\n converts them into a map, and conforms that map with a corresponding\n spec/keys call:\n\n user=\u003E (s/conform (s/keys :req-un [::a ::c]) {:a 1 :c 2})\n {:a 1, :c 2}\n user=\u003E (s/conform (s/keys* :req-un [::a ::c]) [:a 1 :c 2])\n {:a 1, :c 2}\n\n the resulting regex op can be composed into a larger regex:\n\n user=\u003E (s/conform (s/cat :i1 integer? :m (s/keys* :req-un [::a ::c]) :i2 integer?) [42 :a 1 :c 2 :d 4 99])\n {:i1 42, :m {:a 1, :c 2, :d 4}, :i2 99}","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/keys*"},{"ns":"clojure.spec.alpha","name":"alt-impl","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":1447,"examples":null,"notes":null,"arglists":["ks ps forms"],"doc":"Do not call this directly, use 'alt'","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/alt-impl"},{"ns":"clojure.spec.alpha","name":"def-impl","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":327,"examples":null,"notes":null,"arglists":["k form spec"],"doc":"Do not call this directly, use 'def'","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/def-impl"},{"ns":"clojure.spec.alpha","name":"*explain-out*","file":"clojure/spec/alpha.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":259,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/*explain-out*"},{"ns":"clojure.spec.alpha","name":"regex-spec-impl","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":1697,"examples":null,"notes":null,"arglists":["re gfn"],"doc":"Do not call this directly, use 'spec' with a regex op argument","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/regex-spec-impl"},{"ns":"clojure.spec.alpha","name":"merge-spec-impl","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":1195,"examples":null,"notes":null,"arglists":["forms preds gfn"],"doc":"Do not call this directly, use 'merge'","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/merge-spec-impl"},{"ns":"clojure.spec.alpha","name":"explain-data*","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":218,"examples":null,"notes":null,"arglists":["spec path via in x"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/explain-data*"},{"ns":"clojure.spec.alpha","name":"check-asserts","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":1955,"examples":null,"notes":null,"arglists":["flag"],"doc":"Enable or disable spec asserts that have been compiled\nwith '*compile-asserts*' true. See 'assert'.\n\nInitially set to boolean value of clojure.spec.check-asserts\nsystem property. Defaults to false.","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/check-asserts"},{"ns":"clojure.spec.alpha","name":"assert*","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":1964,"examples":null,"notes":null,"arglists":["spec x"],"doc":"Do not call this directly, use 'assert'.","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/assert*"},{"ns":"clojure.spec.alpha","name":"inst-in-range?","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":1889,"examples":null,"notes":null,"arglists":["start end inst"],"doc":"Return true if inst at or after start and before end","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/inst-in-range_q"},{"ns":"clojure.spec.alpha","name":"nilable","file":"clojure/spec/alpha.clj","type":"macro","column":1,"see-alsos":null,"line":1860,"examples":null,"macro":true,"notes":null,"arglists":["pred"],"doc":"returns a spec that accepts nil and values satisfying pred","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/nilable"},{"ns":"clojure.spec.alpha","name":"and-spec-impl","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":1151,"examples":null,"notes":null,"arglists":["forms preds gfn"],"doc":"Do not call this directly, use 'and'","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/and-spec-impl"},{"ns":"clojure.spec.alpha","name":"describe*","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["spec"],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/describe*"},{"ns":"clojure.spec.alpha","name":"map-spec-impl","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":822,"examples":null,"notes":null,"arglists":["{:keys [req-un opt-un keys-pred pred-exprs opt-keys req-specs req req-keys opt-specs pred-forms opt gfn], :as argm}"],"doc":"Do not call this directly, use 'spec' with a map argument","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/map-spec-impl"},{"ns":"clojure.spec.alpha","name":"coll-of","file":"clojure/spec/alpha.clj","type":"macro","column":1,"see-alsos":null,"line":579,"examples":null,"macro":true,"notes":null,"arglists":["pred & opts"],"doc":"Returns a spec for a collection of items satisfying pred. Unlike\n 'every', coll-of will exhaustively conform every value.\n\n Same options as 'every'. conform will produce a collection\n corresponding to :into if supplied, else will match the input collection,\n avoiding rebuilding when possible.\n\n See also - every, map-of","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/coll-of"},{"ns":"clojure.spec.alpha","name":"cat","file":"clojure/spec/alpha.clj","type":"macro","column":1,"see-alsos":null,"line":642,"examples":null,"macro":true,"notes":null,"arglists":["& key-pred-forms"],"doc":"Takes key+pred pairs, e.g.\n\n (s/cat :e even? :o odd?)\n\n Returns a regex op that matches (all) values in sequence, returning a map\n containing the keys of each pred and the corresponding value.","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/cat"},{"ns":"clojure.spec.alpha","name":"*","file":"clojure/spec/alpha.clj","type":"macro","column":1,"see-alsos":null,"line":607,"examples":null,"macro":true,"notes":null,"arglists":["pred-form"],"doc":"Returns a regex op that matches zero or more values matching\n pred. Produces a vector of matches iff there is at least one match","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/*"},{"ns":"clojure.spec.alpha","name":"explain","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":267,"examples":null,"notes":null,"arglists":["spec x"],"doc":"Given a spec and a value that fails to conform, prints an explanation to *out*.","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/explain"},{"ns":"clojure.spec.alpha","name":"with-gen*","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["spec gfn"],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/with-gen*"},{"ns":"clojure.spec.alpha","name":"or-spec-impl","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":1061,"examples":null,"notes":null,"arglists":["keys forms preds gfn"],"doc":"Do not call this directly, use 'or'","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/or-spec-impl"},{"ns":"clojure.spec.alpha","name":"*fspec-iterations*","file":"clojure/spec/alpha.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":32,"examples":null,"notes":null,"arglists":[],"doc":"The number of times an anonymous fn specified by fspec will be (generatively) tested during conform","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/*fspec-iterations*"},{"ns":"clojure.spec.alpha","name":"Spec","file":"clojure/spec/alpha.clj","type":"var","column":1,"see-alsos":null,"line":44,"examples":null,"notes":null,"arglists":[],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/Spec"},{"ns":"clojure.spec.alpha","name":"unform","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":173,"examples":null,"notes":null,"arglists":["spec x"],"doc":"Given a spec and a value created by or compliant with a call to\n 'conform' with the same spec, returns a value with all conform\n destructuring undone.","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/unform"},{"ns":"clojure.spec.alpha","name":"valid?","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":770,"examples":null,"notes":null,"arglists":["spec x","spec x form"],"doc":"Helper function that returns true when x is valid for spec.","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/valid_q"},{"ns":"clojure.spec.alpha","name":"gen","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":292,"examples":null,"notes":null,"arglists":["spec","spec overrides"],"doc":"Given a spec, returns the generator for it, or throws if none can\n be constructed. Optionally an overrides map can be provided which\n should map spec names or paths (vectors of keywords) to no-arg\n generator-creating fns. These will be used instead of the generators at those\n names/paths. Note that parent generator (in the spec or overrides\n map) will supersede those of any subtrees. A generator for a regex\n op must always return a sequential collection (i.e. a generator for\n s/? should return either an empty sequence/vector or a\n sequence/vector with one item in it)","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/gen"},{"ns":"clojure.spec.alpha","name":"every-kv","file":"clojure/spec/alpha.clj","type":"macro","column":1,"see-alsos":null,"line":568,"examples":null,"macro":true,"notes":null,"arglists":["kpred vpred & opts"],"doc":"like 'every' but takes separate key and val preds and works on associative collections.\n\n Same options as 'every', :into defaults to {}\n\n See also - map-of","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/every-kv"},{"ns":"clojure.spec.alpha","name":"int-in","file":"clojure/spec/alpha.clj","type":"macro","column":1,"see-alsos":null,"line":1914,"examples":null,"macro":true,"notes":null,"arglists":["start end"],"doc":"Returns a spec that validates fixed precision integers in the\n range from start (inclusive) to end (exclusive).","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/int-in"},{"ns":"clojure.spec.alpha","name":"alt","file":"clojure/spec/alpha.clj","type":"macro","column":1,"see-alsos":null,"line":625,"examples":null,"macro":true,"notes":null,"arglists":["& key-pred-forms"],"doc":"Takes key+pred pairs, e.g.\n\n (s/alt :even even? :small #(\u003C % 42))\n\n Returns a regex op that returns a map entry containing the key of the\n first matching pred and the corresponding value. Thus the\n 'key' and 'val' functions can be used to refer generically to the\n components of the tagged return","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/alt"},{"ns":"clojure.spec.alpha","name":"nonconforming","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":1813,"examples":null,"notes":null,"arglists":["spec"],"doc":"takes a spec and returns a spec that has the same properties except\n 'conform' returns the original (not the conformed) value. Note, will specize regex ops.","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/nonconforming"},{"ns":"clojure.spec.alpha","name":"unform*","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["spec y"],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/unform*"},{"ns":"clojure.spec.alpha","name":"abbrev","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":186,"examples":null,"notes":null,"arglists":["form"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/abbrev"},{"ns":"clojure.spec.alpha","name":"regex?","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":85,"examples":null,"notes":null,"arglists":["x"],"doc":"returns x if x is a (clojure.spec) regex op, else logical false","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/regex_q"},{"ns":"clojure.spec.alpha","name":"int-in-range?","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":1908,"examples":null,"notes":null,"arglists":["start end val"],"doc":"Return true if start \u003C= val, val \u003C end and val is a fixed\n precision integer.","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/int-in-range_q"},{"ns":"clojure.spec.alpha","name":"or","file":"clojure/spec/alpha.clj","type":"macro","column":1,"see-alsos":null,"line":476,"examples":null,"macro":true,"notes":null,"arglists":["& key-pred-forms"],"doc":"Takes key+pred pairs, e.g.\n\n (s/or :even even? :small #(\u003C % 42))\n\n Returns a destructuring spec that returns a map entry containing the\n key of the first matching pred and the corresponding value. Thus the\n 'key' and 'val' functions can be used to refer generically to the\n components of the tagged return.","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/or"},{"ns":"clojure.spec.alpha","name":"spec?","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":79,"examples":null,"notes":null,"arglists":["x"],"doc":"returns x if x is a spec object, else logical false","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/spec_q"},{"ns":"clojure.spec.alpha","name":"registry","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":356,"examples":null,"notes":null,"arglists":[""],"doc":"returns the registry map, prefer 'get-spec' to lookup a spec by name","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/registry"},{"ns":"clojure.spec.alpha","name":"rep+impl","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":1413,"examples":null,"notes":null,"arglists":["form p"],"doc":"Do not call this directly, use '+'","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/rep+impl"},{"ns":"clojure.spec.alpha","name":"exercise-fn","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":1875,"examples":null,"notes":null,"arglists":["sym","sym n","sym-or-f n fspec"],"doc":"exercises the fn named by sym (a symbol) by applying it to\n n (default 10) generated samples of its args spec. When fspec is\n supplied its arg spec is used, and sym-or-f can be a fn. Returns a\n sequence of tuples of [args ret]. ","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/exercise-fn"},{"ns":"clojure.spec.alpha","name":"exercise","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":1866,"examples":null,"notes":null,"arglists":["spec","spec n","spec n overrides"],"doc":"generates a number (default 10) of values compatible with spec and maps conform over them,\n returning a sequence of [val conformed-val] tuples. Optionally takes\n a generator overrides map as per gen","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/exercise"},{"ns":"clojure.spec.alpha","name":"multi-spec","file":"clojure/spec/alpha.clj","type":"macro","column":1,"see-alsos":null,"line":385,"examples":null,"macro":true,"notes":null,"arglists":["mm retag"],"doc":"Takes the name of a spec/predicate-returning multimethod and a\n tag-restoring keyword or fn (retag). Returns a spec that when\n conforming or explaining data will pass it to the multimethod to get\n an appropriate spec. You can e.g. use multi-spec to dynamically and\n extensibly associate specs with 'tagged' data (i.e. data where one\n of the fields indicates the shape of the rest of the structure).\n\n (defmulti mspec :tag)\n\n The methods should ignore their argument and return a predicate/spec:\n (defmethod mspec :int [_] (s/keys :req-un [::tag ::i]))\n\n retag is used during generation to retag generated values with\n matching tags. retag can either be a keyword, at which key the\n dispatch-tag will be assoc'ed, or a fn of generated value and\n dispatch-tag that should return an appropriately retagged value.\n\n Note that because the tags themselves comprise an open set,\n the tag key spec cannot enumerate the values, but can e.g.\n test for keyword?.\n\n Note also that the dispatch values of the multimethod will be\n included in the path, i.e. in reporting and gen overrides, even\n though those values are not evident in the spec.\n","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/multi-spec"},{"ns":"clojure.spec.alpha","name":"explain-data","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":225,"examples":null,"notes":null,"arglists":["spec x"],"doc":"Given a spec and a value x which ought to conform, returns nil if x\n conforms, else a map with at least the key ::problems whose value is\n a collection of problem-maps, where problem-map has at least :path :pred and :val\n keys describing the predicate and the value that failed at that\n path.","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/explain-data"},{"ns":"clojure.spec.alpha","name":"tuple-impl","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":996,"examples":null,"notes":null,"arglists":["forms preds","forms preds gfn"],"doc":"Do not call this directly, use 'tuple'","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/tuple-impl"},{"ns":"clojure.spec.alpha","name":"multi-spec-impl","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":946,"examples":null,"notes":null,"arglists":["form mmvar retag","form mmvar retag gfn"],"doc":"Do not call this directly, use 'multi-spec'","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/multi-spec-impl"},{"ns":"clojure.spec.alpha","name":"tuple","file":"clojure/spec/alpha.clj","type":"macro","column":1,"see-alsos":null,"line":694,"examples":null,"macro":true,"notes":null,"arglists":["& preds"],"doc":"takes one or more preds and returns a spec for a tuple, a vector\n where each element conforms to the corresponding pred. Each element\n will be referred to in paths using its ordinal.","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/tuple"},{"ns":"clojure.spec.alpha","name":"conform","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":167,"examples":null,"notes":null,"arglists":["spec x"],"doc":"Given a spec and a value, returns :clojure.spec.alpha/invalid \n\tif value does not match spec, else the (possibly destructured) value.","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/conform"},{"ns":"clojure.spec.alpha","name":"gen*","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["spec overrides path rmap"],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/gen*"},{"ns":"clojure.spec.alpha","name":"fspec-impl","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":1745,"examples":null,"notes":null,"arglists":["argspec aform retspec rform fnspec fform gfn"],"doc":"Do not call this directly, use 'fspec'","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/fspec-impl"},{"ns":"clojure.spec.alpha","name":"assert","file":"clojure/spec/alpha.clj","type":"macro","column":1,"see-alsos":null,"line":1975,"examples":null,"macro":true,"notes":null,"arglists":["spec x"],"doc":"spec-checking assert expression. Returns x if x is valid? according\nto spec, else throws an ex-info with explain-data plus ::failure of\n:assertion-failed.\n\nCan be disabled at either compile time or runtime:\n\nIf *compile-asserts* is false at compile time, compiles to x. Defaults\nto value of 'clojure.spec.compile-asserts' system property, or true if\nnot set.\n\nIf (check-asserts?) is false at runtime, always returns x. Defaults to\nvalue of 'clojure.spec.check-asserts' system property, or false if not\nset. You can toggle check-asserts? with (check-asserts bool).","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/assert"},{"ns":"clojure.spec.alpha","name":"?","file":"clojure/spec/alpha.clj","type":"macro","column":1,"see-alsos":null,"line":619,"examples":null,"macro":true,"notes":null,"arglists":["pred-form"],"doc":"Returns a regex op that matches zero or one value matching\n pred. Produces a single value (not a collection) if matched.","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/_q"},{"ns":"clojure.spec.alpha","name":"*coll-check-limit*","file":"clojure/spec/alpha.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":36,"examples":null,"notes":null,"arglists":[],"doc":"The number of elements validated in a collection spec'ed with 'every'","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/*coll-check-limit*"},{"ns":"clojure.spec.alpha","name":"merge","file":"clojure/spec/alpha.clj","type":"macro","column":1,"see-alsos":null,"line":503,"examples":null,"macro":true,"notes":null,"arglists":["& pred-forms"],"doc":"Takes map-validating specs (e.g. 'keys' specs) and\n returns a spec that returns a conformed map satisfying all of the\n specs. Unlike 'and', merge can generate maps satisfying the\n union of the predicates.","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/merge"},{"ns":"clojure.spec.alpha","name":"get-spec","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":361,"examples":null,"notes":null,"arglists":["k"],"doc":"Returns spec registered for keyword/symbol/var k, or nil.","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/get-spec"},{"ns":"clojure.spec.alpha","name":"conformer","file":"clojure/spec/alpha.clj","type":"macro","column":1,"see-alsos":null,"line":666,"examples":null,"macro":true,"notes":null,"arglists":["f","f unf"],"doc":"takes a predicate function with the semantics of conform i.e. it should return either a\n (possibly converted) value or :clojure.spec.alpha/invalid, and returns a\n spec that uses it as a predicate/conformer. Optionally takes a\n second fn that does unform of result of first","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/conformer"},{"ns":"clojure.spec.alpha","name":"every-impl","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":1245,"examples":null,"notes":null,"arglists":["form pred opts","form pred {conform-into :into, describe-form :clojure.spec.alpha/describe, :keys [kind :clojure.spec.alpha/kind-form count max-count min-count distinct gen-max :clojure.spec.alpha/kfn :clojure.spec.alpha/cpred conform-keys :clojure.spec.alpha/conform-all], :or {gen-max 20}, :as opts} gfn"],"doc":"Do not call this directly, use 'every', 'every-kv', 'coll-of' or 'map-of'","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/every-impl"},{"ns":"clojure.spec.alpha","name":"spec","file":"clojure/spec/alpha.clj","type":"macro","column":1,"see-alsos":null,"line":366,"examples":null,"macro":true,"notes":null,"arglists":["form & {:keys [gen]}"],"doc":"Takes a single predicate form, e.g. can be the name of a predicate,\n like even?, or a fn literal like #(\u003C % 42). Note that it is not\n generally necessary to wrap predicates in spec when using the rest\n of the spec macros, only to attach a unique generator\n\n Can also be passed the result of one of the regex ops -\n cat, alt, *, +, ?, in which case it will return a regex-conforming\n spec, useful when nesting an independent regex.\n ---\n\n Optionally takes :gen generator-fn, which must be a fn of no args that\n returns a test.check generator.\n\n Returns a spec.","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/spec"},{"ns":"clojure.spec.alpha","name":"keys","file":"clojure/spec/alpha.clj","type":"macro","column":1,"see-alsos":null,"line":414,"examples":null,"macro":true,"notes":null,"arglists":["& {:keys [req req-un opt opt-un gen]}"],"doc":"Creates and returns a map validating spec. :req and :opt are both\n vectors of namespaced-qualified keywords. The validator will ensure\n the :req keys are present. The :opt keys serve as documentation and\n may be used by the generator.\n\n The :req key vector supports 'and' and 'or' for key groups:\n\n (s/keys :req [::x ::y (or ::secret (and ::user ::pwd))] :opt [::z])\n\n There are also -un versions of :req and :opt. These allow\n you to connect unqualified keys to specs. In each case, fully\n qualified keywords are passed, which name the specs, but unqualified\n keys (with the same name component) are expected and checked at\n conform-time, and generated during gen:\n\n (s/keys :req-un [:my.ns/x :my.ns/y])\n\n The above says keys :x and :y are required, and will be validated\n and generated by specs (if they exist) named :my.ns/x :my.ns/y \n respectively.\n\n In addition, the values of *all* namespace-qualified keys will be validated\n (and possibly destructured) by any registered specs. Note: there is\n no support for inline value specification, by design.\n\n Optionally takes :gen generator-fn, which must be a fn of no args that\n returns a test.check generator.","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/keys"},{"ns":"clojure.spec.alpha","name":"spec-impl","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":913,"examples":null,"notes":null,"arglists":["form pred gfn cpred?","form pred gfn cpred? unc"],"doc":"Do not call this directly, use 'spec'","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/spec-impl"},{"ns":"clojure.spec.alpha","name":"+","file":"clojure/spec/alpha.clj","type":"macro","column":1,"see-alsos":null,"line":613,"examples":null,"macro":true,"notes":null,"arglists":["pred-form"],"doc":"Returns a regex op that matches one or more values matching\n pred. Produces a vector of matches","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/+"},{"ns":"clojure.spec.alpha","name":"invalid?","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":162,"examples":null,"notes":null,"arglists":["ret"],"doc":"tests the validity of a conform return value","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/invalid_q"},{"ns":"clojure.spec.alpha","name":"amp-impl","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":1418,"examples":null,"notes":null,"arglists":["re re-form preds pred-forms"],"doc":"Do not call this directly, use '&'","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/amp-impl"},{"ns":"clojure.spec.alpha","name":"map-of","file":"clojure/spec/alpha.clj","type":"macro","column":1,"see-alsos":null,"line":592,"examples":null,"macro":true,"notes":null,"arglists":["kpred vpred & opts"],"doc":"Returns a spec for a map whose keys satisfy kpred and vals satisfy\n vpred. Unlike 'every-kv', map-of will exhaustively conform every\n value.\n\n Same options as 'every', :kind defaults to map?, with the addition of:\n\n :conform-keys - conform keys as well as values (default false)\n\n See also - every-kv","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/map-of"},{"ns":"clojure.spec.alpha","name":"cat-impl","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":1397,"examples":null,"notes":null,"arglists":["ks ps forms"],"doc":"Do not call this directly, use 'cat'","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/cat-impl"},{"ns":"clojure.spec.alpha","name":"explain-str","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":272,"examples":null,"notes":null,"arglists":["spec x"],"doc":"Given a spec and a value that fails to conform, returns an explanation as a string.","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/explain-str"},{"ns":"clojure.spec.alpha","name":"*compile-asserts*","file":"clojure/spec/alpha.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":1939,"examples":null,"notes":null,"arglists":[],"doc":"If true, compiler will enable spec asserts, which are then\nsubject to runtime control via check-asserts? If false, compiler\nwill eliminate all spec assert overhead. See 'assert'.\n\nInitially set to boolean value of clojure.spec.compile-asserts\nsystem property. Defaults to true.","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/*compile-asserts*"},{"ns":"clojure.spec.alpha","name":"with-gen","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":210,"examples":null,"notes":null,"arglists":["spec gen-fn"],"doc":"Takes a spec and a no-arg, generator-returning fn and returns a version of that spec that uses that generator","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/with-gen"},{"ns":"clojure.spec.alpha","name":"conform*","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["spec x"],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/conform*"},{"ns":"clojure.spec.alpha","name":"check-asserts?","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":1950,"examples":null,"notes":null,"arglists":[""],"doc":"Returns the value set by check-asserts.","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/check-asserts_q"},{"ns":"clojure.spec.alpha","name":"rep-impl","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":1409,"examples":null,"notes":null,"arglists":["form p"],"doc":"Do not call this directly, use '*'","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/rep-impl"},{"ns":"clojure.spec.alpha","name":"double-in","file":"clojure/spec/alpha.clj","type":"macro","column":1,"see-alsos":null,"line":1921,"examples":null,"macro":true,"notes":null,"arglists":["& {:keys [infinite? NaN? min max], :or {infinite? true, NaN? true}, :as m}"],"doc":"Specs a 64-bit floating point number. Options:\n\n :infinite? - whether +/- infinity allowed (default true)\n :NaN? - whether NaN allowed (default true)\n :min - minimum value (inclusive, default none)\n :max - maximum value (inclusive, default none)","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/double-in"},{"ns":"clojure.spec.alpha","name":"inst-in","file":"clojure/spec/alpha.clj","type":"macro","column":1,"see-alsos":null,"line":1896,"examples":null,"macro":true,"notes":null,"arglists":["start end"],"doc":"Returns a spec that validates insts in the range from start\n(inclusive) to end (exclusive).","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/inst-in"},{"ns":"clojure.spec.alpha","name":"describe","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":205,"examples":null,"notes":null,"arglists":["spec"],"doc":"returns an abbreviated description of the spec as data","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/describe"},{"ns":"clojure.spec.alpha","name":"explain-out","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":261,"examples":null,"notes":null,"arglists":["ed"],"doc":"Prints explanation data (per 'explain-data') to *out* using the printer in *explain-out*,\n by default explain-printer.","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/explain-out"},{"ns":"clojure.spec.alpha","name":"and","file":"clojure/spec/alpha.clj","type":"macro","column":1,"see-alsos":null,"line":493,"examples":null,"macro":true,"notes":null,"arglists":["& pred-forms"],"doc":"Takes predicate/spec-forms, e.g.\n\n (s/and even? #(\u003C % 42))\n\n Returns a spec that returns the conformed value. Successive\n conformed values propagate through rest of predicates.","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/and"},{"ns":"clojure.spec.alpha","name":"specize*","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["_","_ form"],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/specize*"},{"ns":"clojure.spec.alpha","name":"def","file":"clojure/spec/alpha.clj","type":"macro","column":1,"see-alsos":null,"line":347,"examples":null,"macro":true,"notes":null,"arglists":["k spec-form"],"doc":"Given a namespace-qualified keyword or resolvable symbol k, and a\n spec, spec-name, predicate or regex-op makes an entry in the\n registry mapping k to the spec. Use nil to remove an entry in\n the registry for k.","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/def"},{"ns":"clojure.spec.alpha","name":"maybe-impl","file":"clojure/spec/alpha.clj","type":"function","column":1,"see-alsos":null,"line":1451,"examples":null,"notes":null,"arglists":["p form"],"doc":"Do not call this directly, use '?'","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/maybe-impl"},{"ns":"clojure.spec.alpha","name":"explain*","type":"function","see-alsos":null,"examples":null,"notes":null,"tag":null,"arglists":["spec path via in x"],"doc":null,"library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/explain*"},{"ns":"clojure.spec.alpha","name":"fdef","file":"clojure/spec/alpha.clj","type":"macro","column":1,"see-alsos":null,"line":714,"examples":null,"macro":true,"notes":null,"arglists":["fn-sym & specs"],"doc":"Takes a symbol naming a function, and one or more of the following:\n\n :args A regex spec for the function arguments as they were a list to be\n passed to apply - in this way, a single spec can handle functions with\n multiple arities\n :ret A spec for the function's return value\n :fn A spec of the relationship between args and ret - the\n value passed is {:args conformed-args :ret conformed-ret} and is\n expected to contain predicates that relate those values\n\n Qualifies fn-sym with resolve, or using *ns* if no resolution found.\n Registers an fspec in the global registry, where it can be retrieved\n by calling get-spec with the var or fully-qualified symbol.\n\n Once registered, function specs are included in doc, checked by\n instrument, tested by the runner clojure.spec.test.alpha/check, and (if\n a macro) used to explain errors during macroexpansion.\n\n Note that :fn specs require the presence of :args and :ret specs to\n conform values, and so :fn specs will be ignored if :args or :ret\n are missing.\n\n Returns the qualified fn-sym.\n\n For example, to register function specs for the symbol function:\n\n (s/fdef clojure.core/symbol\n :args (s/alt :separate (s/cat :ns string? :n string?)\n :str string?\n :sym symbol?)\n :ret symbol?)","library-url":"https://github.com/clojure/clojure","href":"/clojure.spec.alpha/fdef"},{"added":"1.1","ns":"clojure.stacktrace","name":"print-stack-trace","file":"clojure/stacktrace.clj","type":"function","column":1,"see-alsos":null,"line":50,"examples":[{"author":{"login":"sjm","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/627acfa99fdd2a4e0c5aab58825b6ffd?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (clojure.stacktrace/print-stack-trace (Exception. \"foo\"))\njava.lang.Exception: foo\n at user$eval112.invoke (NO_SOURCE_FILE:1)\n clojure.lang.Compiler.eval (Compiler.java:6619)\n clojure.lang.Compiler.eval (Compiler.java:6582)\n clojure.core$eval.invoke (core.clj:2852)\n clojure.main$repl$read_eval_print__6588$fn__6591.invoke (main.clj:259)\n clojure.main$repl$read_eval_print__6588.invoke (main.clj:259)\n clojure.main$repl$fn__6597.invoke (main.clj:277)\n clojure.main$repl.doInvoke (main.clj:277)\n clojure.lang.RestFn.invoke (RestFn.java:1096)\n clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__3615.invoke (interruptible_eval.clj:56)\n clojure.lang.AFn.applyToHelper (AFn.java:159)\n clojure.lang.AFn.applyTo (AFn.java:151)\n clojure.core$apply.invoke (core.clj:617)\n clojure.core$with_bindings_STAR_.doInvoke (core.clj:1788)\n clojure.lang.RestFn.invoke (RestFn.java:425)\n clojure.tools.nrepl.middleware.interruptible_eval$evaluate.invoke (interruptible_eval.clj:41)\n clojure.tools.nrepl.middleware.interruptible_eval$interruptible_eval$fn__3656$fn__3659.invoke (interruptible_eval.clj:171)\n clojure.core$comp$fn__4154.invoke (core.clj:2330)\n clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__3649.invoke (interruptible_eval.clj:138)\n clojure.lang.AFn.run (AFn.java:24)\n java.util.concurrent.ThreadPoolExecutor.runWorker (:-1)\n java.util.concurrent.ThreadPoolExecutor$Worker.run (:-1)\n java.lang.Thread.run (:-1)\nnil\n\nuser=\u003E (clojure.stacktrace/print-stack-trace (Exception. \"foo\") 4)\njava.lang.Exception: foo\n at user$eval124.invoke (NO_SOURCE_FILE:1)\n clojure.lang.Compiler.eval (Compiler.java:6619)\n clojure.lang.Compiler.eval (Compiler.java:6582)\n clojure.core$eval.invoke (core.clj:2852)\nnil","created-at":1374649676000,"updated-at":1374649676000,"_id":"542692d7c026201cdc3270fd"}],"notes":null,"arglists":["tr","tr n"],"doc":"Prints a Clojure-oriented stack trace of tr, a Throwable.\n Prints a maximum of n stack frames (default: unlimited).\n Does not print chained exceptions (causes).","library-url":"https://github.com/clojure/clojure","href":"/clojure.stacktrace/print-stack-trace"},{"added":"1.1","ns":"clojure.stacktrace","name":"print-trace-element","file":"clojure/stacktrace.clj","type":"function","column":1,"see-alsos":null,"line":28,"examples":null,"notes":null,"arglists":["e"],"doc":"Prints a Clojure-oriented view of one element in a stack trace.","library-url":"https://github.com/clojure/clojure","href":"/clojure.stacktrace/print-trace-element"},{"added":"1.1","ns":"clojure.stacktrace","name":"print-cause-trace","file":"clojure/stacktrace.clj","type":"function","column":1,"see-alsos":null,"line":72,"examples":null,"notes":null,"arglists":["tr","tr n"],"doc":"Like print-stack-trace but prints chained exceptions (causes).","library-url":"https://github.com/clojure/clojure","href":"/clojure.stacktrace/print-cause-trace"},{"added":"1.1","ns":"clojure.stacktrace","name":"e","file":"clojure/stacktrace.clj","type":"function","column":1,"see-alsos":null,"line":82,"examples":null,"notes":null,"arglists":[""],"doc":"REPL utility. Prints a brief stack trace for the root cause of the\n most recent exception.","library-url":"https://github.com/clojure/clojure","href":"/clojure.stacktrace/e"},{"added":"1.1","ns":"clojure.stacktrace","name":"root-cause","file":"clojure/stacktrace.clj","type":"function","column":1,"see-alsos":null,"line":20,"examples":null,"notes":null,"arglists":["tr"],"doc":"Returns the last 'cause' Throwable in a chain of Throwables.","library-url":"https://github.com/clojure/clojure","href":"/clojure.stacktrace/root-cause"},{"added":"1.1","ns":"clojure.stacktrace","name":"print-throwable","file":"clojure/stacktrace.clj","type":"function","column":1,"see-alsos":null,"line":40,"examples":null,"notes":null,"arglists":["tr"],"doc":"Prints the class and message of a Throwable. Prints the ex-data map\n if present.","library-url":"https://github.com/clojure/clojure","href":"/clojure.stacktrace/print-throwable"},{"added":"1.8","ns":"clojure.string","name":"ends-with?","file":"clojure/string.clj","type":"function","column":1,"see-alsos":null,"line":367,"examples":null,"notes":null,"arglists":["s substr"],"doc":"True if s ends with substr.","library-url":"https://github.com/clojure/clojure","href":"/clojure.string/ends-with_q"},{"added":"1.2","ns":"clojure.string","name":"capitalize","file":"clojure/string.clj","type":"function","column":1,"see-alsos":[{"created-at":1330171018000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.string","name":"upper-case","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b62"},{"created-at":1330171022000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.string","name":"lower-case","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b63"}],"line":196,"examples":[{"author":{"login":"pkolloch","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/10b2fd3c0a4cc46dc241a48468dc551?r=PG&default=identicon"},"editors":[{"login":"teyc","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bd6e62afb4881ab0f617611b8b65d003?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (require 'clojure.string)\nnil\n\nuser=\u003E (clojure.string/capitalize \"MiXeD cAsE\")\n\"Mixed case\"\n\nuser=\u003E (clojure.string/capitalize \"mIxEd CaSe\")\n\"Mixed case\"\n","created-at":1282324695000,"updated-at":1285487692000,"_id":"542692d1c026201cdc326f12"}],"notes":null,"tag":"java.lang.String","arglists":["s"],"doc":"Converts first character of the string to upper-case, all other\n characters to lower-case.","library-url":"https://github.com/clojure/clojure","href":"/clojure.string/capitalize"},{"added":"1.2","ns":"clojure.string","name":"reverse","file":"clojure/string.clj","type":"function","column":1,"see-alsos":null,"line":48,"examples":[{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[{"login":"mudge","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/73dfb1eb77844f0dbae599ff9b81e78f?r=PG&default=identicon"}],"body":"user\u003E (reverse \"foo\")\n\"oof\"","created-at":1291916345000,"updated-at":1307924711000,"_id":"542692d1c026201cdc326f10"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[],"body":";; clojure.string/reverse correctly treats UTF-16 surrogate pairs\n;; as a unit, and does not reverse the 2 Java chars of the pair. Good!\nuser=\u003E (def s \"smily \\ud83d\\ude03.\")\n#'user/s\nuser=\u003E (def x (str/reverse s))\n#'user/x\nuser=\u003E (map #(format \"%04X\" (int %)) s)\n(\"0073\" \"006D\" \"0069\" \"006C\" \"0079\" \"0020\" \"D83D\" \"DE03\" \"002E\")\nuser=\u003E (map #(format \"%04X\" (int %)) x)\n(\"002E\" \"D83D\" \"DE03\" \"0020\" \"0079\" \"006C\" \"0069\" \"006D\" \"0073\")\n","created-at":1329876696000,"updated-at":1329876696000,"_id":"542692d7c026201cdc32710b"}],"notes":null,"tag":"java.lang.String","arglists":["s"],"doc":"Returns s with its characters reversed.","library-url":"https://github.com/clojure/clojure","href":"/clojure.string/reverse"},{"added":"1.2","ns":"clojure.string","name":"join","file":"clojure/string.clj","type":"function","column":1,"see-alsos":[{"created-at":1314291144000,"author":{"login":"Havvy","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e799a79441c7543be48562403411cd13?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"split-at","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d3a"},{"created-at":1314291148000,"author":{"login":"Havvy","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e799a79441c7543be48562403411cd13?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"split-with","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d3b"},{"created-at":1334733670000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"interpose","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e48"}],"line":180,"examples":[{"author":{"login":"pkolloch","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/10b2fd3c0a4cc46dc241a48468dc551?r=PG&default=identicon"},"editors":[],"body":"\u003Cpre\u003E\r\nuser=\u003E (clojure.string/join \", \" [1 2 3])\r\n\"1, 2, 3\"\r\n\u003C/pre\u003E","created-at":1282320829000,"updated-at":1282320829000,"_id":"542692d0c026201cdc326f00"},{"author":{"login":"Santosh","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/851ccd369a1501c72f5e08af19ff9dc1?r=PG&default=identicon"},"editors":[{"login":"Santosh","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/851ccd369a1501c72f5e08af19ff9dc1?r=PG&default=identicon"},{"login":"Santosh","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/851ccd369a1501c72f5e08af19ff9dc1?r=PG&default=identicon"},{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; Splits a string on space character and joins \n;; the resulting collection with a line feed character\n\n(use '[clojure.string :only (join split)])\n\nuser=\u003E (println\n (join \"\\n\"\n (split \"The Quick Brown Fox\" #\"\\s\")))\nThe\nQuick\nBrown\nFox\nnil","created-at":1286103547000,"updated-at":1286115114000,"_id":"542692d0c026201cdc326f01"}],"notes":null,"tag":"java.lang.String","arglists":["coll","separator coll"],"doc":"Returns a string of all elements in coll, as returned by (seq coll),\n separated by an optional separator.","library-url":"https://github.com/clojure/clojure","href":"/clojure.string/join"},{"added":"1.2","ns":"clojure.string","name":"replace-first","file":"clojure/string.clj","type":"function","column":1,"see-alsos":[{"created-at":1323919307000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.string","name":"replace","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c57"},{"created-at":1324450151000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"re-pattern","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c58"},{"created-at":1379040099000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"subs","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c59"}],"line":138,"examples":[{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (use '[clojure.string :only (replace-first)])\n\n;; Only replace the first match.\nuser=\u003E (replace-first \"A good day to you, sir. Good day.\" #\"day\" \"night\")\n\"A good night to you, sir. Good day.\"\n\n;; If there are no matches, return the original string.\nuser=\u003E (replace-first \"A good day to you, sir.\" #\"madam\" \"master\")\n\"A good day to you, sir.\"\n\n;; (?i) at the beginning of a pattern makes the entire thing match\n;; case-insensitively, at least for US ASCII characters. (?u) does\n;; the corresponding thing for Unicode.\nuser=\u003E (replace-first \"Day need not be SHOUTED.\" #\"(?i)day\" \"night\")\n\"night need not be SHOUTED.\"\n\n;; See here for many details on regex patterns:\n;; http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html\n;; Also the book \"Mastering Regular Expressions\" by Jeffrey Friedl.\n","created-at":1323919917000,"updated-at":1323920274000,"_id":"542692d7c026201cdc327104"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (use '[clojure.string :only (replace-first)])\n\n;; Pattern matches from beginning of string (signified by ^) up to the\n;; last occurrence of /, because by default * is greedy, i.e. it\n;; matches as much as possible.\nuser=\u003E (replace-first \"/path/to/file/name\" #\"^.*/\" \"\")\n\"name\"\n\n;; Use *? to match as little as possible.\nuser=\u003E (replace-first \"/path/to/file/name\" #\"^.*?/\" \"\")\n\"path/to/file/name\"\n","created-at":1323919934000,"updated-at":1323919934000,"_id":"542692d7c026201cdc327107"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":";; Note: When replace-first or replace have a regex pattern as their\n;; match argument, dollar sign ($) and backslash (\\) characters in\n;; the replacement string are treated specially.\n\n;; Example: pattern matches string \"fodder\", with (o+) matching \"o\"\n;; and (\\S+) matching \"dder\". Replacement string says to replace the\n;; entire match \"fodder\" with $2, the string matched by the second\n;; parenthesized group, \"dder\", followed by $1, \"o\".\nuser=\u003E (str/replace-first \"fabulous fodder foo food\" #\"f(o+)(\\S+)\" \"$2$1\")\n\"fabulous ddero foo food\"\n\n;; To avoid this special treatment of $ and \\, you must escape them with\n;; \\. Because it is in a Clojure string, to get one \\ we must escape\n;; *that* with its own \\.\nuser=\u003E (str/replace-first \"fabulous fodder foo food\" #\"f(o+)(\\S+)\" \"\\\\$2\\\\$1\")\n\"fabulous $2$1 foo food\"\n\n;; To ensure the replacement is treated literally, call\n;; java.util.regex.Matcher/quoteReplacement on it. A shorter name\n;; like re-qr can be handy.\nuser=\u003E (import '(java.util.regex Matcher))\njava.util.regex.Matcher\n\nuser=\u003E (defn re-qr [replacement]\n (Matcher/quoteReplacement replacement))\n#'user/re-qr\n\nuser=\u003E (str/replace-first \"fabulous fodder foo food\" #\"f(o+)(\\S+)\" (re-qr \"$2$1\"))\n\"fabulous $2$1 foo food\"\n","created-at":1324449916000,"updated-at":1325401081000,"_id":"542692d7c026201cdc327108"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[],"body":";; Note: See clojure.core/subs for discussion of behavior of substrings\n;; holding onto references of the original strings, which can\n;; significantly affect your memory usage in some cases.","created-at":1379040092000,"updated-at":1379040092000,"_id":"542692d7c026201cdc32710a"}],"notes":null,"tag":"java.lang.String","arglists":["s match replacement"],"doc":"Replaces the first instance of match with replacement in s.\n\n match/replacement can be:\n\n char / char\n string / string\n pattern / (string or function of match).\n\n See also replace.\n\n The replacement is literal (i.e. none of its characters are treated\n specially) for all cases above except pattern / string.\n\n For pattern / string, $1, $2, etc. in the replacement string are\n substituted with the string that matched the corresponding\n parenthesized group in the pattern. If you wish your replacement\n string r to be used literally, use (re-quote-replacement r) as the\n replacement argument. See also documentation for\n java.util.regex.Matcher's appendReplacement method.\n\n Example:\n (clojure.string/replace-first \"swap first two words\"\n #\"(\\w+)(\\s+)(\\w+)\" \"$3$2$1\")\n -\u003E \"first swap two words\"","library-url":"https://github.com/clojure/clojure","href":"/clojure.string/replace-first"},{"added":"1.8","ns":"clojure.string","name":"starts-with?","file":"clojure/string.clj","type":"function","column":1,"see-alsos":null,"line":361,"examples":null,"notes":null,"arglists":["s substr"],"doc":"True if s starts with substr.","library-url":"https://github.com/clojure/clojure","href":"/clojure.string/starts-with_q"},{"added":"1.2","ns":"clojure.string","name":"escape","file":"clojure/string.clj","type":"function","column":1,"see-alsos":null,"line":301,"examples":[{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[{"login":"dyba","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e1237fa7ee270ace2ebb53c8cab91a6b?r=PG&default=identicon"}],"body":";; There should be no space between the \\ and the &, but I don't know how\n;; to create that in an example yet.\nuser=\u003E (clojure.string/escape \"I want 1 \u003C 2 as HTML, & other good things.\"\n {\\\u003C \"<\", \\\u003E \">\", \\ & \"&\"})\n\"I want 1 < 2 as HTML, & other good things.\"","created-at":1298559035000,"updated-at":1364108977000,"_id":"542692d1c026201cdc326f15"}],"notes":null,"tag":"java.lang.String","arglists":["s cmap"],"doc":"Return a new string, using cmap to escape each character ch\n from s as follows:\n \n If (cmap ch) is nil, append ch to the new string.\n If (cmap ch) is non-nil, append (str (cmap ch)) instead.","library-url":"https://github.com/clojure/clojure","href":"/clojure.string/escape"},{"added":"1.8","ns":"clojure.string","name":"last-index-of","file":"clojure/string.clj","type":"function","column":1,"see-alsos":null,"line":340,"examples":null,"notes":null,"arglists":["s value","s value from-index"],"doc":"Return last index of value (string or char) in s, optionally\n searching backward from from-index. Return nil if value not found.","library-url":"https://github.com/clojure/clojure","href":"/clojure.string/last-index-of"},{"added":"1.5","ns":"clojure.string","name":"re-quote-replacement","file":"clojure/string.clj","type":"function","column":1,"see-alsos":null,"line":54,"examples":null,"notes":null,"tag":"java.lang.String","arglists":["replacement"],"doc":"Given a replacement string that you wish to be a literal\n replacement for a pattern match in replace or replace-first, do the\n necessary escaping of special characters in the replacement.","library-url":"https://github.com/clojure/clojure","href":"/clojure.string/re-quote-replacement"},{"added":"1.8","ns":"clojure.string","name":"includes?","file":"clojure/string.clj","type":"function","column":1,"see-alsos":null,"line":373,"examples":null,"notes":null,"arglists":["s substr"],"doc":"True if s includes substr.","library-url":"https://github.com/clojure/clojure","href":"/clojure.string/includes_q"},{"added":"1.2","ns":"clojure.string","name":"replace","file":"clojure/string.clj","type":"function","column":1,"see-alsos":[{"created-at":1318625174000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"subs","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e64"},{"created-at":1318625263000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.string","name":"split","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e65"},{"created-at":1323919331000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.string","name":"replace-first","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e66"}],"line":75,"examples":[{"author":{"login":"rustem.suniev","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e2051c4ebaaa8c22fa9c0bb2f32f64fd?r=PG&default=identicon"},"editors":[{"login":"rustem.suniev","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e2051c4ebaaa8c22fa9c0bb2f32f64fd?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (clojure.string/replace \"The color is red\" #\"red\" \"blue\")\n\"The color is blue\"","created-at":1284347892000,"updated-at":1332949691000,"_id":"542692d1c026201cdc326f0b"},{"author":{"login":"JD Huntington","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a3d6887041bc564a5d60cdc811ae4ef9?r=PG&default=identicon"},"editors":[{"login":"Domon","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3fe8ae238c14d716a9fc16734a70765b?r=PG&default=identicon"}],"body":"user=\u003E (clojure.string/replace \"The color is red.\" #\"[aeiou]\" #(str %1 %1))\n\"Thee cooloor iis reed.\"\n","created-at":1295092425000,"updated-at":1315398492000,"_id":"542692d1c026201cdc326f0e"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":";; Note: When replace-first or replace have a regex pattern as their\n;; match argument, dollar sign ($) and backslash (\\) characters in\n;; the replacement string are treated specially.\n\n;; Example: first substring that the pattern matches is \"fodder\", with\n;; (o+) matching \"o\" and (\\S+) matching \"dder\". Replacement string\n;; says to replace the entire match \"fodder\" with $2, the string\n;; matched by the second parenthesized group, \"dder\", followed by $1,\n;; \"o\".\nuser=\u003E (str/replace \"fabulous fodder foo food\" #\"f(o+)(\\S+)\" \"$2$1\")\n\"fabulous ddero oo doo\"\n\n;; To avoid this special treatment of $ and \\, you must escape them with\n;; \\. Because it is in a Clojure string, to get one \\ we must escape\n;; *that* with its own \\.\nuser=\u003E (str/replace \"fabulous fodder foo food\" #\"f(o+)(\\S+)\" \"\\\\$2\\\\$1\")\n\"fabulous $2$1 $2$1 $2$1\"\n\n;; To ensure the replacement is treated literally, call\n;; java.util.regex.Matcher/quoteReplacement on it. A shorter name\n;; like re-qr can be handy.\nuser=\u003E (import '(java.util.regex Matcher))\njava.util.regex.Matcher\n\nuser=\u003E (defn re-qr [replacement]\n (Matcher/quoteReplacement replacement))\n#'user/re-qr\n\nuser=\u003E (str/replace \"fabulous fodder foo food\" #\"f(o+)(\\S+)\" (re-qr \"$2$1\"))\n\"fabulous $2$1 $2$1 $2$1\"\n","created-at":1324450115000,"updated-at":1325401213000,"_id":"542692d7c026201cdc3270fe"},{"author":{"login":"dansalmo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e33ee460f5f61bc5ba9b598934766215?r=PG&default=identicon"},"editors":[],"body":";; replaces all a's with 1 and all b's with 2\nuser=\u003E(clojure.string/replace \"a b a\" #\"a|b\" {\"a\" \"1\" \"b\" \"2\"})\n\"1 2 1\"","created-at":1344740223000,"updated-at":1344740223000,"_id":"542692d7c026201cdc327100"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[],"body":";; Note: See clojure.core/subs for discussion of behavior of substrings\n;; holding onto references of the original strings, which can\n;; significantly affect your memory usage in some cases.","created-at":1379040065000,"updated-at":1379040065000,"_id":"542692d7c026201cdc327101"},{"author":{"login":"Corin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/58ca01bfad092685652c8ea2b7bb3008?r=PG&default=identicon"},"editors":[{"login":"Corin","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/58ca01bfad092685652c8ea2b7bb3008?r=PG&default=identicon"}],"body":";; To title case\n(clojure.string/replace \"hello world\" #\"\\b.\" #(.toUpperCase %1))\n\"Hello World\"\n;; Note that a vector is passed to your replacement function\n;; when pattern contains capturing groups (see re-groups)\n(clojure.string/replace \"hello world\" #\"\\b(.)\" #(.toUpperCase (%1 1)))\n\"Hello World\"\n","created-at":1397250241000,"updated-at":1397250291000,"_id":"542692d7c026201cdc327102"}],"notes":[{"updated-at":1351132541000,"body":"How can i replace \".\" with #\"\\s\"","created-at":1351132541000,"author":{"login":"TejasBhatt","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2953c9d9a1566f643e6910c4aa392525?r=PG&default=identicon"},"_id":"542692edf6e94c6970521ff2"}],"tag":"java.lang.String","arglists":["s match replacement"],"doc":"Replaces all instance of match with replacement in s.\n\n match/replacement can be:\n\n string / string\n char / char\n pattern / (string or function of match).\n\n See also replace-first.\n\n The replacement is literal (i.e. none of its characters are treated\n specially) for all cases above except pattern / string.\n\n For pattern / string, $1, $2, etc. in the replacement string are\n substituted with the string that matched the corresponding\n parenthesized group in the pattern. If you wish your replacement\n string r to be used literally, use (re-quote-replacement r) as the\n replacement argument. See also documentation for\n java.util.regex.Matcher's appendReplacement method.\n\n Example:\n (clojure.string/replace \"Almost Pig Latin\" #\"\\b(\\w)(\\w+)\\b\" \"$2$1ay\")\n -\u003E \"lmostAay igPay atinLay\"","library-url":"https://github.com/clojure/clojure","href":"/clojure.string/replace"},{"added":"1.2","ns":"clojure.string","name":"split-lines","file":"clojure/string.clj","type":"function","column":1,"see-alsos":[{"created-at":1329986651000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.string","name":"split","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bce"}],"line":229,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (clojure.string/split-lines \"test \\n string\")\n[\"test \" \" string\"]","created-at":1281617355000,"updated-at":1332953156000,"_id":"542692d0c026201cdc326f08"}],"notes":null,"arglists":["s"],"doc":"Splits s on \\n or \\r\\n. Trailing empty lines are not returned.","library-url":"https://github.com/clojure/clojure","href":"/clojure.string/split-lines"},{"added":"1.2","ns":"clojure.string","name":"lower-case","file":"clojure/string.clj","type":"function","column":1,"see-alsos":[{"created-at":1330171039000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.string","name":"upper-case","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f4d"},{"created-at":1330171043000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.string","name":"capitalize","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f4e"}],"line":213,"examples":[{"author":{"login":"pkolloch","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/10b2fd3c0a4cc46dc241a48468dc551?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (clojure.string/lower-case \"MiXeD cAsE\")\n\"mixed case\"","created-at":1282324622000,"updated-at":1332951955000,"_id":"542692d0c026201cdc326ef9"}],"notes":null,"tag":"java.lang.String","arglists":["s"],"doc":"Converts string to all lower-case.","library-url":"https://github.com/clojure/clojure","href":"/clojure.string/lower-case"},{"added":"1.2","ns":"clojure.string","name":"trim-newline","file":"clojure/string.clj","type":"function","column":1,"see-alsos":[{"created-at":1285923216000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.string","name":"trim","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521de8"},{"created-at":1285923222000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.string","name":"triml","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521de9"},{"created-at":1285923228000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.string","name":"trimr","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dea"}],"line":275,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[],"body":"\u003Cpre\u003E\r\nuser=\u003E (clojure.string/trim-newline \"test\\n\\r\")\r\n\"test\"\r\n\u003C/pre\u003E","created-at":1280737509000,"updated-at":1280737509000,"_id":"542692d1c026201cdc326f18"}],"notes":null,"tag":"java.lang.String","arglists":["s"],"doc":"Removes all trailing newline \\n or return \\r characters from\n string. Similar to Perl's chomp.","library-url":"https://github.com/clojure/clojure","href":"/clojure.string/trim-newline"},{"added":"1.2","ns":"clojure.string","name":"upper-case","file":"clojure/string.clj","type":"function","column":1,"see-alsos":[{"created-at":1330171029000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.string","name":"lower-case","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521af0"},{"created-at":1330171033000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.string","name":"capitalize","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521af1"}],"line":207,"examples":[{"author":{"login":"pkolloch","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/10b2fd3c0a4cc46dc241a48468dc551?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (clojure.string/upper-case \"MiXeD cAsE\")\n\"MIXED CASE\"","created-at":1282324576000,"updated-at":1332951710000,"_id":"542692d0c026201cdc326f05"},{"author":{"login":"nickzam","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fa5bd71476b9dccce0117808539c8688?r=PG&default=identicon"},"editors":[],"body":";; Non-character symbols will be returned back\nuser=\u003E (clojure.string/upper-case \",.!@#$%^&*()\")\n\",.!@#$%^&*()\"","created-at":1386881910000,"updated-at":1386881910000,"_id":"542692d7c026201cdc327113"}],"notes":null,"tag":"java.lang.String","arglists":["s"],"doc":"Converts string to all upper-case.","library-url":"https://github.com/clojure/clojure","href":"/clojure.string/upper-case"},{"added":"1.2","ns":"clojure.string","name":"split","file":"clojure/string.clj","type":"function","column":1,"see-alsos":[{"created-at":1318625222000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"subs","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f59"},{"created-at":1318625227000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.string","name":"replace","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f5a"},{"created-at":1318625367000,"author":{"login":"mmwaikar","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/29d36f4c9f39c9f8ff61c07033b13118?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"re-seq","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f5b"},{"created-at":1329986664000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.string","name":"split-lines","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521f5c"}],"line":219,"examples":[{"author":{"login":"nipra","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/acb8dccef4e223ce5ba95080f5861457?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"cloojure","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1ad3de25d00d953de6e8c82f554cdbf5?r=PG&default=identicon"}],"body":"user=\u003E (require '[clojure.string :as str])\n\nuser=\u003E (str/split \"Clojure is awesome!\" #\" \")\n[\"Clojure\" \"is\" \"awesome!\"]\n\nuser=\u003E (str/split \"q1w2e3r4t5y6u7i8o9p0\" #\"\\d+\")\n[\"q\" \"w\" \"e\" \"r\" \"t\" \"y\" \"u\" \"i\" \"o\" \"p\"]\nuser=\u003E (str/split \"q1w2e3r4t5y6u7i8o9p0\" #\"\\d+\" 5)\n[\"q\" \"w\" \"e\" \"r\" \"t5y6u7i8o9p0\"]\n","created-at":1279388024000,"updated-at":1409978636000,"_id":"542692d0c026201cdc326efb"},{"author":{"login":"Santosh","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/851ccd369a1501c72f5e08af19ff9dc1?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; Splits a string on space character and joins \n;; the resulting collection with a line feed character\n\n(use '[clojure.string :only (join split)])\n\nuser=\u003E (println\n (join \"\\n\"\n (split \"The Quick Brown Fox\" #\"\\s\")))\nThe\nQuick\nBrown\nFox\nnil","created-at":1286103685000,"updated-at":1286115074000,"_id":"542692d0c026201cdc326efe"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"(use '[clojure.string :only (split triml)])\n\n;; Splitting on whitespace is a common desire.\nuser=\u003E (split \"Some words to split\" #\"\\s+\")\n[\"Some\" \"words\" \"to\" \"split\"]\n\n;; By using the pattern #\"\\s+\", we split on all occurrences of one or\n;; more consecutive whitespace characters.\nuser=\u003E (split \"Some words with\\tother whitespace \\n\" #\"\\s+\")\n[\"Some\" \"words\" \"with\" \"other\" \"whitespace\"]\n\n;; If you are used to Perl's special behavior of split(' ', $str),\n;; where it ignores leading whitespace in the string to be split, this\n;; does not quite do it.\nuser=\u003E (split \" Leading whitespace causes empty first string\" #\"\\s+\")\n[\"\" \"Leading\" \"whitespace\" \"causes\" \"empty\" \"first\" \"string\"]\n\n;; This will do it.\nuser=\u003E (defn perl-split-on-space [s]\n (split (triml s) #\"\\s+\"))\n#'user/perl-split-on-space\nuser=\u003E (perl-split-on-space \" This is often what you want \")\n[\"This\" \"is\" \"often\" \"what\" \"you\" \"want\"]\n\n;; There might be cases where you want this instead.\nuser=\u003E (split \"Some words with\\tother whitespace \\n\" #\"\\s\")\n[\"Some\" \"\" \"\" \"\" \"words\" \"\" \"\" \"with\" \"other\" \"whitespace\"]\n","created-at":1323918291000,"updated-at":1324028976000,"_id":"542692d7c026201cdc32710c"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[],"body":"(use '[clojure.string :only (split)])\n\n;; Split on every occurrence of : character\nuser=\u003E (split \"root:*:0:0:admin:/var/root:/bin/sh\" #\":\")\n[\"root\" \"*\" \"0\" \"0\" \"admin\" \"/var/root\" \"/bin/sh\"]\n\n;; Empty strings are returned when two colons appear consecutively in\n;; the string to be split.\nuser=\u003E (split \"root::0:0::/var/root:/bin/sh\" #\":\")\n[\"root\" \"\" \"0\" \"0\" \"\" \"/var/root\" \"/bin/sh\"]\n\n;; Without specifying a limit, any empty strings at the end are\n;; omitted.\nuser=\u003E (split \"root::0:0:admin:/var/root:\" #\":\")\n[\"root\" \"\" \"0\" \"0\" \"admin\" \"/var/root\"]\nuser=\u003E (split \"root::0:0:admin::\" #\":\")\n[\"root\" \"\" \"0\" \"0\" \"admin\"]\n\n;; If you want all of the fields, even trailing empty ones, use a\n;; negative limit.\nuser=\u003E (split \"root::0:0:admin:/var/root:\" #\":\" -1)\n[\"root\" \"\" \"0\" \"0\" \"admin\" \"/var/root\" \"\"]\nuser=\u003E (split \"root::0:0:admin::\" #\":\" -1)\n[\"root\" \"\" \"0\" \"0\" \"admin\" \"\" \"\"]\n\n;; Use a positive limit of n to limit the maximum number of strings in\n;; the return value to n. If it returns exactly n strings, the last\n;; contains everything left over after splitting off the n-1 earlier\n;; strings.\nuser=\u003E (split \"root::0:0:admin:/var/root:\" #\":\" 2)\n[\"root\" \":0:0:admin:/var/root:\"]\nuser=\u003E (split \"root::0:0:admin:/var/root:\" #\":\" 3)\n[\"root\" \"\" \"0:0:admin:/var/root:\"]\nuser=\u003E (split \"root::0:0:admin:/var/root:\" #\":\" 4)\n[\"root\" \"\" \"0\" \"0:admin:/var/root:\"]\nuser=\u003E (split \"root::0:0:admin:/var/root:\" #\":\" 15)\n[\"root\" \"\" \"0\" \"0\" \"admin\" \"/var/root\" \"\"]\n","created-at":1323918517000,"updated-at":1323918517000,"_id":"542692d7c026201cdc327110"},{"author":{"login":"octopusgrabbus","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/fd31b8bcea99fa7b0711fbc424587774?r=PG&default=identicon"},"editors":[],"body":"(:require [clojure.string :as cstr])\n\n(def legal-ref \"1321-61\")\n\n(cstr/split legal-ref #\"-\")\n[\"1321\" \"61\"]","created-at":1358660615000,"updated-at":1358660615000,"_id":"542692d7c026201cdc327111"},{"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"editors":[],"body":";; Note: See clojure.core/subs for discussion of behavior of substrings\n;; holding onto references of the original strings, which can\n;; significantly affect your memory usage in some cases.","created-at":1379040081000,"updated-at":1379040081000,"_id":"542692d7c026201cdc327112"}],"notes":[{"updated-at":1280043062000,"body":"user=\u003E (clojure.string/split \"foo bar\")\r\njava.lang.ClassNotFoundException: clojure.string\r\n\r\nDo I need to require / use anything?","created-at":1280043062000,"author":{"login":"Jacolyte","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1703a0c3ed358b787f4b1bf3b2799472?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521f89"},{"updated-at":1284342879000,"body":"You need to add a namespace:\r\nuser =\u003E (use 'clojure.string)","created-at":1284342879000,"author":{"login":"rustem.suniev","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e2051c4ebaaa8c22fa9c0bb2f32f64fd?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521f95"},{"updated-at":1306110858000,"body":"I 've a doubt...in ruby if I've this:\r\n\r\nbignumber=\"2938434\"\r\n\r\nI can do this\r\n\r\nbignumber.split(\"\") \r\n\r\nand get\r\n(\"2\", \"9\", \"3\", \"8\" .....)\r\n\r\nHow can I do this with clojure?...thanks","created-at":1306110858000,"author":{"login":"cocoOS","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/8be1592fe29f2a7ac4e9e6ad683baaa1?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fbc"},{"updated-at":1315397601000,"body":"Hi, cocoOS. You may want to do it like this:\r\n\r\n\u003Cpre\u003Euser=> (use '[clojure.string :only (split)])\r\nnil\r\nuser=> (def bignumber \"2938434\")\r\n#'user/bignumber\r\nuser=> (split bignumber #\"\")\r\n[\"\" \"2\" \"9\" \"3\" \"8\" \"4\" \"3\" \"4\"]\r\n\u003C/pre\u003E\r\n\r\nYou will have to filter out the empty string.\r\n\r\n\u003Cbr\u003E\r\n\r\nBut there are other ways, like:\r\n\u003Cpre\u003Euser=> (map str (vec bignumber))\r\n(\"2\" \"9\" \"3\" \"8\" \"4\" \"3\" \"4\")\r\n\u003C/pre\u003E","created-at":1315395310000,"author":{"login":"Domon","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3fe8ae238c14d716a9fc16734a70765b?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fc9"},{"updated-at":1338786357000,"body":"\u003Cpre\u003E\r\nuser=\u003E (seq \"2938434\")\r\n(\\2 \\9 \\3 \\8 \\4 \\3 \\4)\r\n\u003C/pre\u003E\r\n\r\nmight also be what you want.","created-at":1338786357000,"author":{"login":"Iceland_jack","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/c889e0a95a3bb07f90ab28ad442f1127?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fe2"},{"updated-at":1365500709000,"body":"Thanks for the help Domon and Iceland_jack, one more question:\r\n\r\nSay I have used sequence in the way:\r\n\r\nuser=> (seq \"2938434\")\r\n(\\2 \\9 \\3 \\8 \\4 \\3 \\4)\r\n\r\nIf I only wanted to access the 4th item in the sequence (which is 8), how would I do so? Aside from using (next (next (next ...))) ? Just trying to index it giving that I want position 4","created-at":1365500563000,"author":{"login":"Instinct212","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/2f71c013847ef7da0e6cf8ea7a2dec62?r=PG&default=identicon"},"_id":"542692edf6e94c6970522000"}],"arglists":["s re","s re limit"],"doc":"Splits string on a regular expression. Optional argument limit is\n the maximum number of parts. Not lazy. Returns vector of the parts.\n Trailing empty strings are not returned - pass limit of -1 to return all.","library-url":"https://github.com/clojure/clojure","href":"/clojure.string/split"},{"added":"1.2","ns":"clojure.string","name":"trimr","file":"clojure/string.clj","type":"function","column":1,"see-alsos":[{"created-at":1289214850000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.string","name":"trim","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ad1"},{"created-at":1289214855000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.string","name":"triml","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521ad2"}],"line":264,"examples":[{"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"editors":[],"body":"(use 'clojure.string)\n(trimr \" my string \")\n=\u003E \" my string\"","created-at":1289214835000,"updated-at":1289214835000,"_id":"542692d0c026201cdc326f07"}],"notes":null,"tag":"java.lang.String","arglists":["s"],"doc":"Removes whitespace from the right side of string.","library-url":"https://github.com/clojure/clojure","href":"/clojure.string/trimr"},{"added":"1.8","ns":"clojure.string","name":"index-of","file":"clojure/string.clj","type":"function","column":1,"see-alsos":null,"line":319,"examples":null,"notes":null,"arglists":["s value","s value from-index"],"doc":"Return index of value (string or char) in s, optionally searching\n forward from from-index. Return nil if value not found.","library-url":"https://github.com/clojure/clojure","href":"/clojure.string/index-of"},{"added":"1.2","ns":"clojure.string","name":"trim","file":"clojure/string.clj","type":"function","column":1,"see-alsos":[{"created-at":1285923170000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.string","name":"triml","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521de0"},{"created-at":1285923176000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.string","name":"trimr","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521de1"},{"created-at":1285923182000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.string","name":"trim-newline","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521de2"}],"line":235,"examples":[{"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"editors":[{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"}],"body":";; Trim basically does what you'd expect. What the doc string\n;; does not tell you however is that:\n;; - null will cause an error\n;; - non-string parameters will be converted to a string\n;; before being trimed.\n\n(use 'clojure.string)\nuser=\u003E (trim \" a \")\n\"a\"\nuser=\u003E (trim nil) \njava.lang.NullPointerException (NO_SOURCE_FILE:0)\nuser=\u003E (trim 1.1)\n\"1.1\"\nuser=\u003E (trim [1 2 3])\n\"[1 2 3]\"\n","created-at":1285923161000,"updated-at":1289214976000,"_id":"542692d0c026201cdc326ef7"}],"notes":null,"tag":"java.lang.String","arglists":["s"],"doc":"Removes whitespace from both ends of string.","library-url":"https://github.com/clojure/clojure","href":"/clojure.string/trim"},{"added":"1.2","ns":"clojure.string","name":"triml","file":"clojure/string.clj","type":"function","column":1,"see-alsos":[{"created-at":1285923245000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.string","name":"trim","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d6c"},{"created-at":1285923254000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.string","name":"trim-newline","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d6d"},{"created-at":1285923266000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"to-var":{"ns":"clojure.string","name":"trimr","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d6e"}],"line":252,"examples":[{"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"editors":[],"body":"(use 'clojure.string)\n(triml \" my string \")\n=\u003E \"my string \"\n","created-at":1289214918000,"updated-at":1289214918000,"_id":"542692d0c026201cdc326f0a"}],"notes":null,"tag":"java.lang.String","arglists":["s"],"doc":"Removes whitespace from the left side of string.","library-url":"https://github.com/clojure/clojure","href":"/clojure.string/triml"},{"added":"1.2","ns":"clojure.string","name":"blank?","file":"clojure/string.clj","type":"function","column":1,"see-alsos":null,"line":288,"examples":[{"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"editors":[],"body":"user\u003E (clojure.string/blank? nil)\ntrue\n\nuser\u003E (clojure.string/blank? false)\ntrue\n\nuser\u003E (clojure.string/blank? \" \")\ntrue\n\nuser\u003E (clojure.string/blank? \" a \")\nfalse","created-at":1293672606000,"updated-at":1293672606000,"_id":"542692d1c026201cdc326f17"}],"notes":null,"arglists":["s"],"doc":"True if s is nil, empty, or contains only whitespace.","library-url":"https://github.com/clojure/clojure","href":"/clojure.string/blank_q"},{"ns":"clojure.template","name":"do-template","file":"clojure/template.clj","type":"macro","column":1,"see-alsos":null,"line":45,"examples":[{"author":{"login":"pkolloch","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/10b2fd3c0a4cc46dc241a48468dc551?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"}],"body":";; Because it is expanded at compile time, you can also use special \n;; forms as in full blown macros:\n\nuser=\u003E (use 'clojure.template)\nuser=\u003E (do-template [a b] (def a b) d 1 e 2 f 3)\n#'user/f\nuser=\u003E d\n1\nuser=\u003E e\n2\nuser=\u003E f\n3\n\n;; and if you are curious why\nuser=\u003E (use 'clojure.walk)\nuser=\u003E (macroexpand-all '(do-template [a b] (def a b) d 1 e 2 f 3))\n(do (def d 1) (def e 2) (def f 3))\n\n","created-at":1280117904000,"updated-at":1339250655000,"_id":"542692d1c026201cdc326f19"}],"macro":true,"notes":null,"arglists":["argv expr & values"],"doc":"Repeatedly copies expr (in a do block) for each group of arguments\n in values. values are automatically partitioned by the number of\n arguments in argv, an argument vector as in defn.\n\n Example: (macroexpand '(do-template [x y] (+ y x) 2 4 3 5))\n ;=\u003E (do (+ 4 2) (+ 5 3))","library-url":"https://github.com/clojure/clojure","href":"/clojure.template/do-template"},{"ns":"clojure.template","name":"apply-template","file":"clojure/template.clj","type":"function","column":1,"see-alsos":[{"created-at":1347013502000,"author":{"login":"siteshen","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/a50fd1fe168786443e5fe62560ed03e8?r=PG&default=identicon"},"to-var":{"ns":"clojure.template","name":"do-template","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dc1"}],"line":30,"examples":[{"author":{"login":"sunil.nandihalli","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3b7fcae9384271fb8ca8cd0c612bebf3?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":"user=\u003E (apply-template '[a b c d e] '[d a b e c e b a d] '(1 2 3 4 5))\n[4 1 2 5 3 5 2 1 4] \n\nuser=\u003E (apply-template '[a b c d e] '[d a b e c e b a d] '(1 [2 3] [4 5]))\n[d 1 [2 3] e [4 5] e [2 3] 1 d]","created-at":1287072285000,"updated-at":1287673447000,"_id":"542692d1c026201cdc326f1c"}],"notes":null,"arglists":["argv expr values"],"doc":"For use in macros. argv is an argument list, as in defn. expr is\n a quoted expression using the symbols in argv. values is a sequence\n of values to be used for the arguments.\n\n apply-template will recursively replace argument symbols in expr\n with their corresponding values, returning a modified expr.\n\n Example: (apply-template '[x] '(+ x x) '[2])\n ;=\u003E (+ 2 2)","library-url":"https://github.com/clojure/clojure","href":"/clojure.template/apply-template"},{"added":"1.1","ns":"clojure.test","name":"are","file":"clojure/test.clj","type":"macro","column":1,"see-alsos":[{"created-at":1281856914000,"author":{"login":"looselytyped","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9bfc2e772db334c8b8516c86b9da7a0c?r=PG&default=identicon"},"to-var":{"ns":"clojure.test","name":"is","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c6f"},{"created-at":1330170936000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.test","name":"deftest","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c70"}],"line":572,"examples":[{"author":{"login":"looselytyped","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9bfc2e772db334c8b8516c86b9da7a0c?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"}],"body":";; An alternate to the example in the documentation is \n\nuser=\u003E (are [result arg-map] (= result (+ (:x arg-map) (:y arg-map)))\n 5 {:x 2 :y 3},\n 10 {:x 6 :y 4})\n\n\n","created-at":1281856669000,"updated-at":1285494663000,"_id":"542692d1c026201cdc326f27"}],"macro":true,"notes":null,"arglists":["argv expr & args"],"doc":"Checks multiple assertions with a template expression.\n See clojure.template/do-template for an explanation of\n templates.\n\n Example: (are [x y] (= x y) \n 2 (+ 1 1)\n 4 (* 2 2))\n Expands to: \n (do (is (= 2 (+ 1 1)))\n (is (= 4 (* 2 2))))\n\n Note: This breaks some reporting features, such as line numbers.","library-url":"https://github.com/clojure/clojure","href":"/clojure.test/are"},{"added":"1.1","ns":"clojure.test","name":"test-all-vars","file":"clojure/test.clj","type":"function","column":1,"see-alsos":null,"line":737,"examples":null,"notes":null,"arglists":["ns"],"doc":"Calls test-vars on every var interned in the namespace, with fixtures.","library-url":"https://github.com/clojure/clojure","href":"/clojure.test/test-all-vars"},{"added":"1.1","ns":"clojure.test","name":"test-var","file":"clojure/test.clj","type":"function","column":1,"see-alsos":null,"dynamic":true,"line":708,"examples":null,"notes":null,"arglists":["v"],"doc":"If v has a function in its :test metadata, calls that function,\n with *testing-vars* bound to (conj *testing-vars* v).","library-url":"https://github.com/clojure/clojure","href":"/clojure.test/test-var"},{"added":"1.2","ns":"clojure.test","name":"do-report","file":"clojure/test.clj","type":"function","column":1,"see-alsos":null,"line":351,"examples":null,"notes":null,"arglists":["m"],"doc":"Add file and line information to a test result and call report.\n If you are writing a custom assert-expr method, call this function\n to pass test results to report.","library-url":"https://github.com/clojure/clojure","href":"/clojure.test/do-report"},{"added":"1.1","ns":"clojure.test","name":"run-all-tests","file":"clojure/test.clj","type":"function","column":1,"see-alsos":null,"line":780,"examples":null,"notes":null,"arglists":["","re"],"doc":"Runs all tests in all namespaces; prints results.\n Optional argument is a regular expression; only namespaces with\n names matching the regular expression (with re-matches) will be\n tested.","library-url":"https://github.com/clojure/clojure","href":"/clojure.test/run-all-tests"},{"added":"1.1","ns":"clojure.test","name":"assert-any","file":"clojure/test.clj","type":"function","column":1,"see-alsos":null,"line":455,"examples":null,"notes":null,"arglists":["msg form"],"doc":"Returns generic assertion code for any test, including macros, Java\n method calls, or isolated symbols.","library-url":"https://github.com/clojure/clojure","href":"/clojure.test/assert-any"},{"added":"1.1","ns":"clojure.test","name":"testing-contexts-str","file":"clojure/test.clj","type":"function","column":1,"see-alsos":null,"line":307,"examples":null,"notes":null,"arglists":[""],"doc":"Returns a string representation of the current test context. Joins\n strings in *testing-contexts* with spaces.","library-url":"https://github.com/clojure/clojure","href":"/clojure.test/testing-contexts-str"},{"added":"1.1","ns":"clojure.test","name":"file-position","file":"clojure/test.clj","type":"function","column":1,"see-alsos":null,"line":282,"examples":null,"deprecated":"1.2","notes":null,"arglists":["n"],"doc":"Returns a vector [filename line-number] for the nth call up the\n stack.\n\n Deprecated in 1.2: The information needed for test reporting is\n now on :file and :line keys in the result map.","library-url":"https://github.com/clojure/clojure","href":"/clojure.test/file-position"},{"added":"1.1","ns":"clojure.test","name":"testing","file":"clojure/test.clj","type":"macro","column":1,"see-alsos":[{"created-at":1289286950000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.test","name":"is","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c2c"},{"created-at":1330170963000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.test","name":"deftest","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c2d"}],"line":597,"examples":[{"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"editors":[{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"}],"body":"(:use 'clojure.test)\n\n(testing \"Arithmetic\"\n (testing \"with positive integers\"\n (is (= 4 (+ 2 2)))\n (is (= 7 (+ 3 4))))\n (testing \"with negative integers\"\n (is (= -4 (+ -2 -2)))\n (is (= -1 (+ 3 -4)))))\n=\u003E true\n\n\n---------------------------------------------------------------------------\n\n(testing \"Arithmetic\"\n (testing \"with positive integers\"\n (is (= 4 (+ 2 2)))\n (is (= 7 (+ 3 4))))\n (testing \"with negative integers\"\n (is (= -5 (+ -2 -2))) ;error here\n (is (= -1 (+ 3 -4)))))\n\n=\u003E FAIL in clojure.lang.PersistentList$EmptyList@1 (NO_SOURCE_FILE:641)\nArithmetic with negative integers ;bread crumb trail\nexpected: (= -5 (+ -2 -2))\n actual: (not (= -5 -4))\ntrue","created-at":1289286946000,"updated-at":1289287174000,"_id":"542692d1c026201cdc326f23"}],"macro":true,"notes":null,"arglists":["string & body"],"doc":"Adds a new string to the list of testing contexts. May be nested,\n but must occur inside a test function (deftest).","library-url":"https://github.com/clojure/clojure","href":"/clojure.test/testing"},{"added":"1.1","ns":"clojure.test","name":"join-fixtures","file":"clojure/test.clj","type":"function","column":1,"see-alsos":[{"created-at":1339790151000,"author":{"login":"mnicky","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/be261a601929eaf8eda9e1420b4781f9?r=PG&default=identicon"},"to-var":{"ns":"clojure.test","name":"use-fixtures","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c69"},{"created-at":1339790157000,"author":{"login":"mnicky","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/be261a601929eaf8eda9e1420b4781f9?r=PG&default=identicon"},"to-var":{"ns":"clojure.test","name":"compose-fixtures","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c6a"}],"line":696,"examples":null,"notes":null,"arglists":["fixtures"],"doc":"Composes a collection of fixtures, in order. Always returns a valid\n fixture function, even if the collection is empty.","library-url":"https://github.com/clojure/clojure","href":"/clojure.test/join-fixtures"},{"added":"1.1","ns":"clojure.test","name":"set-test","file":"clojure/test.clj","type":"macro","column":1,"see-alsos":null,"line":648,"examples":null,"macro":true,"notes":null,"arglists":["name & body"],"doc":"Experimental.\n Sets :test metadata of the named var to a fn with the given body.\n The var must already exist. Does not modify the value of the var.\n\n When *load-tests* is false, set-test is ignored.","library-url":"https://github.com/clojure/clojure","href":"/clojure.test/set-test"},{"added":"1.1","ns":"clojure.test","name":"get-possibly-unbound-var","file":"clojure/test.clj","type":"function","column":1,"see-alsos":null,"line":416,"examples":null,"notes":null,"arglists":["v"],"doc":"Like var-get but returns nil if the var is unbound.","library-url":"https://github.com/clojure/clojure","href":"/clojure.test/get-possibly-unbound-var"},{"ns":"clojure.test","name":"assert-expr","file":"clojure/test.clj","type":"var","column":1,"see-alsos":null,"line":476,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.test/assert-expr"},{"added":"1.1","ns":"clojure.test","name":"report","file":"clojure/test.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":324,"examples":null,"notes":null,"arglists":[],"doc":"Generic reporting function, may be overridden to plug in\n different report formats (e.g., TAP, JUnit). Assertions such as\n 'is' call 'report' to indicate results. The argument given to\n 'report' will be a map with a :type key. See the documentation at\n the top of test_is.clj for more information on the types of\n arguments for 'report'.","library-url":"https://github.com/clojure/clojure","href":"/clojure.test/report"},{"added":"1.1","ns":"clojure.test","name":"compose-fixtures","file":"clojure/test.clj","type":"function","column":1,"see-alsos":null,"line":689,"examples":null,"notes":null,"arglists":["f1 f2"],"doc":"Composes two fixture functions, creating a new fixture function\n that combines their behavior.","library-url":"https://github.com/clojure/clojure","href":"/clojure.test/compose-fixtures"},{"added":"1.1","ns":"clojure.test","name":"with-test","file":"clojure/test.clj","type":"macro","column":1,"see-alsos":[{"created-at":1289287480000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"test","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bb6"},{"created-at":1289287493000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"meta","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bb7"},{"created-at":1355984959000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.test","name":"deftest","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bb8"}],"line":609,"examples":[{"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"editors":[],"body":";with test is the same as using {:test #((is...)(is...))} in the meta data of the function.\n\n(:use 'clojure.test)\n\n(with-test\n (defn my-function [x y]\n (+ x y))\n (is (= 4 (my-function 2 2)))\n (is (= 7 (my-function 3 4))))\n\n(test #'my-function) ;(test (var my-function))\n=\u003E :ok","created-at":1289287473000,"updated-at":1289287473000,"_id":"542692d1c026201cdc326f29"}],"macro":true,"notes":null,"arglists":["definition & body"],"doc":"Takes any definition form (that returns a Var) as the first argument.\n Remaining body goes in the :test metadata function for that Var.\n\n When *load-tests* is false, only evaluates the definition, ignoring\n the tests.","library-url":"https://github.com/clojure/clojure","href":"/clojure.test/with-test"},{"added":"1.1","ns":"clojure.test","name":"*stack-trace-depth*","file":"clojure/test.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":252,"examples":null,"notes":null,"arglists":[],"doc":"The maximum depth of stack traces to print when an Exception\n is thrown during a test. Defaults to nil, which means print the \n complete stack trace.","library-url":"https://github.com/clojure/clojure","href":"/clojure.test/*stack-trace-depth*"},{"added":"1.1","ns":"clojure.test","name":"is","file":"clojure/test.clj","type":"macro","column":1,"see-alsos":[{"created-at":1330170895000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.test","name":"are","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bef"},{"created-at":1330170928000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.test","name":"deftest","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521bf0"}],"line":554,"examples":[{"author":{"login":"JonNeale","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/52f685bf4240b827b1486b6551cfcd56?r=PG&default=identicon"},"editors":[{"login":"JonNeale","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/52f685bf4240b827b1486b6551cfcd56?r=PG&default=identicon"}],"body":"(use '[clojure.test :only [is]])\n\nuser=\u003E (is (true? true))\ntrue\n\n;; false assertions print a message and evaluate to false\n\nuser=\u003E (is (true? false))\nFAIL in clojure.lang.PersistentList$EmptyList@1 (NO_SOURCE_FILE:1)\nexpected: (true? false)\n actual: (not (true? false))\nfalse\n\n","created-at":1350425559000,"updated-at":1350488982000,"_id":"542692d7c026201cdc327114"},{"author":{"login":"Alan Thompson","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5b677647e3c6fb2bc89fa2f481461b11?r=PG&default=identicon"},"editors":[],"body":"; Testing for thrown exceptions\n\n; Verifies that the specified exception is thrown\nuser=\u003E (is (thrown? ArithmeticException (/ 1 0)))\n#\u003CArithmeticException java.lang.ArithmeticException: Divide by zero\u003E\n\n; Verified that the exception is thrown, and that the error message matches the specified regular expression.\nuser=\u003E (is (thrown-with-msg? ArithmeticException #\"Divide by zero\"\n #_=\u003E (/ 1 0)))\n#\u003CArithmeticException java.lang.ArithmeticException: Divide by zero\u003E\nuser=\u003E \n\n","created-at":1398819305000,"updated-at":1398819305000,"_id":"542692d7c026201cdc327116"}],"macro":true,"notes":null,"arglists":["form","form msg"],"doc":"Generic assertion macro. 'form' is any predicate test.\n 'msg' is an optional message to attach to the assertion.\n \n Example: (is (= 4 (+ 2 2)) \"Two plus two should be 4\")\n\n Special forms:\n\n (is (thrown? c body)) checks that an instance of c is thrown from\n body, fails if not; then returns the thing thrown.\n\n (is (thrown-with-msg? c re body)) checks that an instance of c is\n thrown AND that the message on the exception matches (with\n re-find) the regular expression re.","library-url":"https://github.com/clojure/clojure","href":"/clojure.test/is"},{"ns":"clojure.test","name":"*report-counters*","file":"clojure/test.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":262,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.test/*report-counters*"},{"added":"1.1","ns":"clojure.test","name":"*load-tests*","file":"clojure/test.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":245,"examples":null,"notes":null,"arglists":[],"doc":"True by default. If set to false, no test functions will\n be created by deftest, set-test, or with-test. Use this to omit\n tests when compiling or loading production code.","library-url":"https://github.com/clojure/clojure","href":"/clojure.test/*load-tests*"},{"added":"1.1","ns":"clojure.test","name":"deftest","file":"clojure/test.clj","type":"macro","column":1,"see-alsos":[{"created-at":1289287593000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.test","name":"run-all-tests","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e90"},{"created-at":1289288265000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.test","name":"run-tests","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e91"},{"created-at":1330170918000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.test","name":"is","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e92"},{"created-at":1330170920000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.test","name":"are","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e93"},{"created-at":1330170973000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"to-var":{"ns":"clojure.test","name":"testing","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e94"},{"created-at":1366152324000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.test","name":"test-var","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e95"}],"line":622,"examples":[{"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"}],"body":";successful test example\n(ns testing)\n(use 'clojure.test)\n\n\n(deftest addition\n (is (= 4 (+ 2 2)))\n (is (= 7 (+ 3 4))))\n=\u003E #'testing/addition\n\n(deftest subtraction\n (is (= 1 (- 4 3)))\n (is (= 3 (- 7 4))))\n=\u003E #'testing/subtraction\n\n;composing tests\n(deftest arithmetic\n (addition)\n (subtraction))\n=\u003E #'testing/arithmetic\n\n(run-tests 'testing)\n\n=\u003E Testing testing\n\nRan 6 tests containing 10 assertions.\n0 failures, 0 errors.\n{:type :summary, :test 6, :pass 10, :fail 0, :error 0}","created-at":1280985983000,"updated-at":1289288085000,"_id":"542692d1c026201cdc326f1e"},{"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"editors":[{"login":"mikebridge","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/517ea04cf362ddc08f107f6ef98a12d9?r=PG&default=identicon"}],"body":";failure test example\n\n;there is nesting, so when a leaf test fails so does its parents, in this example 2 tests fail, though there was only one real error.\n\n(ns testing)\n(use 'clojure.test)\n\n\n(deftest addition\n (is (= 4 (+ 2 2)))\n (is (= 7 (+ 3 4))))\n=\u003E #'testing/addition\n\n(deftest subtraction\n (is (= 1 (- 4 3)))\n (is (= 6 (- 7 4)))) ;error\n=\u003E #'testing/subtraction\n\n;composing tests\n(deftest arithmetic\n (addition)\n (subtraction))\n=\u003E #'testing/arithmetic\n\n(run-tests 'testing)\n\n=\u003E Testing testing\n\nFAIL in (arithmetic subtraction) (NO_SOURCE_FILE:669)\nexpected: (= 6 (- 7 4))\n actual: (not (= 6 3))\n\nFAIL in (subtraction) (NO_SOURCE_FILE:669)\nexpected: (= 6 (- 7 4))\n actual: (not (= 6 3))\n\nRan 6 tests containing 10 assertions.\n2 failures, 0 errors.\n{:type :summary, :test 6, :pass 8, :fail 2, :error 0}","created-at":1289288235000,"updated-at":1332332244000,"_id":"542692d1c026201cdc326f21"}],"macro":true,"notes":null,"arglists":["name & body"],"doc":"Defines a test function with no arguments. Test functions may call\n other tests, so tests may be composed. If you compose tests, you\n should also define a function named test-ns-hook; run-tests will\n call test-ns-hook instead of testing all vars.\n\n Note: Actually, the test body goes in the :test metadata on the var,\n and the real function (the value of the var) calls test-var on\n itself.\n\n When *load-tests* is false, deftest is ignored.","library-url":"https://github.com/clojure/clojure","href":"/clojure.test/deftest"},{"added":"1.1","ns":"clojure.test","name":"assert-predicate","file":"clojure/test.clj","type":"function","column":1,"see-alsos":null,"line":436,"examples":null,"notes":null,"arglists":["msg form"],"doc":"Returns generic assertion code for any functional predicate. The\n 'expected' argument to 'report' will contains the original form, the\n 'actual' argument will contain the form with all its sub-forms\n evaluated. If the predicate returns false, the 'actual' form will\n be wrapped in (not...).","library-url":"https://github.com/clojure/clojure","href":"/clojure.test/assert-predicate"},{"added":"1.1","ns":"clojure.test","name":"with-test-out","file":"clojure/test.clj","type":"macro","column":1,"see-alsos":null,"line":273,"examples":null,"macro":true,"notes":null,"arglists":["& body"],"doc":"Runs body with *out* bound to the value of *test-out*.","library-url":"https://github.com/clojure/clojure","href":"/clojure.test/with-test-out"},{"added":"1.1","ns":"clojure.test","name":"function?","file":"clojure/test.clj","type":"function","column":1,"see-alsos":null,"line":424,"examples":[{"author":{"login":"dakrone","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bcacd00a7f05c4772329cf9f446c7987?r=PG&default=identicon"},"editors":[],"body":"user\u003E (defn foo [] (println \"foo\"))\n#'user/foo\n\nuser\u003E (def bar \"bar\")\n#'user/bar\n\nuser\u003E (clojure.test/function? foo)\ntrue\n\nuser\u003E (clojure.test/function? bar)\nfalse","created-at":1293673262000,"updated-at":1293673262000,"_id":"542692d1c026201cdc326f26"}],"notes":null,"arglists":["x"],"doc":"Returns true if argument is a function or a symbol that resolves to\n a function (not a macro).","library-url":"https://github.com/clojure/clojure","href":"/clojure.test/function_q"},{"added":"1.1","ns":"clojure.test","name":"deftest-","file":"clojure/test.clj","type":"macro","column":1,"see-alsos":[{"created-at":1289287570000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.test","name":"deftest","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b08"}],"line":639,"examples":null,"macro":true,"notes":null,"arglists":["name & body"],"doc":"Like deftest but creates a private var.","library-url":"https://github.com/clojure/clojure","href":"/clojure.test/deftest-"},{"added":"1.6","ns":"clojure.test","name":"test-vars","file":"clojure/test.clj","type":"function","column":1,"see-alsos":null,"line":723,"examples":null,"notes":null,"arglists":["vars"],"doc":"Groups vars by their namespace and runs test-var on them with\n appropriate fixtures applied.","library-url":"https://github.com/clojure/clojure","href":"/clojure.test/test-vars"},{"added":"1.11","ns":"clojure.test","name":"run-test-var","file":"clojure/test.clj","type":"function","column":1,"see-alsos":null,"line":797,"examples":null,"notes":null,"arglists":["v"],"doc":"Runs the tests for a single Var, with fixtures executed around the test, and summary output after.","library-url":"https://github.com/clojure/clojure","href":"/clojure.test/run-test-var"},{"added":"1.1","ns":"clojure.test","name":"try-expr","file":"clojure/test.clj","type":"macro","column":1,"see-alsos":[{"created-at":1289460897000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.test","name":"is","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cf6"}],"line":538,"examples":null,"macro":true,"notes":null,"arglists":["msg form"],"doc":"Used by the 'is' macro to catch unexpected exceptions.\n You don't call this.","library-url":"https://github.com/clojure/clojure","href":"/clojure.test/try-expr"},{"added":"1.1","ns":"clojure.test","name":"successful?","file":"clojure/test.clj","type":"function","column":1,"see-alsos":null,"line":789,"examples":null,"notes":null,"arglists":["summary"],"doc":"Returns true if the given test summary indicates all tests\n were successful, false otherwise.","library-url":"https://github.com/clojure/clojure","href":"/clojure.test/successful_q"},{"added":"1.1","ns":"clojure.test","name":"use-fixtures","file":"clojure/test.clj","type":"var","column":1,"see-alsos":[{"created-at":1339790120000,"author":{"login":"mnicky","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/be261a601929eaf8eda9e1420b4781f9?r=PG&default=identicon"},"to-var":{"ns":"clojure.test","name":"join-fixtures","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ceb"},{"created-at":1339790135000,"author":{"login":"mnicky","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/be261a601929eaf8eda9e1420b4781f9?r=PG&default=identicon"},"to-var":{"ns":"clojure.test","name":"compose-fixtures","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cec"}],"line":670,"examples":[{"author":{"login":"benkay","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/21acd4a2c781a436afdb28fead34b76a?r=PG&default=identicon"},"editors":[{"login":"cloojure","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1ad3de25d00d953de6e8c82f554cdbf5?r=PG&default=identicon"},{"login":"cloojure","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1ad3de25d00d953de6e8c82f554cdbf5?r=PG&default=identicon"}],"body":"; See https://clojure.github.io/clojure/clojure.test-api.html for details\n\n; my-test-fixture will be passed a fn that will call all your tests \n; (e.g. test-using-db). Here you perform any required setup \n; (e.g. create-db), then call the passed function f, then perform \n; any required teardown (e.g. destroy-db).\n(defn my-test-fixture [f]\n (create-db)\n (f)\n (destroy-db))\n\n; Here we register my-test-fixture to be called once, wrapping ALL tests \n; in the namespace\n(use-fixtures :once my-test-fixture)\n \n; This is a regular test function, which is to be wrapped using my-test-fixture\n(deftest test-using-db\n (is ... \n))","created-at":1375349400000,"updated-at":1405042589000,"_id":"542692d7c026201cdc327117"},{"author":{"login":"cloojure","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1ad3de25d00d953de6e8c82f554cdbf5?r=PG&default=identicon"},"editors":[{"login":"cloojure","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1ad3de25d00d953de6e8c82f554cdbf5?r=PG&default=identicon"},{"login":"cloojure","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1ad3de25d00d953de6e8c82f554cdbf5?r=PG&default=identicon"}],"body":"; This fixture is intended to perform setup/teardown for each individual test in the namespace. Note that it assumes the :once fixture will handle creating/destroying the DB, while we only create/drop tables within the DB.\n(defn another-fixture [f]\n (create-db-table)\n (f)\n (drop-db-table))\n\n; Here we register another-fixture to wrap each test in the namespace\n(use-fixtures :each another-fixture)","created-at":1405042717000,"updated-at":1405043050000,"_id":"542692d7c026201cdc32711a"}],"notes":null,"arglists":[],"doc":"Wrap test runs in a fixture function to perform setup and\n teardown. Using a fixture-type of :each wraps every test\n individually, while :once wraps the whole run in a single function.","library-url":"https://github.com/clojure/clojure","href":"/clojure.test/use-fixtures"},{"added":"1.1","ns":"clojure.test","name":"inc-report-counter","file":"clojure/test.clj","type":"function","column":1,"see-alsos":null,"line":314,"examples":null,"notes":null,"arglists":["name"],"doc":"Increments the named counter in *report-counters*, a ref to a map.\n Does nothing if *report-counters* is nil.","library-url":"https://github.com/clojure/clojure","href":"/clojure.test/inc-report-counter"},{"added":"1.1","ns":"clojure.test","name":"testing-vars-str","file":"clojure/test.clj","type":"function","column":1,"see-alsos":null,"line":294,"examples":null,"notes":null,"arglists":["m"],"doc":"Returns a string representation of the current test. Renders names\n in *testing-vars* as a list, then the source file and line of\n current assertion.","library-url":"https://github.com/clojure/clojure","href":"/clojure.test/testing-vars-str"},{"ns":"clojure.test","name":"*testing-contexts*","file":"clojure/test.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":269,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.test/*testing-contexts*"},{"added":"1.1","ns":"clojure.test","name":"test-ns","file":"clojure/test.clj","type":"function","column":1,"see-alsos":null,"line":743,"examples":null,"notes":null,"arglists":["ns"],"doc":"If the namespace defines a function named test-ns-hook, calls that.\n Otherwise, calls test-all-vars on the namespace. 'ns' is a\n namespace object or a symbol.\n\n Internally binds *report-counters* to a ref initialized to\n *initial-report-counters*. Returns the final, dereferenced state of\n *report-counters*.","library-url":"https://github.com/clojure/clojure","href":"/clojure.test/test-ns"},{"added":"1.11","ns":"clojure.test","name":"run-test","file":"clojure/test.clj","type":"macro","column":1,"see-alsos":null,"line":813,"examples":null,"macro":true,"notes":null,"arglists":["test-symbol"],"doc":"Runs a single test.\n\n Because the intent is to run a single test, there is no check for the namespace test-ns-hook.","library-url":"https://github.com/clojure/clojure","href":"/clojure.test/run-test"},{"added":"1.1","ns":"clojure.test","name":"run-tests","file":"clojure/test.clj","type":"function","column":1,"see-alsos":null,"line":768,"examples":null,"notes":null,"arglists":["","& namespaces"],"doc":"Runs all tests in the given namespaces; prints results.\n Defaults to current namespace if none given. Returns a map\n summarizing test results.","library-url":"https://github.com/clojure/clojure","href":"/clojure.test/run-tests"},{"ns":"clojure.test","name":"*testing-vars*","file":"clojure/test.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":267,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.test/*testing-vars*"},{"ns":"clojure.test","name":"*test-out*","file":"clojure/test.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":271,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.test/*test-out*"},{"ns":"clojure.test","name":"*initial-report-counters*","file":"clojure/test.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":264,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.test/*initial-report-counters*"},{"ns":"clojure.test.junit","name":"junit-report","file":"clojure/test/junit.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":142,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.test.junit/junit-report"},{"ns":"clojure.test.junit","name":"start-case","file":"clojure/test/junit.clj","type":"function","column":1,"see-alsos":null,"line":89,"examples":null,"notes":null,"arglists":["name classname"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.test.junit/start-case"},{"ns":"clojure.test.junit","name":"suite-attrs","file":"clojure/test/junit.clj","type":"function","column":1,"see-alsos":null,"line":97,"examples":null,"notes":null,"arglists":["package classname"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.test.junit/suite-attrs"},{"ns":"clojure.test.junit","name":"start-suite","file":"clojure/test/junit.clj","type":"function","column":1,"see-alsos":null,"line":104,"examples":null,"notes":null,"arglists":["name"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.test.junit/start-suite"},{"ns":"clojure.test.junit","name":"indent","file":"clojure/test/junit.clj","type":"function","column":1,"see-alsos":null,"line":51,"examples":null,"notes":null,"arglists":[""],"library-url":"https://github.com/clojure/clojure","href":"/clojure.test.junit/indent"},{"ns":"clojure.test.junit","name":"finish-suite","file":"clojure/test/junit.clj","type":"function","column":1,"see-alsos":null,"line":109,"examples":null,"notes":null,"arglists":[""],"library-url":"https://github.com/clojure/clojure","href":"/clojure.test.junit/finish-suite"},{"ns":"clojure.test.junit","name":"finish-element","file":"clojure/test/junit.clj","type":"function","column":1,"see-alsos":null,"line":70,"examples":null,"notes":null,"arglists":["tag pretty"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.test.junit/finish-element"},{"ns":"clojure.test.junit","name":"failure-el","file":"clojure/test/junit.clj","type":"function","column":1,"see-alsos":null,"line":128,"examples":null,"notes":null,"arglists":["message expected actual"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.test.junit/failure-el"},{"ns":"clojure.test.junit","name":"message-el","file":"clojure/test/junit.clj","type":"function","column":1,"see-alsos":null,"line":113,"examples":null,"notes":null,"arglists":["tag message expected-str actual-str"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.test.junit/message-el"},{"ns":"clojure.test.junit","name":"*depth*","file":"clojure/test/junit.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":49,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.test.junit/*depth*"},{"ns":"clojure.test.junit","name":"*var-context*","file":"clojure/test/junit.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":48,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.test.junit/*var-context*"},{"added":"1.1","ns":"clojure.test.junit","name":"with-junit-output","file":"clojure/test/junit.clj","type":"macro","column":1,"see-alsos":null,"line":182,"examples":null,"macro":true,"notes":null,"arglists":["& body"],"doc":"Execute body with modified test-is reporting functions that write\n JUnit-compatible XML output.","library-url":"https://github.com/clojure/clojure","href":"/clojure.test.junit/with-junit-output"},{"ns":"clojure.test.junit","name":"start-element","file":"clojure/test/junit.clj","type":"function","column":1,"see-alsos":null,"line":55,"examples":null,"notes":null,"arglists":["tag pretty & [attrs]"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.test.junit/start-element"},{"ns":"clojure.test.junit","name":"package-class","file":"clojure/test/junit.clj","type":"function","column":1,"see-alsos":null,"line":82,"examples":null,"notes":null,"arglists":["name"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.test.junit/package-class"},{"ns":"clojure.test.junit","name":"element-content","file":"clojure/test/junit.clj","type":"function","column":1,"see-alsos":null,"line":66,"examples":null,"notes":null,"arglists":["content"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.test.junit/element-content"},{"ns":"clojure.test.junit","name":"finish-case","file":"clojure/test/junit.clj","type":"function","column":1,"see-alsos":null,"line":93,"examples":null,"notes":null,"arglists":[""],"library-url":"https://github.com/clojure/clojure","href":"/clojure.test.junit/finish-case"},{"ns":"clojure.test.junit","name":"error-el","file":"clojure/test/junit.clj","type":"function","column":1,"see-alsos":null,"line":132,"examples":null,"notes":null,"arglists":["message expected actual"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.test.junit/error-el"},{"ns":"clojure.test.junit","name":"test-name","file":"clojure/test/junit.clj","type":"function","column":1,"see-alsos":null,"line":77,"examples":null,"notes":null,"arglists":["vars"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.test.junit/test-name"},{"added":"1.1","ns":"clojure.test.tap","name":"print-tap-fail","file":"clojure/test/tap.clj","type":"function","column":1,"see-alsos":null,"line":65,"examples":null,"notes":null,"arglists":["msg"],"doc":"Prints a TAP 'not ok' line. msg is a string, with no line breaks","library-url":"https://github.com/clojure/clojure","href":"/clojure.test.tap/print-tap-fail"},{"added":"1.1","ns":"clojure.test.tap","name":"print-tap-pass","file":"clojure/test/tap.clj","type":"function","column":1,"see-alsos":null,"line":59,"examples":null,"notes":null,"arglists":["msg"],"doc":"Prints a TAP 'ok' line. msg is a string, with no line breaks","library-url":"https://github.com/clojure/clojure","href":"/clojure.test.tap/print-tap-pass"},{"ns":"clojure.test.tap","name":"print-diagnostics","file":"clojure/test/tap.clj","type":"function","column":1,"see-alsos":null,"line":78,"examples":null,"notes":null,"arglists":["data"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.test.tap/print-diagnostics"},{"added":"1.1","ns":"clojure.test.tap","name":"print-tap-plan","file":"clojure/test/tap.clj","type":"function","column":1,"see-alsos":null,"line":45,"examples":null,"notes":null,"arglists":["n"],"doc":"Prints a TAP plan line like '1..n'. n is the number of tests","library-url":"https://github.com/clojure/clojure","href":"/clojure.test.tap/print-tap-plan"},{"added":"1.1","ns":"clojure.test.tap","name":"with-tap-output","file":"clojure/test/tap.clj","type":"macro","column":1,"see-alsos":null,"line":117,"examples":null,"macro":true,"notes":null,"arglists":["& body"],"doc":"Execute body with modified test reporting functions that produce\n TAP output","library-url":"https://github.com/clojure/clojure","href":"/clojure.test.tap/with-tap-output"},{"ns":"clojure.test.tap","name":"tap-report","file":"clojure/test/tap.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":72,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.test.tap/tap-report"},{"added":"1.1","ns":"clojure.test.tap","name":"print-tap-diagnostic","file":"clojure/test/tap.clj","type":"function","column":1,"see-alsos":null,"line":51,"examples":null,"notes":null,"arglists":["data"],"doc":"Prints a TAP diagnostic line. data is a (possibly multi-line)\n string.","library-url":"https://github.com/clojure/clojure","href":"/clojure.test.tap/print-tap-diagnostic"},{"added":"1.12","ns":"clojure.tools.deps.interop","name":"invoke-tool","file":"clojure/tools/deps/interop.clj","type":"function","column":1,"see-alsos":null,"dynamic":true,"line":41,"examples":null,"notes":null,"arglists":["{:keys [tool-name tool-alias fn args preserve-envelope], :or {preserve-envelope false}, :as opts}"],"doc":"Invoke tool using Clojure CLI. Args (one of :tool-alias or :tool-name, and :fn\n are required):\n :tool-alias - Tool alias to invoke (keyword)\n :tool-name - Name of installed tool to invoke (string or symbol)\n :fn - Function (symbol)\n :args - map of args to pass to function\n\n Options:\n :preserve-envelope - if true, return the full invocation envelope, default=false","library-url":"https://github.com/clojure/clojure","href":"/clojure.tools.deps.interop/invoke-tool"},{"added":"1.1","ns":"clojure.walk","name":"postwalk","file":"clojure/walk.clj","type":"function","column":1,"see-alsos":[{"created-at":1321428795000,"author":{"login":"srid","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bd3a68d670372cd09876c26270a4299a?r=PG&default=identicon"},"to-var":{"ns":"clojure.walk","name":"prewalk","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521db9"},{"created-at":1348453793000,"author":{"login":"dansalmo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e33ee460f5f61bc5ba9b598934766215?r=PG&default=identicon"},"to-var":{"ns":"clojure.walk","name":"postwalk-demo","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dba"},{"created-at":1348453807000,"author":{"login":"dansalmo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e33ee460f5f61bc5ba9b598934766215?r=PG&default=identicon"},"to-var":{"ns":"clojure.walk","name":"postwalk-replace","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dbb"}],"line":53,"examples":[{"author":{"login":"sunil.nandihalli","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3b7fcae9384271fb8ca8cd0c612bebf3?r=PG&default=identicon"},"editors":[],"body":"(use 'clojure.walk)\n(let [counter (atom -1)]\n (postwalk (fn [x]\n [(swap! counter inc) x])\n {:a 1 :b 2}))\n\n=\u003E [6 {2 [[0 :a] [1 1]], 5 [[3 :b] [4 2]]}] ","created-at":1287073344000,"updated-at":1287073344000,"_id":"542692d1c026201cdc326f2b"},{"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"editors":[{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"}],"body":";;example of removing namespaces from all keys in a nested data structure\n(def thing {:page/tags [{:tag/category \"lslsls\"}]})\n(postwalk #(if(keyword? %)(keyword (name %)) %) thing)\n{:tags [{:category \"lslsls\"}]}","created-at":1359706452000,"updated-at":1359706541000,"_id":"542692d7c026201cdc327122"}],"notes":null,"arglists":["f form"],"doc":"Performs a depth-first, post-order traversal of form. Calls f on\n each sub-form, uses f's return value in place of the original.\n Recognizes all Clojure data structures. Consumes seqs as with doall.","library-url":"https://github.com/clojure/clojure","href":"/clojure.walk/postwalk"},{"added":"1.1","ns":"clojure.walk","name":"keywordize-keys","file":"clojure/walk.clj","type":"function","column":1,"see-alsos":null,"line":94,"examples":[{"author":{"login":"sunil.nandihalli","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3b7fcae9384271fb8ca8cd0c612bebf3?r=PG&default=identicon"},"editors":[],"body":"(clojure.walk/keywordize-keys {\"a\" 1 \"b\" 2}) =\u003E {:a 1 :b 2}","created-at":1287070176000,"updated-at":1287070176000,"_id":"542692d1c026201cdc326f2a"}],"notes":null,"arglists":["m"],"doc":"Recursively transforms all map keys from strings to keywords.","library-url":"https://github.com/clojure/clojure","href":"/clojure.walk/keywordize-keys"},{"added":"1.1","ns":"clojure.walk","name":"walk","file":"clojure/walk.clj","type":"function","column":1,"see-alsos":[{"created-at":1337310249000,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.walk","name":"postwalk","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d11"},{"created-at":1337310268000,"author":{"login":"abrooks","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/69976?v=2"},"to-var":{"ns":"clojure.walk","name":"prewalk","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d12"}],"line":35,"examples":[{"author":{"login":"jjcomer","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ef581bba2f97adb539c67a35465b3e1b?r=PG&default=identicon"},"editors":[],"body":"(use 'clojure.walk)\n\nuser=\u003E (walk #(* 2 %) #(apply + %) [1 2 3 4 5])\n30\n\nuser=\u003E (walk second #(apply max %) [ [1 2] [3 4] [5 6] ])\n6\n\nuser=\u003E (walk first #(apply max %) [ [1 2] [3 4] [5 6] ])\n5\n\nuser=\u003E (walk first reverse [ [1 2] [3 4] [5 6] ])\n(5 3 1)","created-at":1330654697000,"updated-at":1330654697000,"_id":"542692d7c026201cdc327133"},{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"}],"body":"(require '[clojure.walk :as w])\n\nuser=\u003E (w/walk (fn [[k v]] [k (* 10 v)]) identity {:a 1 :b 2 :c 3})\n{:a 10, :c 30, :b 20}\n\nuser=\u003E (w/postwalk #(if (number? %) (* 2 %) %) [[1 2 3] [4 7 2] [2 5 2]])\n[[2 4 6] [8 14 4] [4 10 4]]\n\nuser=\u003E (let [s [1 '(2 3 [1])]] \n (w/postwalk #(if (seq? %) (vec %) %) s))\n[1 [2 3 [1]]]\n\nuser=\u003E (w/walk (comp vec reverse) identity {0 :start 1 :inprogress 2 :end})\n{:start 0, :inprogress 1, :end 2}","created-at":1335333358000,"updated-at":1335333739000,"_id":"542692d7c026201cdc327134"}],"notes":null,"arglists":["inner outer form"],"doc":"Traverses form, an arbitrary data structure. inner and outer are\n functions. Applies inner to each element of form, building up a\n data structure of the same type, then applies outer to the result.\n Recognizes all Clojure data structures. Consumes seqs as with doall.","library-url":"https://github.com/clojure/clojure","href":"/clojure.walk/walk"},{"added":"1.1","ns":"clojure.walk","name":"prewalk-replace","file":"clojure/walk.clj","type":"function","column":1,"see-alsos":[{"created-at":1281619206000,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.walk","name":"postwalk-replace","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521df9"},{"created-at":1281619213000,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.core","name":"replace","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dfa"},{"created-at":1348453766000,"author":{"login":"dansalmo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e33ee460f5f61bc5ba9b598934766215?r=PG&default=identicon"},"to-var":{"ns":"clojure.walk","name":"prewalk","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521dfb"}],"line":110,"examples":[{"author":{"login":"Chouser","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7a0192050ed6488670acfd3f59405c10?r=PG&default=identicon"},"editors":[{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"}],"body":"user=\u003E (clojure.walk/prewalk-replace '{a b} '(c (d a)))\n(c (d b))","created-at":1281563651000,"updated-at":1332953005000,"_id":"542692d1c026201cdc326f2c"},{"author":{"login":"philos99","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1de5617efb013ca7c9cf8e5646818ffa?r=PG&default=identicon"},"editors":[],"body":"(use 'clojure.walk)\n\n(prewalk-replace {:a 1 :b 2} [:a :b])\n;=\u003E [1 2]\n\n(prewalk-replace {:a 1 :b 2} [:a :b :c])\n;=\u003E [1 2 :c]\n\n(prewalk-replace {:a 1 :b 2} [:a :b [:a :b] :c])\n;=\u003E [1 2 [1 2] :c]","created-at":1397943558000,"updated-at":1397943558000,"_id":"542692d7c026201cdc32712f"}],"notes":null,"arglists":["smap form"],"doc":"Recursively transforms form by replacing keys in smap with their\n values. Like clojure/replace but works on any data structure. Does\n replacement at the root of the tree first.","library-url":"https://github.com/clojure/clojure","href":"/clojure.walk/prewalk-replace"},{"added":"1.1","ns":"clojure.walk","name":"stringify-keys","file":"clojure/walk.clj","type":"function","column":1,"see-alsos":null,"line":102,"examples":[{"author":{"login":"philos99","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1de5617efb013ca7c9cf8e5646818ffa?r=PG&default=identicon"},"editors":[{"login":"philos99","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1de5617efb013ca7c9cf8e5646818ffa?r=PG&default=identicon"},{"login":"philos99","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1de5617efb013ca7c9cf8e5646818ffa?r=PG&default=identicon"}],"body":"(use 'clojure.walk)\n\n(stringify-keys {:a 1 :b 2})\n;=\u003E {\"a\" 1, \"b\" 2}","created-at":1397941537000,"updated-at":1397943447000,"_id":"542692d7c026201cdc327130"}],"notes":null,"arglists":["m"],"doc":"Recursively transforms all map keys from keywords to strings.","library-url":"https://github.com/clojure/clojure","href":"/clojure.walk/stringify-keys"},{"added":"1.1","ns":"clojure.walk","name":"prewalk","file":"clojure/walk.clj","type":"function","column":1,"see-alsos":[{"created-at":1321428775000,"author":{"login":"srid","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bd3a68d670372cd09876c26270a4299a?r=PG&default=identicon"},"to-var":{"ns":"clojure.walk","name":"postwalk","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c84"},{"created-at":1348453563000,"author":{"login":"dansalmo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e33ee460f5f61bc5ba9b598934766215?r=PG&default=identicon"},"to-var":{"ns":"clojure.walk","name":"prewalk-demo","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c85"},{"created-at":1348453577000,"author":{"login":"dansalmo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e33ee460f5f61bc5ba9b598934766215?r=PG&default=identicon"},"to-var":{"ns":"clojure.walk","name":"prewalk-replace","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c86"}],"line":61,"examples":[{"author":{"login":"srid","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bd3a68d670372cd09876c26270a4299a?r=PG&default=identicon"},"editors":[],"body":";; From http://stackoverflow.com/questions/8089074/idiomatically-iterating-over-a-2-or-higher-dimensional-sequence-in-clojure/8091544#8091544\n\n(def matrix [[1 2 3]\n [4 5 6]\n [7 8 9]])\n(use 'clojure.walk :only [prewalk])\n\n(prewalk #(if (number? %) (inc %) %) matrix)\n=\u003E [[2 3 4] [5 6 7] [8 9 10]]","created-at":1321428749000,"updated-at":1321428749000,"_id":"542692d7c026201cdc32712a"}],"notes":null,"arglists":["f form"],"doc":"Like postwalk, but does pre-order traversal.","library-url":"https://github.com/clojure/clojure","href":"/clojure.walk/prewalk"},{"added":"1.1","ns":"clojure.walk","name":"postwalk-demo","file":"clojure/walk.clj","type":"function","column":1,"see-alsos":null,"line":80,"examples":[{"author":{"login":"philos99","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1de5617efb013ca7c9cf8e5646818ffa?r=PG&default=identicon"},"editors":[{"login":"philos99","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1de5617efb013ca7c9cf8e5646818ffa?r=PG&default=identicon"},{"login":"philos99","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1de5617efb013ca7c9cf8e5646818ffa?r=PG&default=identicon"}],"body":"(use 'clojure.walk)\n\nuser\u003E (postwalk-demo [[1 2] [3 4 [5 6]] [7 8]])\nWalked: 1\nWalked: 2\nWalked: [1 2]\nWalked: 3\nWalked: 4\nWalked: 5\nWalked: 6\nWalked: [5 6]\nWalked: [3 4 [5 6]]\nWalked: 7\nWalked: 8\nWalked: [7 8]\nWalked: [[1 2] [3 4 [5 6]] [7 8]]\n[[1 2] [3 4 [5 6]] [7 8]]\n\nuser\u003E (postwalk-demo {:a 1 :b 2})\nWalked: :a\nWalked: 1\nWalked: [:a 1]\nWalked: :b\nWalked: 2\nWalked: [:b 2]\nWalked: {:a 1, :b 2}\n{:a 1, :b 2}","created-at":1397942586000,"updated-at":1397943097000,"_id":"542692d7c026201cdc327124"}],"notes":null,"arglists":["form"],"doc":"Demonstrates the behavior of postwalk by printing each form as it is\n walked. Returns form.","library-url":"https://github.com/clojure/clojure","href":"/clojure.walk/postwalk-demo"},{"added":"1.1","ns":"clojure.walk","name":"prewalk-demo","file":"clojure/walk.clj","type":"function","column":1,"see-alsos":[{"created-at":1348453549000,"author":{"login":"dansalmo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e33ee460f5f61bc5ba9b598934766215?r=PG&default=identicon"},"to-var":{"ns":"clojure.walk","name":"prewalk","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d48"}],"line":87,"examples":[{"author":{"login":"philos99","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1de5617efb013ca7c9cf8e5646818ffa?r=PG&default=identicon"},"editors":[{"login":"philos99","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1de5617efb013ca7c9cf8e5646818ffa?r=PG&default=identicon"},{"login":"philos99","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1de5617efb013ca7c9cf8e5646818ffa?r=PG&default=identicon"},{"login":"philos99","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1de5617efb013ca7c9cf8e5646818ffa?r=PG&default=identicon"}],"body":"(use 'clojure.walk)\n\nuser\u003E (prewalk-demo [[1 2] [3 4 [5 6]] [7 8]])\nWalked: [[1 2] [3 4 [5 6]] [7 8]]\nWalked: [1 2]\nWalked: 1\nWalked: 2\nWalked: [3 4 [5 6]]\nWalked: 3\nWalked: 4\nWalked: [5 6]\nWalked: 5\nWalked: 6\nWalked: [7 8]\nWalked: 7\nWalked: 8\n[[1 2] [3 4 [5 6]] [7 8]]\n\nuser\u003E (prewalk-demo {:a 1 :b 2})\nWalked: {:a 1, :b 2}\nWalked: [:a 1]\nWalked: :a\nWalked: 1\nWalked: [:b 2]\nWalked: :b\nWalked: 2\n{:a 1, :b 2}","created-at":1397942432000,"updated-at":1397943044000,"_id":"542692d7c026201cdc32712b"}],"notes":null,"arglists":["form"],"doc":"Demonstrates the behavior of prewalk by printing each form as it is\n walked. Returns form.","library-url":"https://github.com/clojure/clojure","href":"/clojure.walk/prewalk-demo"},{"added":"1.1","ns":"clojure.walk","name":"macroexpand-all","file":"clojure/walk.clj","type":"function","column":1,"see-alsos":[{"created-at":1339248731000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"macroexpand-1","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521de6"},{"created-at":1339248761000,"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"macroexpand","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521de7"}],"line":126,"examples":[{"author":{"login":"Bertrand","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ffe3c3de1c74542e595f763ef71f2aa8?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (use 'clojure.walk)\nuser=\u003E (macroexpand-all '(-\u003E c (+ 3) (* 2)))\n(* (+ c 3) 2)","created-at":1339248698000,"updated-at":1339248698000,"_id":"542692d7c026201cdc32711d"},{"author":{"login":"Sgeo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bf4e0e4e4f0b1f703b1372a8dd7b0735?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (use 'clojure.walk)\n\n; tryclj.com and lazybot on #clojure get the following wrong\nuser=\u003E (let [-\u003E inc] (-\u003E 5)) \n6\n\n; Below macroexpansion is supposed to result in equivalent code to the above\nuser=\u003E (macroexpand-all '(let [-\u003E inc] (-\u003E 5)))\n(let* [-\u003E inc] 5)\nuser=\u003E (let* [-\u003E inc] 5)\n5\n\n; However, as is clear above, it does not","created-at":1355181392000,"updated-at":1355181392000,"_id":"542692d7c026201cdc32711e"},{"author":{"login":"philos99","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1de5617efb013ca7c9cf8e5646818ffa?r=PG&default=identicon"},"editors":[{"login":"philos99","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1de5617efb013ca7c9cf8e5646818ffa?r=PG&default=identicon"},{"login":"philos99","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1de5617efb013ca7c9cf8e5646818ffa?r=PG&default=identicon"}],"body":";; differences between macroexpand-1, macroexpand and macroexpand-all \n\n(require '[clojure.pprint :as pp]\n '[clojure.walk :as walk])\n\n(alter-var-root #'pp/*print-suppress-namespaces* (constantly true))\n\n\n(defmacro plus [n1 n2]\n `(+ ~n1 ~n2))\n\n(pp/pprint (macroexpand-1 '(plus 3 4))) ;=\u003E (+ 3 4)\n(pp/pprint (macroexpand '(plus 3 4))) ;=\u003E (+ 3 4)\n\n\n(defmacro pl [p1 p2]\n `(plus ~p1 ~p2))\n\n(pp/pprint (macroexpand-1 '(pl 3 4))) ;=\u003E (plus 3 4)\n(pp/pprint (macroexpand '(pl 3 4))) ;=\u003E (+ 3 4)\n\n\n(defmacro minus [m1 m2]\n `(- ~m1 ~m2))\n\n(defmacro calc [c1 c2]\n `(pl ~c1 (minus ~c1 ~c2)))\n\n(pp/pprint (macroexpand-1 '(calc 20 30)))\n;=\u003E (pl 20 (minus 20 30))\n\n(pp/pprint (macroexpand '(calc 20 30)))\n;=\u003E (+ 20 (minus 20 30))\n\n(pp/pprint (walk/macroexpand-all '(calc 20 30)))\n;=\u003E (+ 20 (- 20 30))","created-at":1397943977000,"updated-at":1397944114000,"_id":"542692d7c026201cdc32711f"}],"notes":[{"updated-at":1351086771000,"body":"DO NOT USE THIS FUNCTION, it doesn't handle special forms at all, and, as such, does not in fact expand into the ultimate macroexpansion of the form.\r\n\r\nFor example,\r\n\u003Cpre\u003E(require '[clojure.walk :as walk])\r\n(println (walk/macroexpand-all '(quote (let [a 1] a))))\r\n\u003C/pre\u003E\r\nWill print\r\n\u003Cpre\u003E(quote (let* [a 1] a))\r\n\u003C/pre\u003E\r\nWhen the correct answer is\r\n\u003Cpre\u003E(quote (let [a 1] a))\r\n\u003C/pre\u003E\r\nShowing an utter unawareness of proper handling of special forms\r\n\r\nDO NOT USE THIS FUNCTION","created-at":1351086666000,"author":{"login":"Sgeo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bf4e0e4e4f0b1f703b1372a8dd7b0735?r=PG&default=identicon"},"_id":"542692edf6e94c6970521ff0"},{"updated-at":1354211038000,"body":"@Sgeo - `let` is just a macro for `let*`:\r\n\r\n (clojure.repl/source let) =\u003E\r\n\r\n (defmacro let\r\n \"binding =\u003E binding-form init-expr\r\n\r\n Evaluates the exprs in a lexical context in which the symbols in\r\n the binding-forms are bound to their respective init-exprs or parts\r\n therein.\"\r\n {:added \"1.0\", :special-form true, :forms '[(let [bindings*] exprs*)]}\r\n [bindings & body]\r\n (assert-args let\r\n (vector? bindings) \"a vector for its binding\"\r\n (even? (count bindings)) \"an even number of forms in binding vector\")\r\n `(let* ~(destructure bindings) ~@body))","created-at":1354211038000,"author":{"login":"Cubic","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/b6678a430a805dd78366d6e135b49f2d?r=PG&default=identicon"},"_id":"542692edf6e94c6970521ff6"},{"updated-at":1354485217000,"body":"(quote (let [a 1] a)) is '(let [a 1] a) which evaluates to a list containing the symbol let, a vector [a 1], and a symbol a. In this context, the (let [a 1] a) is not code, but mere data, and as such, should not be macroexpanded at all, anymore than a string like \"(-> a b c)\" should be macroexpanded into \"(c (b a))\" (and yes, I know that's not the exact macroexpansion).","created-at":1354484499000,"author":{"login":"Sgeo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bf4e0e4e4f0b1f703b1372a8dd7b0735?r=PG&default=identicon"},"_id":"542692edf6e94c6970521ff7"}],"arglists":["form"],"doc":"Recursively performs all possible macroexpansions in form.","library-url":"https://github.com/clojure/clojure","href":"/clojure.walk/macroexpand-all"},{"added":"1.1","ns":"clojure.walk","name":"postwalk-replace","file":"clojure/walk.clj","type":"function","column":1,"see-alsos":[{"created-at":1281619231000,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.walk","name":"prewalk-replace","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c82"},{"created-at":1281619236000,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"to-var":{"ns":"clojure.core","name":"replace","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c83"}],"line":118,"examples":[{"author":{"login":"philos99","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1de5617efb013ca7c9cf8e5646818ffa?r=PG&default=identicon"},"editors":[{"login":"philos99","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1de5617efb013ca7c9cf8e5646818ffa?r=PG&default=identicon"},{"login":"philos99","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/1de5617efb013ca7c9cf8e5646818ffa?r=PG&default=identicon"}],"body":"(use 'clojure.walk)\n\n(postwalk-replace {:a 1 :b 2} [:a :b])\n;=\u003E [1 2]\n\n(postwalk-replace {:a 1 :b 2} [:a :b :c])\n;=\u003E [1 2 :c]\n\n(postwalk-replace {:a 1 :b 2} [:a :b [:a :b] :c])\n;=\u003E [1 2 [1 2] :c]","created-at":1397943421000,"updated-at":1397943663000,"_id":"542692d7c026201cdc327127"}],"notes":null,"arglists":["smap form"],"doc":"Recursively transforms form by replacing keys in smap with their\n values. Like clojure/replace but works on any data structure. Does\n replacement at the leaves of the tree first.","library-url":"https://github.com/clojure/clojure","href":"/clojure.walk/postwalk-replace"},{"ns":"clojure.xml","name":"tag","file":"clojure/xml.clj","type":"var","column":1,"see-alsos":null,"line":22,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.xml/tag"},{"added":"1.11","ns":"clojure.xml","name":"sax-parser","file":"clojure/xml.clj","type":"function","column":1,"see-alsos":null,"line":75,"examples":null,"notes":null,"arglists":[""],"doc":"Create a new SAXParser","library-url":"https://github.com/clojure/clojure","href":"/clojure.xml/sax-parser"},{"ns":"clojure.xml","name":"*sb*","file":"clojure/xml.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":18,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.xml/*sb*"},{"ns":"clojure.xml","name":"*state*","file":"clojure/xml.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":17,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.xml/*state*"},{"ns":"clojure.xml","name":"*stack*","file":"clojure/xml.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":15,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.xml/*stack*"},{"ns":"clojure.xml","name":"element","file":"clojure/xml.clj","type":"var","column":1,"see-alsos":[{"created-at":1324592891000,"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"to-var":{"ns":"clojure.xml","name":"emit-element","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ec8"},{"created-at":1324592934000,"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"struct","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ec9"},{"created-at":1324592937000,"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"struct-map","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521eca"},{"created-at":1324592944000,"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"to-var":{"ns":"clojure.xml","name":"parse","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ecb"},{"created-at":1324593203000,"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"with-out-str","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ecc"}],"line":20,"examples":[{"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"editors":[{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"}],"body":"(use 'clojure.zip)\n\n;;using our old friend struct for performance in maps \n(struct element :httplink {:href \"http://clojure.org\"} nil)\n=\u003E\n{:tag :httplink, \n :attrs {:href \"http://clojure.org\"}, \n :content nil}\n\n;;these elements can be output to ordinary xml strings with emit-element\n(emit-element (struct element :httplink {:href \"http://clojure.org\"} nil))\n=\u003E\n\u003Chttplink href='http://clojure.org'/\u003E\n;;this is printed - can be catched with macro with-out-str\n\n;;make hierarchies:\n(struct element :parent {:name \"Barbara\"} \n [(struct element :children {:name \"Gina\"} nil) \n (struct element :children {:name \"John\"} nil)])\n=\u003E\n{:tag :parent, :attrs {:name \"Barbara\"}, :content \n [{:tag :children, :attrs {:name \"Gina\"}, :content nil} \n {:tag :children, :attrs {:name \"John\"}, :content nil}]}\n\n;;which can be emit-elemented as well\n\n(emit-element {:tag :parent, :attrs {:name \"Barbara\"}, :content [{:tag :children, :attrs {:name \"Gina\"}, :content nil} {:tag :children, :attrs {:name \"John\"}, :content nil}]})\n=\u003E\n\u003Cparent name='Barbara'\u003E\n \u003Cchildren name='Gina'/\u003E\n \u003Cchildren name='John'/\u003E\n\u003C/parent\u003E","created-at":1324592984000,"updated-at":1324593242000,"_id":"542692d7c026201cdc327136"}],"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.xml/element"},{"ns":"clojure.xml","name":"*current*","file":"clojure/xml.clj","type":"var","column":1,"see-alsos":null,"dynamic":true,"line":16,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.xml/*current*"},{"ns":"clojure.xml","name":"content","file":"clojure/xml.clj","type":"var","column":1,"see-alsos":null,"line":24,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.xml/content"},{"ns":"clojure.xml","name":"content-handler","file":"clojure/xml.clj","type":"var","column":1,"see-alsos":null,"line":26,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.xml/content-handler"},{"added":"1.11","ns":"clojure.xml","name":"disable-external-entities","file":"clojure/xml.clj","type":"function","column":1,"see-alsos":null,"line":81,"examples":null,"notes":null,"arglists":["parser"],"doc":"Modifies a SAXParser to disable external entity resolution to prevent XXE attacks","library-url":"https://github.com/clojure/clojure","href":"/clojure.xml/disable-external-entities"},{"added":"1.0","ns":"clojure.xml","name":"parse","file":"clojure/xml.clj","type":"function","column":1,"see-alsos":[{"created-at":1324593911000,"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"to-var":{"ns":"clojure.xml","name":"emit-element","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cf3"},{"created-at":1324593914000,"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"with-out-str","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cf4"},{"created-at":1324593922000,"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"to-var":{"ns":"clojure.xml","name":"element","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cf5"}],"line":106,"examples":[{"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"editors":[{"login":"balamkej","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/9a562ca6891212ffed05e29cc69c9124?r=PG&default=identicon"},{"login":"Lowgain","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/6f4c4cb023ca9033b53a6a517ed89153?r=PG&default=identicon"},{"login":"rafmagana","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/40bd727b22d74930f292b63d45a71b07?r=PG&default=identicon"}],"body":"(require '[clojure.xml :as xml]\n '[clojure.zip :as zip])\n\n;;convenience function, first seen at nakkaya.com later in clj.zip src\n(defn zip-str [s]\n (zip/xml-zip \n (xml/parse (java.io.ByteArrayInputStream. (.getBytes s)))\n )\n)\n\n;;parse from xml-strings to internal xml representation\nuser=\u003E (zip-str \"\u003Ca href='nakkaya.com'/\u003E\")\n[{:tag :a, :attrs {:href \"nakkaya.com\"}, :content nil} nil]\n\n;;root can be rendered with xml/emit-element\nuser=\u003E (xml/emit-element (zip/root [{:tag :a, :attrs {:href \"nakkaya.com\"}, :content nil} nil]))\n\u003Ca href='nakkaya.com'/\u003E\n\n;;printed (to assure it's not lazy and for performance), can be caught to string variable with with-out-str","created-at":1324593962000,"updated-at":1406076162000,"_id":"542692d7c026201cdc32713c"}],"notes":null,"arglists":["s","s startparse"],"doc":"Parses and loads the source s, which can be a File, InputStream or\n String naming a URI. Returns a tree of the xml/element struct-map,\n which has the keys :tag, :attrs, and :content. and accessor fns tag,\n attrs, and content. Other parsers can be supplied by passing\n startparse, a fn taking a source and a ContentHandler and returning\n a parser.\n\n Prior to 1.11, used startparse-sax by default. As of 1.11, uses\n startparse-sax-safe, which disables XXE (XML External Entity)\n processing. Pass startparse-sax to revert to prior behavior.","library-url":"https://github.com/clojure/clojure","href":"/clojure.xml/parse"},{"added":"1.0","ns":"clojure.xml","name":"startparse-sax","file":"clojure/xml.clj","type":"function","column":1,"see-alsos":null,"line":92,"examples":null,"notes":null,"arglists":["s ch"],"doc":"A startparse function suitable for use with clojure.xml/parse.\n Note that this function is open to XXE entity attacks, see startparse-sax-safe.","library-url":"https://github.com/clojure/clojure","href":"/clojure.xml/startparse-sax"},{"ns":"clojure.xml","name":"emit","file":"clojure/xml.clj","type":"function","column":1,"see-alsos":[{"created-at":1323923286000,"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"with-out-str","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e6f"}],"line":143,"examples":null,"notes":[{"updated-at":1325286942000,"body":"this one have a problem when trying to export xml with string containing & etc (should be escaped). Contribs prxml has this functionality.","created-at":1325286942000,"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fd5"},{"updated-at":1328074886000,"body":"A 1.3 compatible version of prxml can be found here:\r\n\r\nhttps://github.com/weissjeffm/clojure.prxml","created-at":1328074886000,"author":{"login":"gstamp","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/cd4185cdca53ccdc11cd24ebc0cfb46d?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fd8"}],"arglists":["x"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.xml/emit"},{"added":"1.11","ns":"clojure.xml","name":"startparse-sax-safe","file":"clojure/xml.clj","type":"function","column":1,"see-alsos":null,"line":99,"examples":null,"notes":null,"arglists":["s ch"],"doc":"A startparse function suitable for use with clojure.xml/parse.\n External entity resolution is disabled to prevent XXE entity attacks.","library-url":"https://github.com/clojure/clojure","href":"/clojure.xml/startparse-sax-safe"},{"ns":"clojure.xml","name":"attrs","file":"clojure/xml.clj","type":"var","column":1,"see-alsos":null,"line":23,"examples":null,"notes":null,"arglists":[],"library-url":"https://github.com/clojure/clojure","href":"/clojure.xml/attrs"},{"ns":"clojure.xml","name":"emit-element","file":"clojure/xml.clj","type":"function","column":1,"see-alsos":[{"created-at":1323923092000,"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"to-var":{"ns":"clojure.core","name":"with-out-str","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ed5"},{"created-at":1324592254000,"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"to-var":{"ns":"clojure.xml","name":"element","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ed6"}],"line":127,"examples":[{"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"editors":[{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"}],"body":"(use 'clojure.xml)\n\n;;If just a string it's text inside or something. just print it\n(emit-element \"hello\")\nhello\n\n;;we want a map with a tag\n(emit-element {:tag :hello})\n\u003Chello/\u003E\n\n;;strings works as well (since we're using the \"name\" function)\n(emit-element {:tag \"hello\"})\n\u003Chello/\u003E\n\n;;:attrs is for all the attributes\n(emit-element {:tag :hello :attrs {:place \"world\"}})\n\u003Chello place='world'/\u003E\n\n;;:content is for all the children in the element\n(emit-element {:tag :parent :attrs {:id \"22\" :name \"fritz\"} :content [\n {:tag :child :attrs {:id \"56\"}} \n {:tag :child :attrs {:id \"57\"}]}))\n\u003Cparent id='22' name='fritz'\u003E\n\u003Cchild id='56'/\u003E\n\u003Cchild id='57'/\u003E\n\u003C/parent\u003E\n\n;;also, look out for not supplying :content with another xml-ish map:\n(emit-element {:tag :hello :content \"world\"})\n\u003Chello\u003E\njava.lang.NullPointerException (NO_SOURCE_FILE:0)\n\n;;it expects a {:tag :something}\n","created-at":1323922631000,"updated-at":1323922847000,"_id":"542692d7c026201cdc327139"}],"notes":[{"updated-at":1323923133000,"body":"you can catch the printed code with the macro \u003Cpre\u003Ewith-out-str\u003C/pre\u003E if you want to catch it in variables.","created-at":1323923133000,"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fd2"}],"arglists":["e"],"library-url":"https://github.com/clojure/clojure","href":"/clojure.xml/emit-element"},{"added":"1.0","ns":"clojure.zip","name":"rightmost","file":"clojure/zip.clj","type":"function","column":1,"see-alsos":null,"line":157,"examples":null,"notes":null,"arglists":["loc"],"doc":"Returns the loc of the rightmost sibling of the node at this loc, or self","library-url":"https://github.com/clojure/clojure","href":"/clojure.zip/rightmost"},{"added":"1.0","ns":"clojure.zip","name":"insert-child","file":"clojure/zip.clj","type":"function","column":1,"see-alsos":[{"created-at":1329432152000,"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"to-var":{"ns":"clojure.zip","name":"zipper","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521edf"},{"created-at":1357860181000,"author":{"login":"juan.facorro","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d6f59d93cc17c698f16e550034a2d1ad?r=PG&default=identicon"},"to-var":{"ns":"clojure.zip","name":"append-child","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521ee0"}],"line":216,"examples":[{"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"editors":[],"body":"(use 'clojure.zip) ;;warnings OK\n\n(def zp (zipper vector? seq (fn [_ c] c) [[1 2 3] [4 [5 6] 7] [8 9]]) )\n\n(root (insert-child (-\u003E zp down right) 42))\n=\u003E([1 2 3] (42 4 [5 6] 7) [8 9])\n\n\n(def zp2 (zipper vector? seq (fn [_ c] c) [74 75])\n\n(root (insert-right (-\u003E zp down right) zp2))\n=\u003E([1 2 3] [4 [5 6] 7] [[74 75] nil] [8 9])\n\n(root (insert-left (-\u003E zp down right) zp2))\n=\u003E([1 2 3] [[74 75] nil] [4 [5 6] 7] [8 9])\n\n\n\n","created-at":1329432685000,"updated-at":1329432685000,"_id":"542692d7c026201cdc327140"}],"notes":null,"arglists":["loc item"],"doc":"Inserts the item as the leftmost child of the node at this loc,\n without moving","library-url":"https://github.com/clojure/clojure","href":"/clojure.zip/insert-child"},{"added":"1.0","ns":"clojure.zip","name":"left","file":"clojure/zip.clj","type":"function","column":1,"see-alsos":null,"line":166,"examples":null,"notes":null,"arglists":["loc"],"doc":"Returns the loc of the left sibling of the node at this loc, or nil","library-url":"https://github.com/clojure/clojure","href":"/clojure.zip/left"},{"added":"1.0","ns":"clojure.zip","name":"path","file":"clojure/zip.clj","type":"function","column":1,"see-alsos":null,"line":90,"examples":null,"notes":null,"arglists":["loc"],"doc":"Returns a seq of nodes leading to this loc","library-url":"https://github.com/clojure/clojure","href":"/clojure.zip/path"},{"added":"1.0","ns":"clojure.zip","name":"leftmost","file":"clojure/zip.clj","type":"function","column":1,"see-alsos":null,"line":174,"examples":null,"notes":null,"arglists":["loc"],"doc":"Returns the loc of the leftmost sibling of the node at this loc, or self","library-url":"https://github.com/clojure/clojure","href":"/clojure.zip/leftmost"},{"added":"1.0","ns":"clojure.zip","name":"append-child","file":"clojure/zip.clj","type":"function","column":1,"see-alsos":null,"line":223,"examples":null,"notes":null,"arglists":["loc item"],"doc":"Inserts the item as the rightmost child of the node at this loc,\n without moving","library-url":"https://github.com/clojure/clojure","href":"/clojure.zip/append-child"},{"added":"1.0","ns":"clojure.zip","name":"branch?","file":"clojure/zip.clj","type":"function","column":1,"see-alsos":null,"line":69,"examples":null,"notes":null,"arglists":["loc"],"doc":"Returns true if the node at loc is a branch","library-url":"https://github.com/clojure/clojure","href":"/clojure.zip/branch_q"},{"added":"1.0","ns":"clojure.zip","name":"children","file":"clojure/zip.clj","type":"function","column":1,"see-alsos":null,"line":75,"examples":null,"notes":null,"arglists":["loc"],"doc":"Returns a seq of the children of node at loc, which must be a branch","library-url":"https://github.com/clojure/clojure","href":"/clojure.zip/children"},{"added":"1.0","ns":"clojure.zip","name":"remove","file":"clojure/zip.clj","type":"function","column":1,"see-alsos":null,"line":264,"examples":null,"notes":null,"arglists":["loc"],"doc":"Removes the node at loc, returning the loc that would have preceded\n it in a depth-first walk.","library-url":"https://github.com/clojure/clojure","href":"/clojure.zip/remove"},{"added":"1.0","ns":"clojure.zip","name":"down","file":"clojure/zip.clj","type":"function","column":1,"see-alsos":null,"line":109,"examples":null,"notes":null,"arglists":["loc"],"doc":"Returns the loc of the leftmost child of the node at this loc, or\n nil if no children","library-url":"https://github.com/clojure/clojure","href":"/clojure.zip/down"},{"added":"1.0","ns":"clojure.zip","name":"replace","file":"clojure/zip.clj","type":"function","column":1,"see-alsos":[{"created-at":1357860115000,"author":{"login":"juan.facorro","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d6f59d93cc17c698f16e550034a2d1ad?r=PG&default=identicon"},"to-var":{"ns":"clojure.zip","name":"edit","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521c4b"}],"line":203,"examples":[{"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"editors":[],"body":"(use 'clojure.zip)\n\n(def vz (vector-zip [1 2 [73 88] 4]))\n\n(root (replace (-\u003E vz down right right) 3))\n=\u003E[1 2 3 4]","created-at":1329434106000,"updated-at":1329434106000,"_id":"542692d7c026201cdc327142"}],"notes":null,"arglists":["loc node"],"doc":"Replaces the node at this loc, without moving","library-url":"https://github.com/clojure/clojure","href":"/clojure.zip/replace"},{"added":"1.0","ns":"clojure.zip","name":"zipper","file":"clojure/zip.clj","type":"function","column":1,"see-alsos":[{"created-at":1329431493000,"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"to-var":{"ns":"clojure.zip","name":"down","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d93"},{"created-at":1329431497000,"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"to-var":{"ns":"clojure.zip","name":"up","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d94"},{"created-at":1329431508000,"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"to-var":{"ns":"clojure.zip","name":"right","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d95"},{"created-at":1364881252000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.zip","name":"left","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d96"},{"created-at":1364881303000,"author":{"login":"boxie","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bfc366066e3c1beee98f3a6666728169?r=PG&default=identicon"},"to-var":{"ns":"clojure.zip","name":"children","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d97"}],"line":18,"examples":[{"author":{"login":"bhenry","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/4bc423f6653d93f9185a5cdc9f5cd84f?r=PG&default=identicon"},"editors":[{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},{"login":"elben","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/e21945030cedebfd5b4a4f04ad3843e8?r=PG&default=identicon"}],"body":";; Some clojure.zip functions will overwrite clojure.core's definitions\n(use 'clojure.zip)\n\n;; You may wish to require :as in order to avoid the above\n(require '[clojure.zip :as z])\n\n;; For the purposes of keeping the examples that follow clean,\n;; assume we have taken the former route: (use 'clojure.zip)\n\n(use 'clojure.pprint)\n(def p pprint)\n\nuser\u003E (def z [[1 2 3] [4 [5 6] 7] [8 9]])\n#'user/z\n\nuser\u003E (def zp (zipper vector? seq (fn [_ c] c) z))\n#'user/zp\n\nuser\u003E zp\n[[[1 2 3] [4 [5 6] 7] [8 9]] nil]\n\nuser=\u003E (p (-\u003E zp down))\n[[1 2 3]\n {:l [],\n :pnodes [[[1 2 3] [4 [5 6] 7] [8 9]]],\n :ppath nil,\n :r ([4 [5 6] 7] [8 9])}]\n \nuser\u003E (first (-\u003E zp down))\n[1 2 3]\n\nuser=\u003E (p (-\u003E zp down right))\n[[4 [5 6] 7]\n {:l [[1 2 3]],\n :pnodes [[[1 2 3] [4 [5 6] 7] [8 9]]],\n :ppath nil,\n :r ([8 9])}]\n\nuser\u003E (first (-\u003E zp down right))\n[4 [5 6] 7]\n\nuser=\u003E (p (-\u003E zp down right down right))\n[[5 6]\n {:l [4],\n :pnodes [[[1 2 3] [4 [5 6] 7] [8 9]] [4 [5 6] 7]],\n :ppath\n {:l [[1 2 3]],\n :pnodes [[[1 2 3] [4 [5 6] 7] [8 9]]],\n :ppath nil,\n :r ([8 9])},\n :r (7)}]\n\nuser=\u003E (p (-\u003E zp down right down right down))\n[5\n {:l [],\n :pnodes [[[1 2 3] [4 [5 6] 7] [8 9]] [4 [5 6] 7] [5 6]],\n :ppath\n {:l [4],\n :pnodes [[[1 2 3] [4 [5 6] 7] [8 9]] [4 [5 6] 7]],\n :ppath\n {:l [[1 2 3]],\n :pnodes [[[1 2 3] [4 [5 6] 7] [8 9]]],\n :ppath nil,\n :r ([8 9])},\n :r (7)},\n :r (6)}]\n\nuser=\u003E (p (-\u003E zp down right down right (replace \"hello\")))\n[\"hello\"\n {:changed? true,\n :l [4],\n :pnodes [[[1 2 3] [4 [5 6] 7] [8 9]] [4 [5 6] 7]],\n :ppath\n {:l [[1 2 3]],\n :pnodes [[[1 2 3] [4 [5 6] 7] [8 9]]],\n :ppath nil,\n :r ([8 9])},\n :r (7)}]\n\nuser=\u003E (p (-\u003E zp down right down right (replace \"hello\") up))\n[(4 \"hello\" 7)\n {:changed? true,\n :l [[1 2 3]],\n :pnodes [[[1 2 3] [4 [5 6] 7] [8 9]]],\n :ppath nil,\n :r ([8 9])}]\n\nuser=\u003E (p (-\u003E zp down right down right (replace \"hello\") up root))\n([1 2 3] (4 \"hello\" 7) [8 9])","created-at":1287950611000,"updated-at":1406155327000,"_id":"542692d1c026201cdc326f2e"}],"notes":[{"updated-at":1287977279000,"body":"For more info on zippers:\r\n\r\n* [Brian Marick](http://clojuredocs.org/profile/Brian%20Marick): [“Editing� trees in Clojure with clojure.zip](http://www.exampler.com/blog/2010/09/01/editing-trees-in-clojure-with-clojurezip/)\r\n* Alex Miller: [Zippers with records in Clojure](http://tech.puredanger.com/2010/10/22/zippers-with-records-in-clojure/)","created-at":1287977279000,"author":{"login":"zk","account-source":"github","avatar-url":"https://avatars.githubusercontent.com/u/7194?v=2"},"_id":"542692ecf6e94c6970521f9e"},{"updated-at":1333789044000,"body":"Tutorials on zippers:\r\n\r\n* Brian Marick: [\"Editing\" trees in Clojure with clojure.zip](http://www.exampler.com/blog/2010/09/01/editing-trees-in-clojure-with-clojurezip)\r\n\r\n* Alex Miller: [Zippers with records in Clojure](http://tech.puredanger.com/2010/10/22/zippers-with-records-in-clojure/)","created-at":1333787145000,"author":{"login":"jafingerhut","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/372822d16a494d1dd3eeb7da4bac4e74?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fdd"}],"arglists":["branch? children make-node root"],"doc":"Creates a new zipper structure. \n\n branch? is a fn that, given a node, returns true if can have\n children, even if it currently doesn't.\n\n children is a fn that, given a branch node, returns a seq of its\n children.\n\n make-node is a fn that, given an existing node and a seq of\n children, returns a new branch node with the supplied children.\n root is the root node.","library-url":"https://github.com/clojure/clojure","href":"/clojure.zip/zipper"},{"added":"1.0","ns":"clojure.zip","name":"end?","file":"clojure/zip.clj","type":"function","column":1,"see-alsos":null,"line":258,"examples":null,"notes":null,"arglists":["loc"],"doc":"Returns true if loc represents the end of a depth-first walk","library-url":"https://github.com/clojure/clojure","href":"/clojure.zip/end_q"},{"added":"1.0","ns":"clojure.zip","name":"edit","file":"clojure/zip.clj","type":"function","column":1,"see-alsos":null,"line":210,"examples":null,"notes":null,"arglists":["loc f & args"],"doc":"Replaces the node at this loc with the value of (f node args)","library-url":"https://github.com/clojure/clojure","href":"/clojure.zip/edit"},{"added":"1.0","ns":"clojure.zip","name":"make-node","file":"clojure/zip.clj","type":"function","column":1,"see-alsos":null,"line":83,"examples":null,"notes":null,"arglists":["loc node children"],"doc":"Returns a new branch node, given an existing node and new\n children. The loc is only used to supply the constructor.","library-url":"https://github.com/clojure/clojure","href":"/clojure.zip/make-node"},{"added":"1.0","ns":"clojure.zip","name":"vector-zip","file":"clojure/zip.clj","type":"function","column":1,"see-alsos":[{"created-at":1283300922000,"author":{"login":"Chouser","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7a0192050ed6488670acfd3f59405c10?r=PG&default=identicon"},"to-var":{"ns":"clojure.zip","name":"seq-zip","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d72"},{"created-at":1283300949000,"author":{"login":"Chouser","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7a0192050ed6488670acfd3f59405c10?r=PG&default=identicon"},"to-var":{"ns":"clojure.zip","name":"xml-zip","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d73"},{"created-at":1320037497000,"author":{"login":"Arnoldo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3a60ef262d016a9a38f5268e088ab32?r=PG&default=identicon"},"to-var":{"ns":"clojure.zip","name":"next","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d74"},{"created-at":1320037502000,"author":{"login":"Arnoldo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3a60ef262d016a9a38f5268e088ab32?r=PG&default=identicon"},"to-var":{"ns":"clojure.zip","name":"end?","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521d75"}],"line":44,"examples":[{"author":{"login":"Arnoldo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3a60ef262d016a9a38f5268e088ab32?r=PG&default=identicon"},"editors":[{"login":"Arnoldo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3a60ef262d016a9a38f5268e088ab32?r=PG&default=identicon"},{"login":"Arnoldo","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/3a60ef262d016a9a38f5268e088ab32?r=PG&default=identicon"},{"login":"Jules","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/77c985628bea3a3ff10e76cefcc929c4?r=PG&default=identicon"}],"body":"\n(require '[clojure.zip :as zip])\n\n(defn zip-map [f loc]\n \" Map f over every node of the zipper.\n The function received has the form (f node-value loc),\n the node value and its location\"\n (loop [z loc]\n (if (zip/end? z)\n (zip/root z) ; perhaps you can call zip/seq-zip or zip/vector-zip?\n (recur (zip/next (zip/edit z f z))))))\n\n;; Multiply by 100 every node in the tree\nuser=\u003E (zip-map (fn [n nx] (if (vector? n) n (* n 100) )) (zip/vector-zip '[5 [10 20 30] [1 2 3] ]))\n;; Be careful! the returned result by zip/root is not a zipper anymore!\n[500 [1000 2000 3000] [100 200 300]]\n","created-at":1320036944000,"updated-at":1373138099000,"_id":"542692d7c026201cdc327144"}],"notes":null,"arglists":["root"],"doc":"Returns a zipper for nested vectors, given a root vector","library-url":"https://github.com/clojure/clojure","href":"/clojure.zip/vector-zip"},{"added":"1.0","ns":"clojure.zip","name":"node","file":"clojure/zip.clj","type":"function","column":1,"see-alsos":null,"line":64,"examples":[{"author":{"login":"Victor","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bc41ebab54cc0e0fbe99d753876d45ce?r=PG&default=identicon"},"editors":[{"login":"Victor","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bc41ebab54cc0e0fbe99d753876d45ce?r=PG&default=identicon"},{"login":"Victor","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bc41ebab54cc0e0fbe99d753876d45ce?r=PG&default=identicon"}],"body":"user=\u003E(require '[clojure.zip :as zip])\nnil\nuser=\u003E (def original [1 '(a b c) 2])\n#'user/original\nuser=\u003E (def root-loc (zip/seq-zip (seq original)))\n#'user/root-loc\n\nuser=\u003E (zip/node (zip/down root-loc))\n1\n","created-at":1291935344000,"updated-at":1291935456000,"_id":"542692d1c026201cdc326f32"}],"notes":[{"updated-at":1291935491000,"body":"See tutorial of clojure.zip at \r\nhttp://www.exampler.com/blog/2010/09/01/editing-trees-in-clojure-with-clojurezip/","created-at":1291935491000,"author":{"login":"Victor","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/bc41ebab54cc0e0fbe99d753876d45ce?r=PG&default=identicon"},"_id":"542692ecf6e94c6970521fad"}],"arglists":["loc"],"doc":"Returns the node at loc","library-url":"https://github.com/clojure/clojure","href":"/clojure.zip/node"},{"added":"1.0","ns":"clojure.zip","name":"up","file":"clojure/zip.clj","type":"function","column":1,"see-alsos":[{"created-at":1283300764000,"author":{"login":"Chouser","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7a0192050ed6488670acfd3f59405c10?r=PG&default=identicon"},"to-var":{"ns":"clojure.zip","name":"down","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cda"},{"created-at":1283300777000,"author":{"login":"Chouser","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7a0192050ed6488670acfd3f59405c10?r=PG&default=identicon"},"to-var":{"ns":"clojure.zip","name":"left","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cdb"},{"created-at":1283300781000,"author":{"login":"Chouser","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7a0192050ed6488670acfd3f59405c10?r=PG&default=identicon"},"to-var":{"ns":"clojure.zip","name":"right","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cdc"},{"created-at":1283300826000,"author":{"login":"Chouser","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7a0192050ed6488670acfd3f59405c10?r=PG&default=identicon"},"to-var":{"ns":"clojure.zip","name":"next","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cdd"},{"created-at":1283300881000,"author":{"login":"Chouser","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7a0192050ed6488670acfd3f59405c10?r=PG&default=identicon"},"to-var":{"ns":"clojure.zip","name":"seq-zip","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521cde"}],"line":123,"examples":null,"notes":null,"arglists":["loc"],"doc":"Returns the loc of the parent of the node at this loc, or nil if at\n the top","library-url":"https://github.com/clojure/clojure","href":"/clojure.zip/up"},{"added":"1.0","ns":"clojure.zip","name":"insert-right","file":"clojure/zip.clj","type":"function","column":1,"see-alsos":null,"line":193,"examples":null,"notes":null,"arglists":["loc item"],"doc":"Inserts the item as the right sibling of the node at this loc,\n without moving","library-url":"https://github.com/clojure/clojure","href":"/clojure.zip/insert-right"},{"added":"1.0","ns":"clojure.zip","name":"rights","file":"clojure/zip.clj","type":"function","column":1,"see-alsos":null,"line":102,"examples":null,"notes":null,"arglists":["loc"],"doc":"Returns a seq of the right siblings of this loc","library-url":"https://github.com/clojure/clojure","href":"/clojure.zip/rights"},{"added":"1.0","ns":"clojure.zip","name":"root","file":"clojure/zip.clj","type":"function","column":1,"see-alsos":null,"line":137,"examples":null,"notes":null,"arglists":["loc"],"doc":"zips all the way up and returns the root node, reflecting any\n changes.","library-url":"https://github.com/clojure/clojure","href":"/clojure.zip/root"},{"added":"1.0","ns":"clojure.zip","name":"next","file":"clojure/zip.clj","type":"function","column":1,"see-alsos":null,"line":230,"examples":null,"notes":null,"arglists":["loc"],"doc":"Moves to the next loc in the hierarchy, depth-first. When reaching\n the end, returns a distinguished loc detectable via end?. If already\n at the end, stays there.","library-url":"https://github.com/clojure/clojure","href":"/clojure.zip/next"},{"added":"1.0","ns":"clojure.zip","name":"seq-zip","file":"clojure/zip.clj","type":"function","column":1,"see-alsos":[{"created-at":1283300897000,"author":{"login":"Chouser","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7a0192050ed6488670acfd3f59405c10?r=PG&default=identicon"},"to-var":{"ns":"clojure.zip","name":"xml-zip","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e84"},{"created-at":1283300907000,"author":{"login":"Chouser","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/7a0192050ed6488670acfd3f59405c10?r=PG&default=identicon"},"to-var":{"ns":"clojure.zip","name":"vector-zip","library-url":"https://github.com/clojure/clojure"},"_id":"542692ebf6e94c6970521e85"}],"line":35,"examples":[{"author":{"login":"Ljos","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/45b996a79abca465acaf6c0f10b0437?r=PG&default=identicon"},"editors":[],"body":"user=\u003E (require '[clojure.zip :as zip])\r\nnil\r\nuser=\u003E (def zz (zip/seq-zip '(a b (c d e) (f (g h) i) j)))\r\n#'user/zz\r\nuser=\u003E zz\r\n[(a b (c d e) (f (g h) i) j) nil]","created-at":1320013293000,"updated-at":1320013293000,"_id":"542692d7c026201cdc327143"}],"notes":null,"arglists":["root"],"doc":"Returns a zipper for nested sequences, given a root sequence","library-url":"https://github.com/clojure/clojure","href":"/clojure.zip/seq-zip"},{"added":"1.0","ns":"clojure.zip","name":"insert-left","file":"clojure/zip.clj","type":"function","column":1,"see-alsos":null,"line":183,"examples":null,"notes":null,"arglists":["loc item"],"doc":"Inserts the item as the left sibling of the node at this loc,\n without moving","library-url":"https://github.com/clojure/clojure","href":"/clojure.zip/insert-left"},{"added":"1.0","ns":"clojure.zip","name":"prev","file":"clojure/zip.clj","type":"function","column":1,"see-alsos":null,"line":246,"examples":null,"notes":null,"arglists":["loc"],"doc":"Moves to the previous loc in the hierarchy, depth-first. If already\n at the root, returns nil.","library-url":"https://github.com/clojure/clojure","href":"/clojure.zip/prev"},{"added":"1.0","ns":"clojure.zip","name":"right","file":"clojure/zip.clj","type":"function","column":1,"see-alsos":null,"line":149,"examples":null,"notes":null,"arglists":["loc"],"doc":"Returns the loc of the right sibling of the node at this loc, or nil","library-url":"https://github.com/clojure/clojure","href":"/clojure.zip/right"},{"added":"1.0","ns":"clojure.zip","name":"lefts","file":"clojure/zip.clj","type":"function","column":1,"see-alsos":[{"created-at":1358376302000,"author":{"login":"juan.facorro","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/d6f59d93cc17c698f16e550034a2d1ad?r=PG&default=identicon"},"to-var":{"ns":"clojure.zip","name":"rights","library-url":"https://github.com/clojure/clojure"},"_id":"542692eaf6e94c6970521b4f"}],"line":96,"examples":[{"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"editors":[],"body":"(def vz (vector-zip [1 2 3 4 5]))\n\n;; root\n;; |________\n;; | | | | |\n;; 1 2[3]4 5\n\n;;go down and then right twice, what's to the left of me now?\n(-\u003E vz down right right lefts)\n=\u003E(1 2)\n\n;;equivalent:\n(-\u003E vz down right right rights)\n=\u003E(4 5)\n\n","created-at":1329433215000,"updated-at":1329433215000,"_id":"542692d7c026201cdc327141"}],"notes":null,"arglists":["loc"],"doc":"Returns a seq of the left siblings of this loc","library-url":"https://github.com/clojure/clojure","href":"/clojure.zip/lefts"},{"added":"1.0","ns":"clojure.zip","name":"xml-zip","file":"clojure/zip.clj","type":"function","column":1,"see-alsos":null,"line":53,"examples":[{"author":{"login":"Claj","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/5fd658a8d2ef549071cb5286b1b874aa?r=PG&default=identicon"},"editors":[],"body":"(def xmlzipper (clojure.zip/xml-zip (clojure.xml/parse \"resources/somedata.xml\")))\n\n;;make a zippper pointing at the children to the topnode in somedata.xml\n(clojure.zip/children xmlzipper)\n\n \n\n\n\n\n","created-at":1323729937000,"updated-at":1323729937000,"_id":"542692d7c026201cdc327148"},{"author":{"login":"defn","account-source":"clojuredocs","avatar-url":"https://www.gravatar.com/avatar/ed8cd6f26fffbe2b783df3b12508dfd0?r=PG&default=identicon"},"editors":[],"body":"(require '[clojure.zip :as z])\n\nuser=\u003E (z/right\n (z/down\n (z/xml-zip \n {:tag :root :content [{:tag :any :content [\"foo\" \"bar\"]} \"bar\"]})))\n[\"bar\" {:l [{:content [\"foo\" \"bar\"], :tag :any}], :pnodes [{:content [{:content [\"foo\" \"bar\"], :tag :any} \"bar\"], :tag :root}], :ppath nil, :r nil}]\n\n;; The above can also be written like this:\nuser=\u003E (-\u003E\n (z/xml-zip {:tag :root :content [{:tag :any :content [\"foo\" \"bar\"]} \"bar\"]})\n z/down z/right)\n[\"bar\" {:l [{:content [\"foo\" \"bar\"], :tag :any}], :pnodes [{:content [{:content [\"foo\" \"bar\"], :tag :any} \"bar\"], :tag :root}], :ppath nil, :r nil}]","created-at":1335333199000,"updated-at":1335333199000,"_id":"542692d7c026201cdc327149"}],"notes":null,"arglists":["root"],"doc":"Returns a zipper for xml elements (as from xml/parse),\n given a root element","library-url":"https://github.com/clojure/clojure","href":"/clojure.zip/xml-zip"}]}