Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update latest snapshot to Apr 15 2012

  • Loading branch information...
commit f13de7e32cd468229df40bce1ae054abf23dccb6 1 parent e62065c
@jafingerhut authored
Showing with 360 additions and 26 deletions.
  1. +360 −26 snapshots/clojuredocs-snapshot-latest.txt
View
386 snapshots/clojuredocs-snapshot-latest.txt
@@ -1,4 +1,4 @@
-{:snapshot-time "Mon Apr 09 13:38:14 PDT 2012",
+{:snapshot-time "Sun Apr 15 02:41:40 PDT 2012",
:snapshot-info
{"clojure.zip/insert-right"
{:comments [],
@@ -595,7 +595,19 @@
:line "1422",
:arglists_comp "[bindings & body]",
:url_friendly_name "when-let",
- :file "clojure/core.clj"}],
+ :file "clojure/core.clj"}
+ {:namespace_id 99,
+ :weight 1,
+ :name "if",
+ :updated_at "2010-10-27 16:30:54.0",
+ :version "1.2.0",
+ :created_at "2010-10-20 04:44:11.0",
+ :added nil,
+ :url "http://clojuredocs.org/v/5269",
+ :line nil,
+ :arglists_comp "",
+ :url_friendly_name "if",
+ :file nil}],
:examples
[{:namespace_id 99,
:ns "clojure.core",
@@ -618,7 +630,18 @@
:lib_version "1.2.0",
:library_id 3,
:body
- "user=> (def has-value (when true\n (println \"Hello World\")\n \"Returned Value\"))\nHello World\n#'user/has-value\n\nuser=> has-value\n\"Returned Value\"\n\n"}],
+ "user=> (def has-value (when true\n (println \"Hello World\")\n \"Returned Value\"))\nHello World\n#'user/has-value\n\nuser=> has-value\n\"Returned Value\"\n\n"}
+ {:namespace_id 330,
+ :ns "clojure.core",
+ :updated_at "2012-04-12 22:01:36.0",
+ :function "when",
+ :version 1,
+ :created_at "2012-04-12 22:01:36.0",
+ :library "Clojure Core",
+ :lib_version "1.3.0",
+ :library_id 15,
+ :body
+ ";; See examples for \"if\" explaining Clojure's idea of logical true\n;; and logical false."}],
:id 5836,
:name "when",
:ns "clojure.core",
@@ -2516,7 +2539,19 @@
:url "http://clojuredocs.org/v/2632"},
"clojure.core/*e"
{:comments [],
- :see-alsos [],
+ :see-alsos
+ [{:namespace_id 342,
+ :weight 0,
+ :name "pst",
+ :updated_at "2011-09-26 06:37:43.0",
+ :version "1.3.0",
+ :created_at "2011-09-26 06:15:16.0",
+ :added "1.3",
+ :url "http://clojuredocs.org/v/5972",
+ :line "242",
+ :arglists_comp "[]|[e-or-depth]|[e depth]",
+ :url_friendly_name "pst",
+ :file "clojure/repl.clj"}],
:examples
[{:namespace_id 99,
:ns "clojure.core",
@@ -5164,6 +5199,18 @@
:line "419",
:arglists_comp "[test & body]",
:url_friendly_name "when",
+ :file "clojure/core.clj"}
+ {:namespace_id 99,
+ :weight 3,
+ :name "if-let",
+ :updated_at "2011-05-19 15:27:29.0",
+ :version "1.2.0",
+ :created_at "2010-07-14 20:24:37.0",
+ :added nil,
+ :url "http://clojuredocs.org/v/1953",
+ :line "1403",
+ :arglists_comp "[bindings then]|[bindings then else & oldform]",
+ :url_friendly_name "if-let",
:file "clojure/core.clj"}],
:examples
[{:namespace_id 99,
@@ -5176,7 +5223,18 @@
:lib_version "1.2.0",
:library_id 3,
:body
- "(defn is-small? [number]\n (if (< number 100) \"yes\" \"no\"))\n\nuser=> (is-small? 50)\n\"yes\"\n\nuser=> (is-small? 500)\n\"no\""}],
+ "(defn is-small? [number]\n (if (< number 100) \"yes\" \"no\"))\n\nuser=> (is-small? 50)\n\"yes\"\n\nuser=> (is-small? 500)\n\"no\""}
+ {:namespace_id 330,
+ :ns "clojure.core",
+ :updated_at "2012-04-13 22:18:22.0",
+ :function "if",
+ :version 4,
+ :created_at "2012-04-12 22:00:23.0",
+ :library "Clojure Core",
+ :lib_version "1.3.0",
+ :library_id 15,
+ :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=> (if nil \"logical true\" \"logical false\")\n\"logical false\"\nuser=> (if false \"logical true\" \"logical false\")\n\"logical false\"\n;; Boolean/FALSE is how Clojure's \"false\" is represented internally.\nuser=> (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=> (if 1 \"logical true\" \"logical false\")\n\"logical true\"\n;; A vector containing nil is not the same as nil.\nuser=> (if [nil] \"logical true\" \"logical false\")\n\"logical true\"\nuser=> (if (first [nil]) \"logical true\" \"logical false\")\n\"logical false\"\n\n;; Bad idea even in Java. See below for more details.\nuser=> (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=> (if (boolean (Boolean. false)) \"logical true\" \"logical false\")\n\"logical false\"\n\n;; (Boolean/valueOf <val>) is similar:\nuser=> (if (Boolean/valueOf (Boolean. false)) \"logical true\" \"logical false\")\n\"logical false\"\n"}],
:id 6126,
:name "if",
:ns "clojure.core",
@@ -9184,7 +9242,19 @@
:url "http://clojuredocs.org/v/3198"},
"clojure.core/bytes"
{:comments [],
- :see-alsos [],
+ :see-alsos
+ [{:namespace_id 99,
+ :weight 1,
+ :name "byte-array",
+ :updated_at "2011-08-21 13:51:48.0",
+ :version "1.2.0",
+ :created_at "2010-07-14 20:25:03.0",
+ :added nil,
+ :url "http://clojuredocs.org/v/1993",
+ :line "4152",
+ :arglists_comp "[size-or-seq]|[size init-val-or-seq]",
+ :url_friendly_name "byte-array",
+ :file "clojure/core.clj"}],
:examples [],
:id 5400,
:name "bytes",
@@ -9724,7 +9794,19 @@
:line "1422",
:arglists_comp "[bindings & body]",
:url_friendly_name "when-let",
- :file "clojure/core.clj"}],
+ :file "clojure/core.clj"}
+ {:namespace_id 99,
+ :weight 1,
+ :name "if",
+ :updated_at "2010-10-27 16:30:54.0",
+ :version "1.2.0",
+ :created_at "2010-10-20 04:44:11.0",
+ :added nil,
+ :url "http://clojuredocs.org/v/5269",
+ :line nil,
+ :arglists_comp "",
+ :url_friendly_name "if",
+ :file nil}],
:examples
[{:namespace_id 99,
:ns "clojure.core",
@@ -9736,7 +9818,18 @@
:lib_version "1.2.0",
:library_id 3,
:body
- "user=> (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"}],
+ "user=> (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"}
+ {:namespace_id 330,
+ :ns "clojure.core",
+ :updated_at "2012-04-12 22:02:50.0",
+ :function "when-not",
+ :version 1,
+ :created_at "2012-04-12 22:02:50.0",
+ :library "Clojure Core",
+ :lib_version "1.3.0",
+ :library_id 15,
+ :body
+ ";; See examples for \"if\" explaining Clojure's idea of logical true\n;; and logical false."}],
:id 5839,
:name "when-not",
:ns "clojure.core",
@@ -12338,7 +12431,19 @@
:line "491",
:arglists_comp "[& clauses]",
:url_friendly_name "cond",
- :file "clojure/core.clj"}],
+ :file "clojure/core.clj"}
+ {:namespace_id 99,
+ :weight 1,
+ :name "if",
+ :updated_at "2010-10-27 16:30:54.0",
+ :version "1.2.0",
+ :created_at "2010-10-20 04:44:11.0",
+ :added nil,
+ :url "http://clojuredocs.org/v/5269",
+ :line nil,
+ :arglists_comp "",
+ :url_friendly_name "if",
+ :file nil}],
:examples
[{:namespace_id 99,
:ns "clojure.core",
@@ -12383,7 +12488,18 @@
:lib_version "1.2.0",
:library_id 3,
:body
- "user=> (condp (comp seq re-seq) \"foo=bar\"\n #\"[+](\\w+)\" :>> #(vector (-> % first (nth 1) keyword) true)\n #\"[-](\\w+)\" :>> #(vector (-> % first (nth 1) keyword) false)\n #\"(\\w+)=(\\S+)\" :>> #(let [x (first %)]\n [(keyword (nth x 1)) (nth x 2)]))\n\n[:foo \"bar\"]"}],
+ "user=> (condp (comp seq re-seq) \"foo=bar\"\n #\"[+](\\w+)\" :>> #(vector (-> % first (nth 1) keyword) true)\n #\"[-](\\w+)\" :>> #(vector (-> % first (nth 1) keyword) false)\n #\"(\\w+)=(\\S+)\" :>> #(let [x (first %)]\n [(keyword (nth x 1)) (nth x 2)]))\n\n[:foo \"bar\"]"}
+ {:namespace_id 330,
+ :ns "clojure.core",
+ :updated_at "2012-04-12 22:13:47.0",
+ :function "condp",
+ :version 1,
+ :created_at "2012-04-12 22:13:47.0",
+ :library "Clojure Core",
+ :lib_version "1.3.0",
+ :library_id 15,
+ :body
+ ";; See examples for \"if\" explaining Clojure's idea of logical true\n;; and logical false."}],
:id 5432,
:name "condp",
:ns "clojure.core",
@@ -12638,7 +12754,18 @@
:lib_version "1.2.0",
:library_id 3,
:body
- "user=> (let [grade 85]\n (cond\n (> grade 90) \"A\"\n (> grade 80) \"B\"\n (> grade 70) \"C\"\n (> grade 60) \"D\"\n :else \"F\"))\n\"B\""}],
+ "user=> (let [grade 85]\n (cond\n (> grade 90) \"A\"\n (> grade 80) \"B\"\n (> grade 70) \"C\"\n (> grade 60) \"D\"\n :else \"F\"))\n\"B\""}
+ {:namespace_id 330,
+ :ns "clojure.core",
+ :updated_at "2012-04-12 22:01:55.0",
+ :function "cond",
+ :version 1,
+ :created_at "2012-04-12 22:01:55.0",
+ :library "Clojure Core",
+ :lib_version "1.3.0",
+ :library_id 15,
+ :body
+ ";; See examples for \"if\" explaining Clojure's idea of logical true\n;; and logical false."}],
:id 5431,
:name "cond",
:ns "clojure.core",
@@ -14212,7 +14339,19 @@
:line "693",
:arglists_comp "[]|[x]|[x & next]",
:url_friendly_name "and",
- :file "clojure/core.clj"}],
+ :file "clojure/core.clj"}
+ {:namespace_id 99,
+ :weight 1,
+ :name "if",
+ :updated_at "2010-10-27 16:30:54.0",
+ :version "1.2.0",
+ :created_at "2010-10-20 04:44:11.0",
+ :added nil,
+ :url "http://clojuredocs.org/v/5269",
+ :line nil,
+ :arglists_comp "",
+ :url_friendly_name "if",
+ :file nil}],
:examples
[{:namespace_id 99,
:ns "clojure.core",
@@ -14224,7 +14363,18 @@
:lib_version "1.2.0",
:library_id 3,
:body
- "user> (or true false false)\ntrue\n\nuser> (or true true true)\ntrue\n\nuser> (or false false false)\nfalse\n\nuser> (or nil nil)\nnil\n\nuser> (or false nil)\nnil\n\nuser> (or true nil)\ntrue\n\n;; or doesn't evaluate if the first value is true\nuser> (or true (println \"foo\"))\ntrue\n\n;; order matters\nuser> (or (println \"foo\") true)\nfoo\ntrue"}],
+ "user> (or true false false)\ntrue\n\nuser> (or true true true)\ntrue\n\nuser> (or false false false)\nfalse\n\nuser> (or nil nil)\nnil\n\nuser> (or false nil)\nnil\n\nuser> (or true nil)\ntrue\n\n;; or doesn't evaluate if the first value is true\nuser> (or true (println \"foo\"))\ntrue\n\n;; order matters\nuser> (or (println \"foo\") true)\nfoo\ntrue"}
+ {:namespace_id 330,
+ :ns "clojure.core",
+ :updated_at "2012-04-12 22:13:01.0",
+ :function "or",
+ :version 1,
+ :created_at "2012-04-12 22:13:01.0",
+ :library "Clojure Core",
+ :lib_version "1.3.0",
+ :library_id 15,
+ :body
+ ";; See examples for \"if\" explaining Clojure's idea of logical true\n;; and logical false."}],
:id 5650,
:name "or",
:ns "clojure.core",
@@ -14700,7 +14850,19 @@
:url "http://clojuredocs.org/v/5959"},
"clojure.core/if-not"
{:comments [],
- :see-alsos [],
+ :see-alsos
+ [{:namespace_id 99,
+ :weight 1,
+ :name "if",
+ :updated_at "2010-10-27 16:30:54.0",
+ :version "1.2.0",
+ :created_at "2010-10-20 04:44:11.0",
+ :added nil,
+ :url "http://clojuredocs.org/v/5269",
+ :line nil,
+ :arglists_comp "",
+ :url_friendly_name "if",
+ :file nil}],
:examples
[{:namespace_id 99,
:ns "clojure.core",
@@ -14722,7 +14884,18 @@
:library "Clojure Core",
:lib_version "1.2.0",
:library_id 3,
- :body "user=> (if-not (zero? 0) :then :else)\n:else"}],
+ :body "user=> (if-not (zero? 0) :then :else)\n:else"}
+ {:namespace_id 330,
+ :ns "clojure.core",
+ :updated_at "2012-04-12 22:03:31.0",
+ :function "if-not",
+ :version 1,
+ :created_at "2012-04-12 22:03:31.0",
+ :library "Clojure Core",
+ :lib_version "1.3.0",
+ :library_id 15,
+ :body
+ ";; See examples for \"if\" explaining Clojure's idea of logical true\n;; and logical false."}],
:id 5549,
:name "if-not",
:ns "clojure.core",
@@ -18151,7 +18324,43 @@
:url "http://clojuredocs.org/v/5668"},
"clojure.core/realized?"
{:comments [],
- :see-alsos [],
+ :see-alsos
+ [{:namespace_id 99,
+ :weight 1,
+ :name "promise",
+ :updated_at "2010-10-20 04:42:04.0",
+ :version "1.2.0",
+ :created_at "2010-07-14 20:20:27.0",
+ :added nil,
+ :url "http://clojuredocs.org/v/1591",
+ :line "5501",
+ :arglists_comp "[]",
+ :url_friendly_name "promise",
+ :file "clojure/core.clj"}
+ {:namespace_id 99,
+ :weight 1,
+ :name "delay",
+ :updated_at "2010-10-20 04:42:13.0",
+ :version "1.2.0",
+ :created_at "2010-07-14 20:24:57.0",
+ :added nil,
+ :url "http://clojuredocs.org/v/1986",
+ :line "619",
+ :arglists_comp "[& body]",
+ :url_friendly_name "delay",
+ :file "clojure/core.clj"}
+ {:namespace_id 99,
+ :weight 2,
+ :name "future",
+ :updated_at "2011-08-03 05:43:23.0",
+ :version "1.2.0",
+ :created_at "2010-07-14 20:21:27.0",
+ :added nil,
+ :url "http://clojuredocs.org/v/1677",
+ :line "5407",
+ :arglists_comp "[& body]",
+ :url_friendly_name "future",
+ :file "clojure/core.clj"}],
:examples
[{:namespace_id 330,
:ns "clojure.core",
@@ -19022,7 +19231,29 @@
:lib_version "1.3.0",
:library_id 15,
:body
- "; Combine a set of collections into a single collection\nuser=> (reduce into [[1 2 3] [:a :b :c] '([4 5] 6)])\n[1 2 3 :a :b :c [4 5] 6]"}],
+ "; Combine a set of collections into a single collection\nuser=> (reduce into [[1 2 3] [:a :b :c] '([4 5] 6)])\n[1 2 3 :a :b :c [4 5] 6]"}
+ {:namespace_id 330,
+ :ns "clojure.core",
+ :updated_at "2012-04-12 13:02:08.0",
+ :function "reduce",
+ :version 1,
+ :created_at "2012-04-12 13:02:08.0",
+ :library "Clojure Core",
+ :lib_version "1.3.0",
+ :library_id 15,
+ :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))"}
+ {:namespace_id 330,
+ :ns "clojure.core",
+ :updated_at "2012-04-12 13:10:50.0",
+ :function "reduce",
+ :version 2,
+ :created_at "2012-04-12 13:07:01.0",
+ :library "Clojure Core",
+ :lib_version "1.3.0",
+ :library_id 15,
+ :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 (<= (count csv-row) 1)\n (conj out-csv-row (nth csv-row col-num nil))))\n []\n col-nums))\n\n"}],
:id 5706,
:name "reduce",
:ns "clojure.core",
@@ -22282,7 +22513,18 @@
:lib_version "1.2.0",
:library_id 3,
:body
- "user=> (vec '(1 2 3))\n[1 2 3]\n\nuser=> (vec [1 2 3])\n[1 2 3]\n\nuser=> (vec '())\n[]\n\nuser=> (vec nil)\n[]"}],
+ "user=> (vec '(1 2 3))\n[1 2 3]\n\nuser=> (vec [1 2 3])\n[1 2 3]\n\nuser=> (vec '())\n[]\n\nuser=> (vec nil)\n[]"}
+ {:namespace_id 330,
+ :ns "clojure.core",
+ :updated_at "2012-04-14 21:21:05.0",
+ :function "vec",
+ :version 1,
+ :created_at "2012-04-14 21:21:05.0",
+ :library "Clojure Core",
+ :lib_version "1.3.0",
+ :library_id 15,
+ :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=> (def a (to-array (repeat 4 0)))\n#'user/a\nuser=> (seq a)\n(0 0 0 0)\nuser=> (def v (vec a))\n#'user/v\nuser=> v\n[0 0 0 0]\n\n;; Now change a, and v changes, too, since they share state.\nuser=> (aset a 2 -5)\n-5\nuser=> v\n[0 0 -5 0]\n\n;; One way to avoid this\nuser=> (def v (vec (aclone a)))\n#'user/v\nuser=> v\n[0 0 -5 0]\nuser=> (aset a 2 -20)\n-20\nuser=> v\n[0 0 -5 0]\n"}],
:id 5832,
:name "vec",
:ns "clojure.core",
@@ -23033,7 +23275,19 @@
:url "http://clojuredocs.org/v/486"},
"clojure.core/byte"
{:comments [],
- :see-alsos [],
+ :see-alsos
+ [{:namespace_id 99,
+ :weight 1,
+ :name "byte-array",
+ :updated_at "2011-08-21 13:51:48.0",
+ :version "1.2.0",
+ :created_at "2010-07-14 20:25:03.0",
+ :added nil,
+ :url "http://clojuredocs.org/v/1993",
+ :line "4152",
+ :arglists_comp "[size-or-seq]|[size init-val-or-seq]",
+ :url_friendly_name "byte-array",
+ :file "clojure/core.clj"}],
:examples
[{:namespace_id 99,
:ns "clojure.core",
@@ -23427,7 +23681,19 @@
:line "425",
:arglists_comp "[test & body]",
:url_friendly_name "when-not",
- :file "clojure/core.clj"}],
+ :file "clojure/core.clj"}
+ {:namespace_id 99,
+ :weight 1,
+ :name "if",
+ :updated_at "2010-10-27 16:30:54.0",
+ :version "1.2.0",
+ :created_at "2010-10-20 04:44:11.0",
+ :added nil,
+ :url "http://clojuredocs.org/v/5269",
+ :line nil,
+ :arglists_comp "",
+ :url_friendly_name "if",
+ :file nil}],
:examples
[{:namespace_id 99,
:ns "clojure.core",
@@ -23439,7 +23705,18 @@
:lib_version "1.2.0",
:library_id 3,
:body
- ";; Very useful when working with sequences. Capturing the retun 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=> (drop-one [1 2 3])\n(2 3)\nuser=> (drop-one [])\nnil\n"}],
+ ";; Very useful when working with sequences. Capturing the retun 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=> (drop-one [1 2 3])\n(2 3)\nuser=> (drop-one [])\nnil\n"}
+ {:namespace_id 330,
+ :ns "clojure.core",
+ :updated_at "2012-04-12 22:03:15.0",
+ :function "when-let",
+ :version 1,
+ :created_at "2012-04-12 22:03:15.0",
+ :library "Clojure Core",
+ :lib_version "1.3.0",
+ :library_id 15,
+ :body
+ ";; See examples for \"if\" explaining Clojure's idea of logical true\n;; and logical false."}],
:id 5838,
:name "when-let",
:ns "clojure.core",
@@ -26957,7 +27234,18 @@
:lib_version "1.2.0",
:library_id 3,
: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."}],
+ "; 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."}
+ {:namespace_id 330,
+ :ns "clojure.core",
+ :updated_at "2012-04-12 22:02:06.0",
+ :function "if-let",
+ :version 1,
+ :created_at "2012-04-12 22:02:06.0",
+ :library "Clojure Core",
+ :lib_version "1.3.0",
+ :library_id 15,
+ :body
+ ";; See examples for \"if\" explaining Clojure's idea of logical true\n;; and logical false."}],
:id 5548,
:name "if-let",
:ns "clojure.core",
@@ -27311,7 +27599,19 @@
:line "705",
:arglists_comp "[]|[x]|[x & next]",
:url_friendly_name "or",
- :file "clojure/core.clj"}],
+ :file "clojure/core.clj"}
+ {:namespace_id 99,
+ :weight 1,
+ :name "if",
+ :updated_at "2010-10-27 16:30:54.0",
+ :version "1.2.0",
+ :created_at "2010-10-20 04:44:11.0",
+ :added nil,
+ :url "http://clojuredocs.org/v/5269",
+ :line nil,
+ :arglists_comp "",
+ :url_friendly_name "if",
+ :file nil}],
:examples
[{:namespace_id 99,
:ns "clojure.core",
@@ -27323,7 +27623,18 @@
:lib_version "1.2.0",
:library_id 3,
:body
- "user=> (and true true)\ntrue\n\nuser=> (and true false)\nfalse\n\nuser=> (and false false)\nfalse\n\nuser=> (and '() '())\n()\n\nuser=> (and '[] '[])\n[]\n\nuser=> (and 0 1) ; Note that this is *not* bitwise 'and'\n1\n\nuser=> (and 1 0)\n0\n\nuser=> (and (constantly true) (> 2 1))\ntrue"}],
+ "user=> (and true true)\ntrue\n\nuser=> (and true false)\nfalse\n\nuser=> (and false false)\nfalse\n\nuser=> (and '() '())\n()\n\nuser=> (and '[] '[])\n[]\n\nuser=> (and 0 1) ; Note that this is *not* bitwise 'and'\n1\n\nuser=> (and 1 0)\n0\n\nuser=> (and (constantly true) (> 2 1))\ntrue"}
+ {:namespace_id 330,
+ :ns "clojure.core",
+ :updated_at "2012-04-12 22:12:48.0",
+ :function "and",
+ :version 1,
+ :created_at "2012-04-12 22:12:48.0",
+ :library "Clojure Core",
+ :lib_version "1.3.0",
+ :library_id 15,
+ :body
+ ";; See examples for \"if\" explaining Clojure's idea of logical true\n;; and logical false."}],
:id 5352,
:name "and",
:ns "clojure.core",
@@ -36662,7 +36973,18 @@
:lib_version "1.2.0",
:library_id 3,
:body
- "<pre>user=&gt; (bit-shift-left 2r1101 2) ; fill rightmost bits with 0s\r\n52 \r\n;; 52 = 2r110100\r\n</pre>\r\n"}],
+ "<pre>user=&gt; (bit-shift-left 2r1101 2) ; fill rightmost bits with 0s\r\n52 \r\n;; 52 = 2r110100\r\n</pre>\r\n"}
+ {:namespace_id 330,
+ :ns "clojure.core",
+ :updated_at "2012-04-13 04:21:02.0",
+ :function "bit-shift-left",
+ :version 2,
+ :created_at "2012-04-13 04:18:46.0",
+ :library "Clojure Core",
+ :lib_version "1.3.0",
+ :library_id 15,
+ :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 )"}],
:id 5387,
:name "bit-shift-left",
:ns "clojure.core",
@@ -42098,7 +42420,19 @@
:url "http://clojuredocs.org/v/5266"},
"clojure.repl/pst"
{:comments [],
- :see-alsos [],
+ :see-alsos
+ [{:namespace_id 99,
+ :weight 1,
+ :name "*e",
+ :updated_at "2010-10-20 04:42:06.0",
+ :version "1.2.0",
+ :created_at "2010-07-14 20:21:54.0",
+ :added nil,
+ :url "http://clojuredocs.org/v/1717",
+ :line "5035",
+ :arglists_comp "",
+ :url_friendly_name "*e",
+ :file "clojure/core.clj"}],
:examples [],
:id 5972,
:name "pst",
Please sign in to comment.
Something went wrong with that request. Please try again.