Permalink
Browse files

Update latest ClojureDocs.org snapshot to November 8, 2012

  • Loading branch information...
1 parent bf8f63e commit cf01ec84865f521fdca8651275d251dff64bf368 @jafingerhut committed Nov 10, 2012
Showing with 150 additions and 22 deletions.
  1. +150 −22 snapshots/clojuredocs-snapshot-latest.txt
@@ -1,4 +1,4 @@
-{:snapshot-time "Fri Oct 26 22:54:17 PDT 2012",
+{:snapshot-time "Thu Nov 08 12:13:00 PST 2012",
:snapshot-info
{"clojure.zip/insert-right"
{:comments [],
@@ -248,15 +248,15 @@
:examples
[{:namespace_id 99,
:ns "clojure.core",
- :updated_at "2010-09-26 02:48:32.0",
+ :updated_at "2012-11-05 23:52:42.0",
:function "rand-nth",
- :version 3,
+ :version 4,
:created_at "2010-08-20 08:46:18.0",
:library "Clojure Core",
:lib_version "1.2.0",
:library_id 3,
:body
- "user=> (def food ['ice-cream 'steak 'apple])\n#'user/food\n\nuser=> (rand-nth food)\napple\nuser=> (rand-nth food)\nice-cream\n"}],
+ "user=> (def food [:ice-cream :steak :apple])\n#'user/food\n\nuser=> (rand-nth food)\n:apple\nuser=> (rand-nth food)\n:ice-cream\n"}],
:id 5691,
:name "rand-nth",
:ns "clojure.core",
@@ -1583,9 +1583,9 @@
{:comments [],
:see-alsos
[{:namespace_id 55,
- :weight 0,
+ :weight 1,
:name "lcm",
- :updated_at "2010-10-20 04:41:51.0",
+ :updated_at "2012-11-01 18:16:19.0",
:version "1.2.0",
:created_at "2010-07-14 20:54:01.0",
:added nil,
@@ -2632,9 +2632,9 @@
:url_friendly_name "with-redefs",
:file "clojure/core.clj"}
{:namespace_id 330,
- :weight 1,
+ :weight 2,
:name "with-redefs-fn",
- :updated_at "2012-10-11 23:43:50.0",
+ :updated_at "2012-11-08 09:09:54.0",
:version "1.3.0",
:created_at "2011-09-26 06:12:41.0",
:added "1.3",
@@ -4088,9 +4088,9 @@
{:comments [],
:see-alsos
[{:namespace_id 330,
- :weight 1,
+ :weight 2,
:name "with-redefs-fn",
- :updated_at "2012-10-11 23:43:50.0",
+ :updated_at "2012-11-08 09:09:54.0",
:version "1.3.0",
:created_at "2011-09-26 06:12:41.0",
:added "1.3",
@@ -10016,9 +10016,9 @@
:url_friendly_name "with-redefs",
:file "clojure/core.clj"}
{:namespace_id 330,
- :weight 1,
+ :weight 2,
:name "with-redefs-fn",
- :updated_at "2012-10-11 23:43:50.0",
+ :updated_at "2012-11-08 09:09:54.0",
:version "1.3.0",
:created_at "2011-09-26 06:12:41.0",
:added "1.3",
@@ -10101,6 +10101,18 @@
:line "698",
:arglists_comp "[t & specs]",
:url_friendly_name "extend-type",
+ :file "clojure/core_deftype.clj"}
+ {:namespace_id 99,
+ :weight 3,
+ :name "defprotocol",
+ :updated_at "2010-11-15 06:13:53.0",
+ :version "1.2.0",
+ :created_at "2010-07-14 20:25:50.0",
+ :added nil,
+ :url "http://clojuredocs.org/v/2062",
+ :line "576",
+ :arglists_comp "[name & opts+sigs]",
+ :url_friendly_name "defprotocol",
:file "clojure/core_deftype.clj"}],
:examples
[{:namespace_id 99,
@@ -12554,7 +12566,19 @@
:url "http://clojuredocs.org/v/6069"},
"clojure.core/-"
{:comments [],
- :see-alsos [],
+ :see-alsos
+ [{:namespace_id 330,
+ :weight 0,
+ :name "-'",
+ :updated_at "2011-09-26 06:24:10.0",
+ :version "1.3.0",
+ :created_at "2011-09-26 06:01:50.0",
+ :added "1.0",
+ :url "http://clojuredocs.org/v/5318",
+ :line "966",
+ :arglists_comp "[x]|[x y]|[x y & more]",
+ :url_friendly_name "-'",
+ :file "clojure/core.clj"}],
:examples
[{:namespace_id 99,
:ns "clojure.core",
@@ -12948,6 +12972,30 @@
:line "630",
:arglists_comp "[atype & proto+mmaps]",
:url_friendly_name "extend",
+ :file "clojure/core_deftype.clj"}
+ {:namespace_id 99,
+ :weight 1,
+ :name "extend-protocol",
+ :updated_at "2011-02-24 05:19:01.0",
+ :version "1.2.0",
+ :created_at "2010-07-14 20:24:41.0",
+ :added nil,
+ :url "http://clojuredocs.org/v/1960",
+ :line "730",
+ :arglists_comp "[p & specs]",
+ :url_friendly_name "extend-protocol",
+ :file "clojure/core_deftype.clj"}
+ {:namespace_id 99,
+ :weight 3,
+ :name "defprotocol",
+ :updated_at "2010-11-15 06:13:53.0",
+ :version "1.2.0",
+ :created_at "2010-07-14 20:25:50.0",
+ :added nil,
+ :url "http://clojuredocs.org/v/2062",
+ :line "576",
+ :arglists_comp "[name & opts+sigs]",
+ :url_friendly_name "defprotocol",
:file "clojure/core_deftype.clj"}],
:examples
[{:namespace_id 99,
@@ -17151,7 +17199,18 @@
"clojure.contrib.math/abs"
{:comments [],
:see-alsos [],
- :examples [],
+ :examples
+ [{:namespace_id 55,
+ :ns "clojure.contrib.math",
+ :updated_at "2012-11-01 18:20:03.0",
+ :function "abs",
+ :version 1,
+ :created_at "2012-11-01 18:20:03.0",
+ :library "Clojure Contrib",
+ :lib_version "1.2.0",
+ :library_id 1,
+ :body
+ "user=> (abs -2)\n2\n\nuser=> (abs 2)\n2\n\nuser=> (abs 0)\n0"}],
:id 698,
:name "abs",
:ns "clojure.contrib.math",
@@ -18934,7 +18993,18 @@
:lib_version "1.2.0",
:library_id 3,
: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=> (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"}],
+ ";; 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=> (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"}
+ {:namespace_id 330,
+ :ns "clojure.core",
+ :updated_at "2012-11-07 12:56:55.0",
+ :function "with-open",
+ :version 1,
+ :created_at "2012-11-07 12:56:55.0",
+ :library "Clojure Core",
+ :lib_version "1.3.0",
+ :library_id 15,
+ :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"}],
:id 5847,
:name "with-open",
:ns "clojure.core",
@@ -21568,15 +21638,15 @@
";; quick demonstration of using a Collections function on the resulting ArrayList\n\nuser=> (def al (doto (java.util.ArrayList.) (.add 11) (.add 3)(.add 7)))\n#'user/al\nuser=> al\n#<ArrayList [11, 3, 7]>\nuser=> (java.util.Collections/sort al)\nnil\nuser=> al\n#<ArrayList [3, 7, 11]>\nuser=>"}
{:namespace_id 330,
:ns "clojure.core",
- :updated_at "2012-06-15 10:58:33.0",
+ :updated_at "2012-10-30 12:33:02.0",
:function "doto",
- :version 1,
+ :version 2,
:created_at "2012-06-15 10:58:33.0",
:library "Clojure Core",
:lib_version "1.3.0",
:library_id 15,
:body
- ";; careful when calling 'dotimes' from within a 'doto' statement\nuser=> (doto (java.util.ArrayList.)\n (.add -2)\n (.add -1)\n (dotimes [i 3] (.add i)))\njava.lang.IllegalArgumentException: dotimes requires a vector for its binding (NO_SOURCE_FILE:1)\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:\n\n;using 'do' instead of 'doto'\nuser=> (let [al (java.util.ArrayList.)]\n (do\n (.add al -2)\n (.add al -1)\n (dotimes [i 3] (.add al i))\n al));return the ArrayList\n#<ArrayList [-2, -1, 0, 1, 2]> ;exactly what we intended\n\n;wrapping 'dotimes' in a function literal\nuser=>(doto (java.util.ArrayList.)\n (.add -2)\n (.add -1)\n (#(dotimes [i 3] (.add % i))))\n#<ArrayList [-2, -1, 0, 1, 2]> ;exactly what we intended again\n"}],
+ ";; careful when calling 'dotimes' from within a 'doto' statement\r\nuser=> (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=> (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#<ArrayList [-2, -1, 0, 1, 2]> ;exactly what we intended\r\n\r\n;wrapping 'dotimes' in a function literal\r\nuser=>(doto (java.util.ArrayList.)\r\n (.add -2)\r\n (.add -1)\r\n (#(dotimes [i 3] (.add % i))))\r\n#<ArrayList [-2, -1, 0, 1, 2]> ;exactly what we intended again\r\n"}],
:id 5479,
:name "doto",
:ns "clojure.core",
@@ -25222,7 +25292,18 @@
"clojure.contrib.math/lcm"
{:comments [],
:see-alsos [],
- :examples [],
+ :examples
+ [{:namespace_id 55,
+ :ns "clojure.contrib.math",
+ :updated_at "2012-11-01 18:16:19.0",
+ :function "lcm",
+ :version 1,
+ :created_at "2012-11-01 18:16:19.0",
+ :library "Clojure Contrib",
+ :lib_version "1.2.0",
+ :library_id 1,
+ :body
+ "user=> (lcm 2 3)\n6\n\nuser=> (lcm 2 4)\n4\n\nuser=> (reduce lcm [2 3 4 5])\n60"}],
:id 703,
:name "lcm",
:ns "clojure.contrib.math",
@@ -32971,7 +33052,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-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",
+ :function "with-redefs-fn",
+ :version 1,
+ :created_at "2012-11-08 09:09:53.0",
+ :library "Clojure Core",
+ :lib_version "1.3.0",
+ :library_id 15,
+ :body
+ "=> (defn f [] false)\n\n=> (println (f))\n;; false\n\n=> (with-redefs-fn {#'f (fn [] true)} \n #(println (f)))\n;; true"}],
:id 5851,
:name "with-redefs-fn",
:ns "clojure.core",
@@ -44577,7 +44669,19 @@
:url "http://clojuredocs.org/v/5158"},
"clojure.core/new"
{:comments [],
- :see-alsos [],
+ :see-alsos
+ [{:namespace_id 99,
+ :weight 0,
+ :name ".",
+ :updated_at "2010-10-20 04:44:12.0",
+ :version "1.2.0",
+ :created_at "2010-10-20 04:44:12.0",
+ :added nil,
+ :url "http://clojuredocs.org/v/5278",
+ :line nil,
+ :arglists_comp "",
+ :url_friendly_name "_dot",
+ :file nil}],
:examples
[{:namespace_id 99,
:ns "clojure.core",
@@ -44698,7 +44802,19 @@
:line "1382",
:arglists_comp "[multifn dispatch-val]",
:url_friendly_name "get-method",
- :file "clojure/core.clj"}],
+ :file "clojure/core.clj"}
+ {:namespace_id 99,
+ :weight 3,
+ :name "defprotocol",
+ :updated_at "2010-11-15 06:13:53.0",
+ :version "1.2.0",
+ :created_at "2010-07-14 20:25:50.0",
+ :added nil,
+ :url "http://clojuredocs.org/v/2062",
+ :line "576",
+ :arglists_comp "[name & opts+sigs]",
+ :url_friendly_name "defprotocol",
+ :file "clojure/core_deftype.clj"}],
:examples
[{:namespace_id 99,
:ns "clojure.core",
@@ -44759,6 +44875,18 @@
:line "4647",
:arglists_comp "[& filters]",
:url_friendly_name "refer-clojure",
+ :file "clojure/core.clj"}
+ {:namespace_id 99,
+ :weight 7,
+ :name "ns",
+ :updated_at "2011-02-13 23:57:47.0",
+ :version "1.2.0",
+ :created_at "2010-07-14 20:22:47.0",
+ :added nil,
+ :url "http://clojuredocs.org/v/1794",
+ :line "4594",
+ :arglists_comp "[name docstring? attr-map? references*]",
+ :url_friendly_name "ns",
:file "clojure/core.clj"}],
:examples
[{:namespace_id 99,

0 comments on commit cf01ec8

Please sign in to comment.