Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update latest ClojureDocs.org snapshot to November 25, 2012

  • Loading branch information...
commit 120cb8962c68b85575c7b58534508e02e10fef54 1 parent cf01ec8
@jafingerhut authored
Showing with 212 additions and 25 deletions.
  1. +212 −25 snapshots/clojuredocs-snapshot-latest.txt
View
237 snapshots/clojuredocs-snapshot-latest.txt
@@ -1,4 +1,4 @@
-{:snapshot-time "Thu Nov 08 12:13:00 PST 2012",
+{:snapshot-time "Sun Nov 25 12:24:34 PST 2012",
:snapshot-info
{"clojure.zip/insert-right"
{:comments [],
@@ -2620,9 +2620,9 @@
:url_friendly_name "binding",
:file "clojure/core.clj"}
{:namespace_id 330,
- :weight 2,
+ :weight 3,
:name "with-redefs",
- :updated_at "2012-10-11 23:42:34.0",
+ :updated_at "2012-11-09 06:25:12.0",
:version "1.3.0",
:created_at "2011-09-26 06:12:39.0",
:added "1.3",
@@ -4133,7 +4133,18 @@
:lib_version "1.3.0",
:library_id 15,
: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-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"}],
+ "(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-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"}
+ {:namespace_id 330,
+ :ns "clojure.core",
+ :updated_at "2012-11-09 06:25:12.0",
+ :function "with-redefs",
+ :version 1,
+ :created_at "2012-11-09 06:25:12.0",
+ :library "Clojure Core",
+ :lib_version "1.3.0",
+ :library_id 15,
+ :body
+ ";; be careful, with-redefs can permanently change a var if applied concurrently:\n\nuser> (defn ten [] 10)\n#'user/ten\nuser> (doall (pmap #(with-redefs [ten (fn [] %)] (ten)) (range 20 100)))\n...\nuser> (ten)\n79"}],
:id 5850,
:name "with-redefs",
:ns "clojure.core",
@@ -5436,7 +5447,19 @@
:line "3154",
:arglists_comp "[s]",
:url_friendly_name "load-string",
- :file "clojure/core.clj"}],
+ :file "clojure/core.clj"}
+ {:namespace_id 99,
+ :weight 0,
+ :name "*read-eval*",
+ :updated_at "2010-10-20 04:42:05.0",
+ :version "1.2.0",
+ :created_at "2010-07-14 20:21:06.0",
+ :added nil,
+ :url "http://clojuredocs.org/v/1648",
+ :line nil,
+ :arglists_comp "",
+ :url_friendly_name "*read-eval*",
+ :file nil}],
:examples
[{:namespace_id 99,
:ns "clojure.core",
@@ -7422,15 +7445,15 @@
:examples
[{:namespace_id 99,
:ns "clojure.core",
- :updated_at "2011-06-20 21:12:02.0",
+ :updated_at "2012-11-24 19:18:11.0",
:function "compare-and-set!",
- :version 1,
+ :version 2,
:created_at "2011-06-20 21:12:02.0",
:library "Clojure Core",
:lib_version "1.2.0",
:library_id 3,
:body
- "user=> (def a (atom 0))\n#'user/a\nuser=> (compare-and-set! a 10 20)\nfalse\nuser=> (compare-and-set! a 0 10)\ntrue\nuser=> @a\n10\n"}],
+ "user=> (def a (atom 0))\n#'user/a\nuser=> (compare-and-set! a 10 20)\nfalse\nuser=> @a\n0\nuser=> (compare-and-set! a 0 10)\ntrue\nuser=> @a\n10\n"}],
:id 5427,
:name "compare-and-set!",
:ns "clojure.core",
@@ -8443,7 +8466,19 @@
:url "http://clojuredocs.org/v/1364"},
"clojure.repl/source-fn"
{:comments [],
- :see-alsos [],
+ :see-alsos
+ [{:namespace_id 110,
+ :weight 1,
+ :name "source",
+ :updated_at "2010-10-20 04:42:17.0",
+ :version "1.2.0",
+ :created_at "2010-07-14 20:27:29.0",
+ :added nil,
+ :url "http://clojuredocs.org/v/2445",
+ :line "43",
+ :arglists_comp "[n]",
+ :url_friendly_name "source",
+ :file "clojure/repl.clj"}],
:examples [],
:id 5976,
:name "source-fn",
@@ -10004,9 +10039,9 @@
{:comments [],
:see-alsos
[{:namespace_id 330,
- :weight 2,
+ :weight 3,
:name "with-redefs",
- :updated_at "2012-10-11 23:42:34.0",
+ :updated_at "2012-11-09 06:25:12.0",
:version "1.3.0",
:created_at "2011-09-26 06:12:39.0",
:added "1.3",
@@ -12937,7 +12972,18 @@
:lib_version "1.2.0",
:library_id 3,
:body
- ";; The quintessential interpose example:\nuser> (def my-strings [\"one\" \"two\" \"three\"])\n\nuser> (interpose \", \" my-strings)\n=> (\"one\" \", \" \"two\" \", \" \"three\")\n\nuser> (apply str (interpose \", \" my-strings))\n=> \"one, two, three\"\n\n;; Might use clojure.string/join if the plan is to join\n(use '[clojure.string :only (join)])\nuser> (join \", \" my-strings)\n=> \"one, two, three\""}],
+ ";; The quintessential interpose example:\nuser> (def my-strings [\"one\" \"two\" \"three\"])\n\nuser> (interpose \", \" my-strings)\n=> (\"one\" \", \" \"two\" \", \" \"three\")\n\nuser> (apply str (interpose \", \" my-strings))\n=> \"one, two, three\"\n\n;; Might use clojure.string/join if the plan is to join\n(use '[clojure.string :only (join)])\nuser> (join \", \" my-strings)\n=> \"one, two, three\""}
+ {:namespace_id 330,
+ :ns "clojure.core",
+ :updated_at "2012-11-14 14:11:28.0",
+ :function "interpose",
+ :version 5,
+ :created_at "2012-11-14 14:08:37.0",
+ :library "Clojure Core",
+ :lib_version "1.3.0",
+ :library_id 15,
+ :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"}],
:id 5562,
:name "interpose",
:ns "clojure.core",
@@ -21933,6 +21979,18 @@
:line nil,
:arglists_comp "[name]",
:url_friendly_name "load-file",
+ :file nil}
+ {:namespace_id 99,
+ :weight 0,
+ :name "*read-eval*",
+ :updated_at "2010-10-20 04:42:05.0",
+ :version "1.2.0",
+ :created_at "2010-07-14 20:21:06.0",
+ :added nil,
+ :url "http://clojuredocs.org/v/1648",
+ :line nil,
+ :arglists_comp "",
+ :url_friendly_name "*read-eval*",
:file nil}],
:examples
[{:namespace_id 99,
@@ -22281,6 +22339,30 @@
:line "350",
:arglists_comp "[& keys]",
:url_friendly_name "sorted-set",
+ :file "clojure/core.clj"}
+ {:namespace_id 99,
+ :weight 1,
+ :name "sorted-map-by",
+ :updated_at "2010-10-20 04:42:08.0",
+ :version "1.2.0",
+ :created_at "2010-07-14 20:22:40.0",
+ :added nil,
+ :url "http://clojuredocs.org/v/1783",
+ :line "343",
+ :arglists_comp "[comparator & keyvals]",
+ :url_friendly_name "sorted-map-by",
+ :file "clojure/core.clj"}
+ {:namespace_id 99,
+ :weight 1,
+ :name "compare",
+ :updated_at "2011-08-17 00:13:50.0",
+ :version "1.2.0",
+ :created_at "2010-07-14 20:24:21.0",
+ :added nil,
+ :url "http://clojuredocs.org/v/1932",
+ :line "682",
+ :arglists_comp "[x y]",
+ :url_friendly_name "compare",
:file "clojure/core.clj"}],
:examples
[{:namespace_id 99,
@@ -22292,7 +22374,18 @@
:library "Clojure Core",
:lib_version "1.2.0",
:library_id 3,
- :body "user> (sorted-set-by > 3 5 8 2 1)\n#{8 5 3 2 1}"}],
+ :body "user> (sorted-set-by > 3 5 8 2 1)\n#{8 5 3 2 1}"}
+ {:namespace_id 330,
+ :ns "clojure.core",
+ :updated_at "2012-11-20 17:46:37.0",
+ :function "sorted-set-by",
+ :version 1,
+ :created_at "2012-11-20 17:46:37.0",
+ :library "Clojure Core",
+ :lib_version "1.3.0",
+ :library_id 15,
+ :body
+ ";; Be cautious about comparison functions that only compare part of\n;; the objects:\nuser=> (defn second-< [x y]\n (< (second x) (second y)))\nuser=> (sorted-set-by second-< [:a 1] [:b 1] [:c 1])\n#{[:a 1]}\n\n;; Where did the other elements go?\n\n;; Replacing < with <= might look like a fix, but doesn't work,\n;; either:\nuser=> (defn second-<= [x y]\n (<= (second x) (second y)))\nuser=> (def s2 (sorted-set-by second-<= [:a 1] [:b 1] [:c 1]))\n#'user/s2\nuser=> s2\n#{[:c 1] [:b 1] [:a 1]}\n;; So far, so good, but set membership tests can't find the elements.\nuser=> (contains? s2 [:b 1])\nfalse\nuser=> (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=> (defn second-<-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=> (def s3 (sorted-set-by second-<-with-tie-break [:a 1] [:b 1] [:c 1]))\n#'user/s3\nuser=> s3\n#{[:a 1] [:b 1] [:c 1]}\nuser=> (contains? s3 [:b 1])\ntrue\nuser=> (s3 [:c 1])\n[:c 1]\n;; All good now!"}],
:id 5766,
:name "sorted-set-by",
:ns "clojure.core",
@@ -23759,7 +23852,18 @@
"clojure.core/special-symbol?"
{:comments [],
:see-alsos [],
- :examples [],
+ :examples
+ [{:namespace_id 330,
+ :ns "clojure.core",
+ :updated_at "2012-11-24 19:52:15.0",
+ :function "special-symbol?",
+ :version 2,
+ :created_at "2012-11-24 19:49:46.0",
+ :library "Clojure Core",
+ :lib_version "1.3.0",
+ :library_id 15,
+ :body
+ "user=> (clojure-version)\n\"1.4.0\"\n;; the set of special symbols for this clojure-version are the following:\nuser=> (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=> (fn? 'def)\nfalse\nuser=> (:macro (meta (find-var 'clojure.core/def)))\nnil\nuser=> (find-var 'clojure.core/def)\nnil\nuser=> (special-symbol? 'def)\ntrue\n\n;; while \"defn\" is not a special form but a macro:\nuser=> (special-symbol? 'defn)\nfalse\nuser=> (:macro (meta (find-var 'clojure.core/defn)))\ntrue\n"}],
:id 5768,
:name "special-symbol?",
:ns "clojure.core",
@@ -27345,7 +27449,18 @@
:ns "incanter.processing",
:url "http://clojuredocs.org/v/3064"},
"clojure.core/assoc"
- {:comments [],
+ {:comments
+ [{:namespace_id 330,
+ :ns "clojure.core",
+ :updated_at "2012-11-13 11:54:12.0",
+ :user_id 652,
+ :function "assoc",
+ :version "1.3.0",
+ :created_at "2012-11-13 11:54:12.0",
+ :library "Clojure Core",
+ :library_id 15,
+ :body
+ "Here is a version that will create a vector when the key is numerical.\nThis may be useful instead of throwing an IndexOutOfBoundsException.\n\n<pre>\n(defn assoc-in-idx [m [k & ks] v]\n (let [value (get m k (when (number? (first ks)) []))\n\tm (if (and (vector? m) (number? k) (-> m count (< k)))\n\t (reduce (fn [m _] (conj m nil)) m (range (count m) k))\n\t m)\n\tv (if ks\n\t (assoc-in-idx value ks v)\n\t v)]\n (assoc m k v)))\n</pre>\n"}],
:see-alsos
[{:namespace_id 99,
:weight 1,
@@ -31011,6 +31126,18 @@
:arglists_comp
"[sc test key]|[sc start-test start-key end-test end-key]",
:url_friendly_name "rsubseq",
+ :file "clojure/core.clj"}
+ {:namespace_id 99,
+ :weight 1,
+ :name "sorted-set-by",
+ :updated_at "2010-10-20 04:42:11.0",
+ :version "1.2.0",
+ :created_at "2010-07-14 20:24:22.0",
+ :added nil,
+ :url "http://clojuredocs.org/v/1934",
+ :line "356",
+ :arglists_comp "[comparator & keys]",
+ :url_friendly_name "sorted-set-by",
:file "clojure/core.clj"}],
:examples
[{:namespace_id 99,
@@ -33030,9 +33157,9 @@
{:comments [],
:see-alsos
[{:namespace_id 330,
- :weight 2,
+ :weight 3,
:name "with-redefs",
- :updated_at "2012-10-11 23:42:34.0",
+ :updated_at "2012-11-09 06:25:12.0",
:version "1.3.0",
:created_at "2011-09-26 06:12:39.0",
:added "1.3",
@@ -33044,15 +33171,15 @@
:examples
[{:namespace_id 330,
:ns "clojure.core",
- :updated_at "2012-10-11 23:44:43.0",
+ :updated_at "2012-11-09 06:31:07.0",
:function "with-redefs-fn",
- :version 2,
+ :version 3,
:created_at "2012-10-11 23:43:50.0",
:library "Clojure Core",
:lib_version "1.3.0",
:library_id 15,
: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"}
+ "(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"}
{:namespace_id 330,
:ns "clojure.core",
:updated_at "2012-11-08 09:09:53.0",
@@ -42989,7 +43116,18 @@
"clojure.core/find-var"
{:comments [],
:see-alsos [],
- :examples [],
+ :examples
+ [{:namespace_id 330,
+ :ns "clojure.core",
+ :updated_at "2012-11-24 19:22:48.0",
+ :function "find-var",
+ :version 1,
+ :created_at "2012-11-24 19:22:48.0",
+ :library "Clojure Core",
+ :lib_version "1.3.0",
+ :library_id 15,
+ :body
+ "user=> (find-var 'map)\nIllegalArgumentException Symbol must be namespace-qualified clojure.lang.Var.find (Var.java:150)\nuser=> (find-var 'clojure.core/map)\n#'clojure.core/map\nuser=> (find-var 'clojure.core/qwerty)\nnil\n"}],
:id 5510,
:name "find-var",
:ns "clojure.core",
@@ -46340,7 +46478,44 @@
:url "http://clojuredocs.org/v/5963"},
"clojure.core/*read-eval*"
{:comments [],
- :see-alsos [],
+ :see-alsos
+ [{:namespace_id 99,
+ :weight 1,
+ :name "read",
+ :updated_at "2010-10-20 04:42:05.0",
+ :version "1.2.0",
+ :created_at "2010-07-14 20:20:57.0",
+ :added nil,
+ :url "http://clojuredocs.org/v/1635",
+ :line "2872",
+ :arglists_comp
+ "[]|[stream]|[stream eof-error? eof-value]|[stream eof-error? eof-value recursive?]",
+ :url_friendly_name "read",
+ :file "clojure/core.clj"}
+ {:namespace_id 99,
+ :weight 4,
+ :name "read-string",
+ :updated_at "2012-08-20 22:21:54.0",
+ :version "1.2.0",
+ :created_at "2010-07-14 20:21:47.0",
+ :added nil,
+ :url "http://clojuredocs.org/v/1707",
+ :line "2894",
+ :arglists_comp "[s]",
+ :url_friendly_name "read-string",
+ :file "clojure/core.clj"}
+ {:namespace_id 99,
+ :weight 1,
+ :name "load",
+ :updated_at "2011-06-12 20:39:31.0",
+ :version "1.2.0",
+ :created_at "2010-07-14 20:23:31.0",
+ :added nil,
+ :url "http://clojuredocs.org/v/1857",
+ :line "4887",
+ :arglists_comp "[& paths]",
+ :url_friendly_name "load",
+ :file "clojure/core.clj"}],
:examples
[{:namespace_id 330,
:ns "clojure.core",
@@ -48427,7 +48602,19 @@
:line "2894",
:arglists_comp "[s]",
:url_friendly_name "read-string",
- :file "clojure/core.clj"}],
+ :file "clojure/core.clj"}
+ {:namespace_id 99,
+ :weight 0,
+ :name "*read-eval*",
+ :updated_at "2010-10-20 04:42:05.0",
+ :version "1.2.0",
+ :created_at "2010-07-14 20:21:06.0",
+ :added nil,
+ :url "http://clojuredocs.org/v/1648",
+ :line nil,
+ :arglists_comp "",
+ :url_friendly_name "*read-eval*",
+ :file nil}],
:examples
[{:namespace_id 99,
:ns "clojure.core",
@@ -53071,9 +53258,9 @@
{:comments [],
:see-alsos
[{:namespace_id 330,
- :weight 2,
+ :weight 3,
:name "with-redefs",
- :updated_at "2012-10-11 23:42:34.0",
+ :updated_at "2012-11-09 06:25:12.0",
:version "1.3.0",
:created_at "2011-09-26 06:12:39.0",
:added "1.3",
Please sign in to comment.
Something went wrong with that request. Please try again.