")}}]
73 | (when (and related (first related) (not (str/blank? (first related))))
74 | (RelatedLinks related))]))
75 |
--------------------------------------------------------------------------------
/cljs-client/cljs_cheatsheet_client/state.cljs:
--------------------------------------------------------------------------------
1 | (ns cljs-cheatsheet-client.state
2 | "Atoms that are referenced in multiple modules.")
3 |
4 | (def active-tooltip (atom nil))
5 | (def mouse-position (atom nil))
6 | (def mousetrap-boxes (atom nil))
7 |
--------------------------------------------------------------------------------
/cljs-client/cljs_cheatsheet_client/util.cljs:
--------------------------------------------------------------------------------
1 | (ns cljs-cheatsheet-client.util
2 | (:require
3 | [clojure.walk :refer [keywordize-keys]]
4 | [cognitect.transit :as transit]
5 | [oops.core :refer [ocall oget oset!]]))
6 |
7 | ;;------------------------------------------------------------------------------
8 | ;; Util Functions
9 | ;;------------------------------------------------------------------------------
10 |
11 | (defn half [n]
12 | (/ n 2))
13 |
14 |
15 | (defn extract-namespace [full-name]
16 | (let [first-slash-pos (.indexOf full-name "/")]
17 | (subs full-name 0 first-slash-pos)))
18 |
19 |
20 | (defn extract-symbol [full-name]
21 | (let [first-slash-pos (.indexOf full-name "/")]
22 | (subs full-name (inc first-slash-pos))))
23 |
24 |
25 | (defn split-full-name [r]
26 | (let [ns1 (extract-namespace r)
27 | symbol-name (extract-symbol r)]
28 | {:full-name r
29 | :namespace ns1
30 | :symbol symbol-name}))
31 |
32 |
33 | (defn point-inside-box? [point box]
34 | (let [px (:x point)
35 | py (:y point)]
36 | (and (>= px (:x1 box))
37 | (<= px (:x2 box))
38 | (>= py (:y1 box))
39 | (<= py (:y2 box)))))
40 |
41 |
42 | ;;------------------------------------------------------------------------------
43 | ;; AJAX
44 | ;;------------------------------------------------------------------------------
45 |
46 | (def transit-json-rdr (transit/reader :json))
47 |
48 | (defn- http-success? [status]
49 | (and (>= status 200)
50 | (< status 400)))
51 |
52 |
53 | (defn- fetch-clj-success [js-evt success-fn error-fn]
54 | (let [status (oget js-evt "target" "status")]
55 | (if-not (http-success? status)
56 | (error-fn)
57 | (let [response-text (oget js-evt "target" "responseText")]
58 | (if-let [clj-result (try (transit/read transit-json-rdr response-text)
59 | (catch js/Error _error nil))]
60 | (success-fn (keywordize-keys clj-result))
61 | (error-fn))))))
62 |
63 |
64 | (defn fetch-clj
65 | "Makes an AJAX request to an HTTP GET endpoint expecting JSON.
66 | Parses JSON into CLJ using transit.cljs and keywordizes map keys.
67 | transit.cljs is faster than using js->clj: http://tinyurl.com/ntgxyt8"
68 | ([url success-fn]
69 | (fetch-clj url success-fn (fn [] nil)))
70 | ([url success-fn error-fn]
71 | (doto (js/XMLHttpRequest.)
72 | (.addEventListener "load" #(fetch-clj-success % success-fn error-fn))
73 | (.addEventListener "error" error-fn)
74 | (.addEventListener "abort" error-fn)
75 | (.open "get" url)
76 | (.send))))
77 |
--------------------------------------------------------------------------------
/cljs-shared/cljs_cheatsheet/util.cljs:
--------------------------------------------------------------------------------
1 | (ns cljs-cheatsheet.util "Utility functions shared on both the client and server."
2 | (:require
3 | [clojure.string :refer [replace]]))
4 |
5 | ;;------------------------------------------------------------------------------
6 | ;; Logging
7 | ;;------------------------------------------------------------------------------
8 |
9 | (defn js-log
10 | "Log a JavaScript thing."
11 | [js-thing]
12 | (js/console.log js-thing))
13 |
14 | (defn log
15 | "Log a Clojure thing."
16 | [clj-thing]
17 | (js-log (pr-str clj-thing)))
18 |
19 | ;;------------------------------------------------------------------------------
20 | ;; URL Encoding for Clojuredocs.org
21 | ;;------------------------------------------------------------------------------
22 |
23 | (def uri-encode js/encodeURIComponent)
24 |
25 | (def encode-clojuredocs
26 | {"/" "_fs"
27 | "?" "_q"})
28 |
29 | (def encode-cljs
30 | {"/" "SLASH"
31 | "?" "QMARK"
32 | "!" "BANG"
33 | ">" "GT"
34 | "<" "LT"
35 | "=" "EQ"})
36 |
37 | (defn encoder-gen [mapping]
38 | (fn [s]
39 | (reduce-kv
40 | replace
41 | s
42 | mapping)))
43 |
44 | (def encode-symbol-url-clojuredocs
45 | (encoder-gen encode-clojuredocs))
46 |
47 | (def encode-symbol-url-cljs
48 | (encoder-gen encode-cljs))
49 |
50 | (defn docs-href [name name-space]
51 | (let [cljsns? (= name-space "cljs.core")
52 | domain (if cljsns?
53 | "http://cljs.github.io/api/"
54 | "http://clojuredocs.org/")
55 | encode-fn (if cljsns?
56 | encode-symbol-url-cljs
57 | encode-symbol-url-clojuredocs)]
58 | (str domain
59 | (uri-encode name-space)
60 | "/"
61 | (uri-encode (encode-fn name)))))
62 |
--------------------------------------------------------------------------------
/default.nix:
--------------------------------------------------------------------------------
1 | { nixpkgs ? import { } }:
2 |
3 | let
4 | pkgs = [
5 | /* Core runtime libraries */
6 | nixpkgs.nodejs
7 | nixpkgs.yarn
8 | nixpkgs.clojure
9 | nixpkgs.jdk11
10 | nixpkgs.leiningen
11 |
12 | /* Dev Tools */
13 | nixpkgs.ack
14 | nixpkgs.git
15 | nixpkgs.gnupg
16 | nixpkgs.which
17 | ];
18 |
19 | in
20 | nixpkgs.stdenv.mkDerivation {
21 | name = "env";
22 | buildInputs = pkgs;
23 | }
24 |
--------------------------------------------------------------------------------
/design.md:
--------------------------------------------------------------------------------
1 | # ClojureScript Cheatsheet Design
2 |
3 | Below are some design notes for the [ClojureScript cheatsheet].
4 |
5 | ## Type
6 |
7 | Open Sans (weights 300, 400, 600) was chosen for its clean appearance and
8 | excellent legibility. Droid Sans Mono was chosen as a compliment pair for
9 | monospaced code. Both typefaces have a neutral appearance and keep the focus on
10 | the content, not the type.
11 |
12 | Type differentiation is used to distinguish between groups headers, section
13 | headers, row labels, and table symbols. Each has a distinct appearance and can
14 | be recognized at a glance.
15 |
16 | ## Info Tooltips
17 |
18 | Info tooltips (marked with the circle "i" icon) provide context and additional
19 | information helpful to developers coming from other languages. Comparisons to
20 | JavaScript are mentioned as relevant. Tooltips are unobtrusive unless hovered
21 | over. Grey is used to make them visually "wash over" when not needed.
22 |
23 | Tooltips have a small mouse pointer launch target, but once opened the range
24 | expands to allow for the mouse to enter the tooltip body and "explore" the
25 | content. This also allows the user to copy/paste content from a tooltip.
26 |
27 | ## Tables
28 |
29 | Tables contain no additional marks other than labels and content. Color is used
30 | to separate table rows.
31 |
32 | ## Colors
33 |
34 | High contrast colors are used to ensure legibility on a wide range of devices
35 | and screens.
36 |
37 | ## Literal Forms
38 |
39 | Where appropriate, section headers contain the literal representation or
40 | shorthand version of their form. Users already familiar with the literal forms
41 | will instantly recognize their connection to the section. Users unfamiliar with
42 | the literal forms may be confused at first, but should eventually have an
43 | "aha!" moment when they make the connection. This is my favorite feature of the
44 | cheatsheet :)
45 |
46 | ## Search
47 |
48 | Search highlights matching symbols in yellow and leaves the containing section
49 | visible for context. Sections with no match are hidden and the content "folds"
50 | smartly around the matched sections. Red is used in the search bar to indicate
51 | no match.
52 |
53 | ## Inline Tooltips
54 |
55 | Inline tooltips provide rich information about each function, macro, or special
56 | form. Like the info tooltips, inline tooltips allow for the mouse to enter the
57 | body to "explore" the content and copy/paste.
58 |
59 | Mousing over a related symbol in a tooltip highlights it on the page, visually
60 | connecting related sections. When a related symbol is underneath the tooltip
61 | body (as often happens due to the organization of the symbols), opacity is used
62 | to show the location of the related symbol.
63 |
64 | ## Content Organization
65 |
66 | Sections are defined and ordered by common usage first, implementation
67 | organization second. Links are repeated in multiple sections where appropriate.
68 |
69 | ## Footer
70 |
71 | The footer contains no color and provides relevant links to related material.
72 |
73 | ## Documentation
74 |
75 | Documentation is contained in simple [kidif files] that allow for management
76 | and collaboration using existing tools (git, text editors, etc).
77 |
78 | Docstrings were extracted from the code and converted to Markdown format to
79 | allow for more structure than simple text can provide (ie: code highlighting,
80 | links, tables, etc). The descriptions were edited to have consistent voice and
81 | structure.
82 |
83 | ## Responsive Layout
84 |
85 | The content folds into three layouts depending on browser width. The sections
86 | are organized in each layout to fill the space as best they can.
87 |
88 | [ClojureScript cheatsheet]:http://cljs.info/cheatsheet
89 | [kidif files]:https://github.com/oakmac/kidif.js
90 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_-.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/-
3 |
4 | ===== Signature
5 | [x]
6 | [x y]
7 | [x y & more]
8 |
9 | ===== Description
10 |
11 | If no `y`s are supplied, returns the negation of `x`, else subtracts the `y`s
12 | from `x` and returns the result.
13 |
14 | ===== Related
15 | cljs.core/+
16 |
17 | ===== Example#0a974e
18 |
19 | ```
20 | (- 1)
21 | ;;=> -1
22 |
23 | (- 6 3)
24 | ;;=> 3
25 |
26 | (- 10 3 2)
27 | ;;=> 5
28 | ```
29 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_-GT.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/->
3 |
4 | ===== Type
5 | macro
6 |
7 | ===== Signature
8 | [x & forms]
9 |
10 | ===== Description
11 |
12 | The thread-first macro "threads" an expression through several forms as the
13 | second item in a list.
14 |
15 | Inserts `x` as the second item in the first form, making a list of it if it is
16 | not a list already. If there are more forms, inserts the first form as the
17 | second item in second form, etc.
18 |
19 |
20 |
21 |
22 |
Code
23 |
Expands To
24 |
25 |
26 |
27 | (-> x
28 | (a b c)
29 | d
30 | (x y z))
31 |
32 | (x (d (a x b c)) y z)
33 |
34 | ===== Related
35 | cljs.core/->>
36 |
37 | ===== TODO
38 | add threading macro animations link here
39 |
40 | ===== Example#19b460
41 |
42 | The first is arguably a bit more cumbersome to read than the second:
43 |
44 | ```
45 | (first (.split (.replace (.toUpperCase "a b c d") "A" "X") " "))
46 | ;;=> "X"
47 |
48 | (-> "a b c d"
49 | .toUpperCase
50 | (.replace "A" "X")
51 | (.split " ")
52 | first)
53 | ;;=> "X"
54 | ```
55 | ===== Example#78ad8f
56 |
57 | It can also be useful for pulling values out of deeply-nested
58 | data structures:
59 |
60 | ```
61 | (def person
62 | {:name "Mark Volkmann"
63 | :address {:street "644 Glen Summit"
64 | :city "St. Charles"
65 | :state "Missouri"
66 | :zip 63304}
67 | :employer {:name "Object Computing, Inc."
68 | :address {:street "12140 Woodcrest Dr."
69 | :city "Creve Coeur"
70 | :state "Missouri"
71 | :zip 63141}}})
72 |
73 | (-> person :employer :address :city)
74 | ;;=> "Creve Coeur"
75 | ```
76 |
77 | Same as above, but with more nesting:
78 |
79 | ```
80 | (:city (:address (:employer person)))
81 | ;;=> "Creve Coeur"
82 | ```
83 |
84 | ===== Example#5fe621
85 |
86 | It can also help with arithmetic:
87 |
88 | ```
89 | (def c 5)
90 | (-> c (+ 3) (/ 2) (- 1))
91 | ;;=> 3
92 | ```
93 |
94 | Same as above, but with more nesting:
95 |
96 | ```
97 | (- (/ (+ c 3) 2) 1)
98 | ;;=> 3
99 | ```
100 |
101 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_-GTGT.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/->>
3 |
4 | ===== Type
5 | macro
6 |
7 | ===== Signature
8 | [x & forms]
9 |
10 | ===== Description
11 |
12 | The thread-last macro "threads" an expression through several forms as the last
13 | item in a list.
14 |
15 | Inserts `x` as the last item in the first form, making a list of it if it is not
16 | a list already. If there are more forms, inserts the first form as the last item
17 | in second form, etc.
18 |
19 |
20 |
21 |
22 |
Code
23 |
Expands To
24 |
25 |
26 |
27 | (->> x
28 | (a b c)
29 | d
30 | (x y z))
31 |
32 | (x y z (d (a b c x)))
33 |
34 | ===== Related
35 | cljs.core/->
36 |
37 | ===== TODO
38 | add threading macro animations link here
39 |
40 | ===== Example#1dc72c
41 |
42 | Sequence transformation functions often take a sequence as the last argument,
43 | thus the thread-last macro is commonly used with them. Here we compute the sum
44 | of the first 10 even squares:
45 |
46 | ``
47 | (->> (range)
48 | (map #(* % %))
49 | (filter even?)
50 | (take 10)
51 | (reduce +))
52 | ;;=> 1140
53 | ```
54 |
55 | This expands to:
56 |
57 | ```
58 | (reduce +
59 | (take 10
60 | (filter even?
61 | (map #(* % %)
62 | (range)))))
63 | ;;=> 1140
64 | ```
65 |
66 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_=.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/=
3 |
4 | ===== Signature
5 | [x]
6 | [x y]
7 | [x y & more]
8 |
9 | ===== Description
10 |
11 | Returns true if the value of `x` equals the value of `y`, false otherwise.
12 |
13 | `=` is a value comparison, not an identity comparison.
14 |
15 | All collections can be tested for value, regardless of "depth".
16 |
17 | ===== Related
18 | cljs.core/==
19 | cljs.core/not=
20 | cljs.core/identical?
21 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_==.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/==
3 |
4 | ===== Signature
5 | [x]
6 | [x y]
7 | [x y & more]
8 |
9 | ===== Description
10 |
11 | Returns true if all arguments have the same value, false otherwise.
12 |
13 | Behavior on non-number arguments is undefined.
14 |
15 | ===== Related
16 | cljs.core/=
17 | cljs.core/identical?
18 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_DOT.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/.
3 |
4 | ===== Type
5 | special form
6 |
7 | ===== Signature
8 | [o -p]
9 | [o m]
10 | [o m 1 2]
11 | [o (m 1 2)]
12 |
13 | ===== Description
14 |
15 | For interop, the `.` special form allows access to member properties of the
16 | given JavaScript object `o`.
17 |
18 | If the second operand is a symbol preceded with a hyphen as in `-p`, the
19 | expression will result in the value of the property named `p`.
20 |
21 | If the second operand is a symbol that is not preceded with a hyphen as in `m`,
22 | the expression will evaluate to a call of the method named `m`. Any additional
23 | operands will be passed as arguments to the method.
24 |
25 | The __preferred, idiomatic__ way to access members of a JavaScript object is to
26 | use the following sugar:
27 |
28 |
29 |
30 |
31 |
Sugar
32 |
Expands To
33 |
34 |
35 |
36 |
(.-p o)
37 |
(. o -p)
38 |
39 |
40 |
(.m o)
41 |
(. o m)
42 |
43 |
44 |
(.m o 1 2)
45 |
(. o m 1 2)
46 |
47 |
48 |
49 |
50 | ===== Related
51 | cljs.core/..
52 | cljs.core/aget
53 |
54 | ===== Example#22ccbb
55 |
56 | We can access the JavaScript properties of a string:
57 |
58 | ```js
59 | // JavaScript
60 | var m = "Hello World";
61 | m.length;
62 | //=> 11
63 | ```
64 |
65 | ```
66 | ;; ClojureScript
67 | (def m "Hello World")
68 | (.-length m)
69 | ;;=> 11
70 | ```
71 |
72 | We can also call member functions on the string:
73 |
74 | ```js
75 | // JavaScript
76 | m.toUpperCase();
77 | //=> "HELLO WORLD"
78 |
79 | m.replace("H", "");
80 | //=> "ello World";
81 | ```
82 |
83 | ```
84 | ;; ClojureScript
85 | (.toUpperCase m)
86 | ;;=> "HELLO WORLD"
87 |
88 | (.replace m "H" "")
89 | ;;=> "ello World"
90 | ```
91 |
92 | ```
93 |
94 | ===== Example#7c5e58
95 |
96 | Create a JavaScript object `o`:
97 |
98 | ```
99 | (def o #js {:foo "bar"})
100 | ```
101 |
102 | You can get the value at property `"foo"` with any of the following:
103 |
104 | ```
105 | (. o -foo)
106 | ;;=> "bar"
107 |
108 | (.-foo o)
109 | ;;=> "bar"
110 |
111 | (aget o "foo")
112 | ;;=> "bar"
113 | ```
114 |
115 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_DOTDOT.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/..
3 |
4 | ===== Type
5 | macro
6 |
7 | ===== Signature
8 | [o form]
9 | [o form & more]
10 |
11 | ===== Description
12 |
13 | For interop, the `..` macro allows method/property chaining on the given JavaScript object `o`.
14 |
15 | It essentially combines the thread-first `->` macro with the `.` operator.
16 |
17 | ===== Related
18 | cljs.core/.
19 | cljs.core/->
20 | cljs.core/doto
21 |
22 | ===== Example#500658
23 |
24 | ```js
25 | // JavaScript
26 | "a b c d".toUpperCase().replace("A", "X")
27 | //=> "X B C D"
28 | ```
29 |
30 | ```
31 | ;; ClojureScript
32 | (.. "a b c d"
33 | toUpperCase
34 | (replace "A" "X"))
35 | ;;=> "X B C D"
36 | ```
37 |
38 | This is expanded to:
39 |
40 | ```
41 | (. (. "a b c d" toUpperCase) (replace "A" "X"))
42 | ```
43 |
44 |
45 | which is equivalent to:
46 |
47 | ```
48 | (.replace (.toUpperCase "a b c d") "A" "X")
49 | ;;=> "X B C D"
50 | ```
51 |
52 | Compare to the equivalent form using the thread-first `->` macro:
53 |
54 | ```
55 | (-> "a b c d"
56 | .toUpperCase
57 | (.replace "A" "X"))
58 | ;;=> "X B C D"
59 | ```
60 |
61 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_EQ.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/=
3 |
4 | ===== Signature
5 | [x]
6 | [x y]
7 | [x y & more]
8 |
9 | ===== Description
10 |
11 | Returns true if the value of `x` equals the value of `y`, false otherwise.
12 |
13 | `=` is a value comparison, not an identity comparison.
14 |
15 | All collections can be tested for value, regardless of "depth".
16 |
17 | ===== Related
18 | cljs.core/==
19 | cljs.core/not=
20 | cljs.core/identical?
21 |
22 | ===== Example#edffb6
23 |
24 | ```
25 | (= 1)
26 | ;;=> true
27 |
28 | (= 1 1)
29 | ;;=> true
30 |
31 | (= 1 2)
32 | ;;=> false
33 |
34 | (= 1 1 1)
35 | ;;=> true
36 |
37 | (= 1 1 2)
38 | ;;=> false
39 | ```
40 |
41 | ===== Example#a2d064
42 |
43 | Sequences are considered equal in value if they have the same elements:
44 |
45 | ```
46 | (= '(1 2) [1 2])
47 | ;;=> true
48 | ```
49 |
50 | But you cannot compare JavaScript arrays until you convert them to sequences:
51 |
52 | ```
53 | (def a #js [1 2])
54 | (def b #js [1 2])
55 | (= a b)
56 | ;;=> false
57 |
58 | (= (seq a) (seq b))
59 | ;;=> true
60 | ```
61 |
62 | ===== Example#6c8424
63 |
64 | It is natural to compare deeply nested collections since value equality checks
65 | are cheap in ClojureScript:
66 |
67 | ```
68 | (def a {:foo {:bar "baz"}})
69 | (def b {:foo {:bar "baz"}})
70 | (= a b)
71 | ;;=> true
72 |
73 | (= [a b] [a b])
74 | ;=> true
75 | ```
76 |
77 | JavaScript objects cannot be compared in this way until they are converted to
78 | ClojureScript collections:
79 |
80 | ```
81 | (def a #js {:foo #js {:bar "baz"}})
82 | (def b #js {:foo #js {:bar "baz"}})
83 | (= a b)
84 | ;;=> false
85 |
86 | (= (js->clj a)
87 | (js->clj b))
88 | ;;=> true
89 | ```
90 |
91 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_EQEQ.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/==
3 |
4 | ===== Signature
5 | [x]
6 | [x y]
7 | [x y & more]
8 |
9 | ===== Description
10 |
11 | This is an equality check for numbers of different types that was carried over from Clojure,
12 | to allow compatibility when converting code to ClojureScript.
13 |
14 | Since there is only a single number type in JavaScript, 64-bit floating point, there is no
15 | reason to use the `==` operator in ClojureScript.
16 |
17 | Behavior on non-number arguments is undefined.
18 |
19 | ===== Related
20 | cljs.core/=
21 | cljs.core/identical?
22 |
23 | ===== Example#5ac342
24 |
25 | ```
26 | (== 1 1)
27 | ;;=> true
28 |
29 | (== 1 2)
30 | ;;=> false
31 | ```
32 |
33 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_GT.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/>
3 |
4 | ===== Signature
5 | [x]
6 | [x y]
7 | [x y & more]
8 |
9 | ===== Description
10 |
11 | Returns true if each successive number argument is less than the previous
12 | one, false otherwise.
13 |
14 | ===== Related
15 | cljs.core/>=
16 |
17 | ===== Example#67180c
18 |
19 | ```
20 | (> 1 2)
21 | ;;=> false
22 |
23 | (> 2 1)
24 | ;;=> true
25 |
26 | (> 2 2)
27 | ;;=> false
28 |
29 | (> 6 5 4 3 2)
30 | ;;=> true
31 | ```
32 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_GT=.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/>=
3 |
4 | ===== Signature
5 | [x]
6 | [x y]
7 | [x y & more]
8 |
9 | ===== Description
10 |
11 | Returns true if each successive number argument is less than or equal to the
12 | previous one, false otherwise.
13 |
14 | ===== Related
15 | cljs.core/>
16 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_GTEQ.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/>=
3 |
4 | ===== Signature
5 | [x]
6 | [x y]
7 | [x y & more]
8 |
9 | ===== Description
10 |
11 | Returns true if each successive number argument is less than or equal to the
12 | previous one, false otherwise.
13 |
14 | ===== Related
15 | cljs.core/>
16 |
17 | ===== Example#de73d7
18 |
19 | ```
20 | (>= 2 1)
21 | ;;=> true
22 |
23 | (>= 2 2)
24 | ;;=> true
25 |
26 | (>= 1 2)
27 | ;;=> false
28 |
29 | (>= 6 5 4 3 2)
30 | ;;=> true
31 | ```
32 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_LT.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/<
3 |
4 | ===== Signature
5 | [x]
6 | [x y]
7 | [x y & more]
8 |
9 | ===== Description
10 |
11 | Returns true if each successive number argument is greater than the previous
12 | one, false otherwise.
13 |
14 | ===== Related
15 | cljs.core/<=
16 |
17 | ===== Example#02e6d3
18 |
19 | ```
20 | (< 1 2)
21 | ;;=> true
22 |
23 | (< 2 1)
24 | ;;=> false
25 |
26 | (< 1 1)
27 | ;;=> false
28 |
29 | (< 2 3 4 5 6)
30 | ;;=> true
31 | ```
32 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_LT=.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/<=
3 |
4 | ===== Signature
5 | [x]
6 | [x y]
7 | [x y & more]
8 |
9 | ===== Description
10 |
11 | Returns true if each successive number argument is greater than or equal to the
12 | previous one, false otherwise.
13 |
14 | ===== Related
15 | cljs.core/<
16 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_LTEQ.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/<=
3 |
4 | ===== Signature
5 | [x]
6 | [x y]
7 | [x y & more]
8 |
9 | ===== Description
10 |
11 | Returns true if each successive number argument is greater than or equal to the
12 | previous one, false otherwise.
13 |
14 | ===== Related
15 | cljs.core/<
16 |
17 | ===== Example#adb3fd
18 |
19 | ```
20 | (<= 1 2)
21 | ;;=> true
22 |
23 | (<= 2 2)
24 | ;;=> true
25 |
26 | (<= 3 2)
27 | ;;=> false
28 |
29 | (<= 2 3 4 5 6)
30 | ;;=> true
31 | ```
32 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_PLUS.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/+
3 |
4 | ===== Signature
5 | []
6 | [x]
7 | [x y]
8 | [x y & more]
9 |
10 | ===== Description
11 |
12 | Returns the sum of nums.
13 |
14 | `(+)` returns 0.
15 |
16 | ===== Related
17 | cljs.core/*
18 | cljs.core/-
19 |
20 | ===== Example#650668
21 |
22 | ```
23 | (+)
24 | ;;=> 0
25 |
26 | (+ 1)
27 | ;;=> 1
28 |
29 | (+ -10)
30 | ;;=> -10
31 |
32 | (+ 1 2)
33 | ;;=> 3
34 |
35 | (+ 1 2 3)
36 | ;;=> 6
37 | ```
38 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_SLASH.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core//
3 |
4 | ===== Signature
5 | [x]
6 | [x y]
7 | [x y & more]
8 |
9 | ===== Description
10 |
11 | If no denominators are supplied, returns 1/numerator, else returns numerator
12 | divided by all of the denominators.
13 |
14 | ===== Related
15 | cljs.core/*
16 | cljs.core/quot
17 |
18 | ===== Example#5fe621
19 |
20 | ```
21 | (/ 6 3)
22 | ;;=> 2
23 |
24 | (/ 6 3 2)
25 | ;;=> 1
26 |
27 | (/ 10)
28 | ;;=> 0.1
29 |
30 | (/ 1 3)
31 | ;;=> 0.3333333333333333
32 | ```
33 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_STAR.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/*
3 |
4 | ===== Signature
5 | []
6 | [x]
7 | [x y]
8 | [x y & more]
9 |
10 | ===== Description
11 |
12 | Returns the product of nums.
13 |
14 | `(*)` returns 1.
15 |
16 | ===== Related
17 | cljs.core/+
18 | cljs.core//
19 |
20 | ===== Example#bc4a1f
21 |
22 | ```
23 | ;; there is an implicit 1
24 | (*)
25 | ;;=> 1
26 |
27 | ;; the implicit 1 comes into play
28 | (* 6)
29 | ;;=> 6
30 |
31 | (* 2 3)
32 | ;;=> 6
33 |
34 | (* 2 3 4)
35 | ;;=> 24
36 | ```
37 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_aclone.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/aclone
3 |
4 | ===== Signature
5 | [arr]
6 |
7 | ===== Description
8 |
9 | Creates a clone of the given JavaScript array `arr`. The result is a new
10 | JavaScript array, which is a shallow copy, not a deep copy.
11 |
12 | ===== Related
13 | cljs.core/array
14 | cljs.core/make-array
15 |
16 | ===== Example#422c4e
17 |
18 | ```
19 | (def a #js [1 2 3])
20 | (def b (aclone a))
21 | (aset b 0 4)
22 |
23 | a
24 | ;;=> #js [1 2 3]
25 |
26 | b
27 | ;;=> #js [4 2 3]
28 | ```
29 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_add-watch.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/add-watch
3 |
4 | ===== Signature
5 | [a key f]
6 |
7 | ===== Description
8 |
9 | Adds a watch function `f` to atom `a` that will execute when the value of `a`
10 | changes.
11 |
12 | The watch function takes 4 arguments: a key, the atom, its old state, and its
13 | new state.
14 |
15 | `key` should be a keyword and can be used with `remove-watch` to remove the
16 | watch function.
17 |
18 | ===== Related
19 | cljs.core/remove-watch
20 |
21 | ===== Example#2f2fe0
22 |
23 | ```
24 | (def a (atom {}))
25 |
26 | (add-watch a :logger
27 | (fn [_key _atom old-state new-state]
28 | (println "old:" old-state)
29 | (println "new:" new-state)))
30 |
31 | (swap! a assoc :foo "bar")
32 | ;;=> will print the following:
33 | ;; old: {}
34 | ;; new: {:foo "bar"}
35 | ```
36 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_aget.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/aget
3 |
4 | ===== Signature
5 | [array i]
6 | [array i & idxs]
7 |
8 | ===== Description
9 |
10 | Returns the value at index `i` from JavaScript arrays and objects.
11 |
12 | Can be used to retrieve nested properties with the additional `idxs` arguments.
13 |
14 | ===== Related
15 | cljs.core/..
16 | cljs.core/aset
17 | cljs.core/get
18 | cljs.core/nth
19 |
20 | ===== Example#e36007
21 |
22 | ```js
23 | // JavaScript
24 | var a = {"foo": [5, 6]};
25 |
26 | a["foo"];
27 | //=> [5, 6]
28 |
29 | a["foo"][0];
30 | //=> 5
31 | ```
32 |
33 | ```
34 | ;; ClojureScript
35 | (def a #js {:foo #js [5 6]})
36 |
37 | (aget a "foo")
38 | ;;=> #js [5 6]
39 |
40 | (aget a "foo" 0)
41 | ;;=> 5
42 | ```
43 |
44 | ===== Example#c9029e
45 |
46 | ```js
47 | // JavaScript
48 | document.location.href;
49 | //=> "http://example.com"
50 | ```
51 |
52 | The following are equivalent:
53 |
54 | ```
55 | ;; ClojureScript
56 | (aget js/document "location" "href")
57 | ;;=> "http://example.com"
58 |
59 | (.. js/document -location -href)
60 | ;;=> "http://example.com"
61 | ```
62 |
63 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_alength.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/alength
3 |
4 | ===== Signature
5 | [a]
6 |
7 | ===== Description
8 |
9 | For interop, it returns the length of a JavaScript array or string.
10 |
11 | ===== Related
12 | cljs.core/count
13 |
14 | ===== Example#26f79f
15 |
16 | ```
17 | (def a #js [1 2 3])
18 |
19 | (alength a)
20 | ;;=> 3
21 |
22 | (.-length a)
23 | ;;=> 3
24 |
25 | (aget a "length")
26 | ;;=> 3
27 |
28 | (count a)
29 | ;;=> 3
30 | ```
31 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_amap.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/amap
3 |
4 | ===== Signature
5 | [a idx ret expr]
6 |
7 | ===== Description
8 |
9 | For quickly creating a new JavaScript array by mapping an expression `expr`
10 | across a JavaScript array `a`. The expression can use `ret` as the current
11 | result, which is initialized to `a`. It can also use `idx` to get the current
12 | index.
13 |
14 | ===== Related
15 | cljs.core/map
16 |
17 | ===== Example#3a7471
18 |
19 | ```
20 | (def a #js [1 2 3])
21 | (amap a i ret (* 10 (aget a i)))
22 | ;;=> #js [10 20 30]
23 | ```
24 |
25 | ===== Example#0f57af
26 |
27 | You can also use `ret` inside the mapped expression if you want to use the
28 | current result:
29 |
30 | ```
31 | (def a #js [1 2 3])
32 | (amap a i ret (+ (if (pos? i)
33 | (aget ret (dec i))
34 | 0)
35 | (* 10 (aget a i))))
36 | ;;=> #js [10 30 60]
37 | ```
38 |
39 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_and.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/and
3 |
4 | ===== Type
5 | macro
6 |
7 | ===== Signature
8 | []
9 | [x]
10 | [x & next]
11 |
12 | ===== Description
13 |
14 | Evaluates arguments one at a time from left to right. If an argument returns
15 | logical false (nil or false), `and` returns that value and doesn't evaluate any
16 | of the other arguments, otherwise it returns the value of the last argument.
17 |
18 | `(and)` returns true.
19 |
20 | ===== Related
21 | cljs.core/or
22 | cljs.core/if
23 |
24 | ===== Example#a39a73
25 |
26 | ```
27 | (and)
28 | ;;=> true
29 |
30 | (and false)
31 | ;;=> false
32 |
33 | (and true)
34 | ;;=> true
35 |
36 | (and true true)
37 | ;;=> true
38 |
39 | (and true false)
40 | ;;=> false
41 |
42 | (and false false)
43 | ;;=> false
44 | ```
45 |
46 | ===== Example#766638
47 |
48 | `nil` and `false` are the only falsy values and everything else is truthy:
49 |
50 | ```
51 | (and "foo" "bar")
52 | ;;=> "bar"
53 |
54 | (and "foo" nil)
55 | ;;=> nil
56 |
57 | (and "foo" false)
58 | ;;=> false
59 |
60 | (and nil "foo")
61 | ;;=> nil
62 |
63 | (and false "foo")
64 | ;;=> false
65 | ```
66 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_apply.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/apply
3 |
4 | ===== Signature
5 | [f args]
6 | [f x args]
7 | [f x y args]
8 | [f x y z args]
9 | [f a b c d & args]
10 |
11 | ===== Description
12 |
13 | Applies function `f` to the argument list formed by prepending intervening
14 | arguments to `args`.
15 |
16 | ===== Related
17 | cljs.core/map
18 |
19 | ===== Example#174052
20 |
21 | ```
22 | (max 1 2 3)
23 | ;;=> 3
24 |
25 | (apply max [1 2 3])
26 | ;;=> 3
27 |
28 | (apply max 1 [2 3])
29 | ;;=> 3
30 | ```
31 |
32 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_areduce.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/areduce
3 |
4 | ===== Signature
5 | [a idx ret init expr]
6 |
7 | ===== Description
8 |
9 | For quickly reducing an expression `expr` across a JavaScript array `a`. The
10 | expression can use `ret` as the current result, which is initialized to `init`.
11 | It can also use `idx` to get the current index.
12 |
13 | ===== Related
14 | cljs.core/reduce
15 |
16 | ===== Example#20a389
17 |
18 | ```
19 | (def a #js [1 2 3])
20 | (areduce a i ret 0 (+ ret (aget a i)))
21 | ;;=> 6
22 | ```
23 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_array-map.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/array-map
3 |
4 | ===== Signature
5 | [& keyvals]
6 |
7 | ===== Description
8 |
9 | Returns a new array map (a map implemented with arrays) with the supplied mappings.
10 |
11 | `keyvals` must be an even number of forms.
12 |
13 | ===== Related
14 | cljs.core/assoc
15 | cljs.core/hash-map
16 | cljs.core/sorted-map
17 |
18 | ===== Example#198026
19 |
20 | ```
21 | (array-map :a 10)
22 | ;;=> {:a 10}
23 |
24 | (array-map :a 10 :b 20)
25 | ;;=> {:a 10 :b 20}
26 | ```
27 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_array-seq.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/array-seq
3 |
4 | ===== Signature
5 | [array]
6 | [array i]
7 |
8 | ===== Description
9 |
10 | Creates a `seq` from a JavaScript array or array-like object, starting at index `i` if given.
11 |
12 | ===== Related
13 | cljs.core/prim-seq
14 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_array.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/array
3 |
4 | ===== Signature
5 | [& args]
6 |
7 | ===== Description
8 |
9 | Creates a JavaScript array containing `args`.
10 |
11 | The tagged literal `#js [1 2 3]` is equivalent to `(array 1 2 3)`
12 |
13 | ===== Related
14 | cljs.core/aclone
15 | cljs.core/make-array
16 | cljs.core/clj->js
17 |
18 | ===== Example#3a546d
19 |
20 | ```
21 | (array 1 2 3)
22 | ;;=> #js [1 2 3]
23 |
24 | (apply array [1 2 3])
25 | ;;=> #js [1 2 3]
26 |
27 | #js [1 2 3]
28 | ;;=> #js [1 2 3]
29 | ```
30 |
31 | ===== Example#cca945
32 |
33 | When creating nested JavaScript arrays, you can opt to use `clj->js` instead:
34 |
35 | ```
36 | (array 1 2 (array 3 4))
37 | ;;=> #js [1 2 #js [3 4]]
38 |
39 | (clj->js [1 2 [3 4]])
40 | ;;=> #js [1 2 #js [3 4]]
41 | ```
42 |
43 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_arrayQMARK.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/array?
3 |
4 | ===== Signature
5 | [x]
6 |
7 | ===== Description
8 |
9 | Returns true if `x` is a JavaScript array, false otherwise.
10 |
11 | ===== Related
12 | cljs.core/object?
13 |
14 | ===== Example#39913c
15 |
16 | ```
17 | (array? #js [1 2 3])
18 | ;;=> true
19 |
20 | (array? [1 2 3])
21 | ;;=> false
22 |
23 | (array? "hi")
24 | ;;=> false
25 | ```
26 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_as-GT.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/as->
3 |
4 | ===== Type
5 | macro
6 |
7 | ===== Signature
8 | [expr name & forms]
9 |
10 | ===== Description
11 |
12 | Binds `name` to `expr`, evaluates the first form in the lexical context of that
13 | binding, then binds `name` to that result, repeating for each successive form,
14 | returning the result of the last form.
15 |
16 | Useful for when you want a threading macro to use different "places" at each
17 | form.
18 |
19 | ===== Related
20 | cljs.core/->
21 | cljs.core/->>
22 | cljs.core/cond->
23 | cljs.core/cond->>
24 | cljs.core/some->
25 | cljs.core/some->>
26 |
27 | ===== TODO
28 | add threading macro animations link here
29 |
30 | ===== Example#5e7eef
31 |
32 | ```
33 | (as-> [1 2 3 4] x
34 | (reduce + x)
35 | (/ x 2))
36 | ;;=> 5
37 | ```
38 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_aset.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/aset
3 |
4 | ===== Signature
5 | [array i val]
6 | [array idx idx2 & idxv]
7 |
8 | ===== Description
9 |
10 | Sets `val` at index `i` in JavaScript arrays and objects.
11 |
12 | Can be used to set nested properties with the additional `idxs` arguments.
13 |
14 | ===== Related
15 | cljs.core/aget
16 | cljs.core/set!
17 | cljs.core/assoc-in
18 |
19 | ===== Example#d1aa58
20 |
21 | ```js
22 | // JavaScript
23 | var a = {"foo": 3, "bar": [4, 5]};
24 |
25 | a["foo"] = 4;
26 | a;
27 | //=> {"foo": 4, "bar": [4, 5]}
28 |
29 | a["bar"][0] = 6;
30 | a;
31 | //=> {"foo": 4, "bar": [6, 5]}
32 | ```
33 |
34 | ```
35 | ;; ClojureScript
36 | (def a #js {:foo 3, :bar #js [4 5]})
37 |
38 | (aset a "foo" 4)
39 | a
40 | ;;=> #js {:foo 4, :bar #js [4 5]}
41 |
42 | (aset a "bar" 0 6)
43 | a
44 | ;;=> #js {:foo 4, :bar #js [6 5]}
45 | ```
46 |
47 | ===== Example#34bbf3
48 |
49 | ```js
50 | // JavaScript
51 | document.location.href = "http://example.com";
52 | ```
53 |
54 | ```
55 | ;; ClojureScript
56 | (aset js/document "location" "href" "http://example.com")
57 | ```
58 |
59 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_assert.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/assert
3 |
4 | ===== Signature
5 | [expr]
6 | [expr message]
7 |
8 | ===== Description
9 |
10 | Evaluates expression `expr` and throws an exception if it does not evaluate to
11 | logical true. Exception will include `message` if given.
12 |
13 | Returns `nil`.
14 |
15 | ===== Example#1dc16f
16 |
17 | ```
18 | (assert true)
19 | ;;=> nil
20 |
21 | (assert false)
22 | ;;=> Uncaught Error: Assert failed: false
23 |
24 | (assert (= 1 2) "1 is not 2")
25 | ;;=> Uncaught Error: Assert failed: 1 is not 2
26 | ;; (= 1 2)
27 | ```
28 |
29 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_assoc-in.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/assoc-in
3 |
4 | ===== Signature
5 | [m [k & ks] v]
6 |
7 | ===== Description
8 |
9 | Associates a value in a nested associative structure, where `ks` is a sequence
10 | of keys and `v` is the new value. Returns a new nested structure.
11 |
12 | If any levels do not exist, hash-maps will be created.
13 |
14 | ===== Related
15 | cljs.core/assoc
16 | cljs.core/update-in
17 | cljs.core/get-in
18 |
19 | ===== Example#e76f20
20 |
21 | ```
22 | (def users [{:name "James" :age 26}
23 | {:name "John" :age 43}])
24 | ```
25 |
26 | Update the age of the second (index 1) user:
27 |
28 | ```
29 | (assoc-in users [1 :age] 44)
30 | ;;=> [{:name "James", :age 26}
31 | ;; {:name "John", :age 44}]
32 | ```
33 |
34 | Insert the password of the second (index 1) user:
35 |
36 | ```
37 | (assoc-in users [1 :password] "nhoJ")
38 | ;;=> [{:name "James", :age 26}
39 | ;; {:password "nhoJ", :name "John", :age 43}]
40 | ```
41 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_assoc.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/assoc
3 |
4 | ===== Signature
5 | [coll k v]
6 | [coll k v & kvs]
7 |
8 | ===== Description
9 |
10 | assoc(iate)
11 |
12 | When applied to a map, returns a new map that contains the mapping of key(s) to
13 | val(s).
14 |
15 | Has no effect on the map type (hashed/sorted).
16 |
17 | When applied to a vector, returns a new vector that contains value `v` at index
18 | `k`.
19 |
20 | ===== Related
21 | cljs.core/assoc-in
22 | cljs.core/dissoc
23 | cljs.core/merge
24 |
25 | ===== Example#2fa7e0
26 |
27 | ```
28 | (def my-map {:foo 1})
29 |
30 | (assoc my-map :foo 2)
31 | ;;=> {:foo 2}
32 |
33 | (assoc my-map :bar 2)
34 | ;;=> {:foo 1 :bar 2}
35 |
36 | (assoc my-map :a 3 :b 4 :c 5 :d 6)
37 | ;;=> {:foo 1 :a 3 :b 4 :c 5 :d 6}
38 |
39 | ;; you must pass a value for every key
40 | (assoc my-map :foo)
41 | ;;=> WARNING: Wrong number of args (2) passed to cljs.core/assoc
42 | ```
43 |
44 | ===== Example#c06eac
45 |
46 | ```
47 | (def my-vec [1 2 3])
48 |
49 | (assoc my-vec 0 "foo")
50 | ;;=> ["foo" 2 3]
51 |
52 | (assoc my-vec 3 "foo")
53 | ;;=> Error: Index 3 out of bounds [0,0]
54 | ```
55 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_assocBANG.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/assoc!
3 |
4 | ===== Signature
5 | [tcoll key val]
6 | [tcoll key val & kvs]
7 |
8 | ===== Description
9 |
10 | assoc(iate) on transient collection
11 |
12 | When applied to a transient map, adds mapping of key(s) to val(s).
13 |
14 | When applied to a transient vector, sets the val at index. Note - index must
15 | be <= (count vector).
16 |
17 | Returns coll.
18 |
19 | ===== Related
20 | cljs.core/transient!
21 | cljs.core/persistent!
22 |
23 | ===== Example#7d1e6b
24 |
25 | ```
26 | (def tcoll (transient! {}))
27 | (assoc! tcoll :a 1)
28 | (assoc! tcoll :b 2)
29 |
30 | tcoll
31 | ;;=> #<[object Object]>
32 |
33 | (:a tcoll)
34 | ;;=> 1
35 |
36 | (:b tcoll)
37 | ;;=> 2
38 |
39 | (def a (persistent! tcoll))
40 | ;;=> {:a 1 :b 2}
41 | ```
42 |
43 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_associativeQMARK.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/associative?
3 |
4 | ===== Signature
5 | [coll]
6 |
7 | ===== Description
8 |
9 | Returns true if `coll` implements the `IAssociative` protocol, false otherwise.
10 |
11 | Maps and vectors are associative.
12 |
13 | ===== Example#29a37f
14 |
15 | ```
16 | (associative? [1 2 3])
17 | ;;=> true
18 |
19 | (associative? {:a 1 :b 2})
20 | ;;=> true
21 |
22 | (associative? #{1 2 3})
23 | ;;=> false
24 |
25 | (associative? '(1 2 3))
26 | ;;=> false
27 | ```
28 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_atom.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/atom
3 |
4 | ===== Signature
5 | [x]
6 | [x opts]
7 |
8 | ===== Description
9 |
10 | Creates and returns an atom with an initial value of `x`.
11 |
12 | `opts` is an optional map with optional keys `:meta` and `:validator`.
13 |
14 | `:meta` should be a [metadata-map](http://clojure.org/metadata) for the atom.
15 |
16 | `:validator` should be a validator function for the atom. See `set-validator!`
17 | for more information.
18 |
19 | ===== Related
20 | cljs.core/atom
21 | cljs.core/swap!
22 | cljs.core/reset!
23 | cljs.core/set-validator!
24 | cljs.core/get-validator
25 |
26 | ===== Example#e6a38a
27 |
28 | ```
29 | (def a (atom 1))
30 |
31 | @a
32 | ;;=> 1
33 |
34 | (reset! a 2)
35 | @a
36 | ;;=> 2
37 |
38 | (swap! a inc)
39 | @a
40 | ;;=> 3
41 | ```
42 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_binding.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/binding
3 |
4 | ===== Signature
5 | [bindings & body]
6 |
7 | ===== Description
8 |
9 | binding => var-symbol init-expr
10 |
11 | Creates new bindings for the (already-existing) vars, with the
12 | supplied initial values, executes the exprs in an implicit `do`, then
13 | re-establishes the bindings that existed before.
14 |
15 | The new bindings are made in parallel (unlike `let`); all init-exprs are
16 | evaluated before the vars are bound to their new values.
17 |
18 | ===== Related
19 | cljs.core/let
20 |
21 | ===== Example#7dd17f
22 |
23 | ```
24 | (def ^:dynamic *foo* 1)
25 |
26 | (defn do-something []
27 | (println *foo*))
28 |
29 | (binding [*foo* 2]
30 | (do-something))
31 | ;;=> prints 2
32 |
33 | *foo*
34 | ;;=> 1
35 | ```
36 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_bit-and-not.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/bit-and-not
3 |
4 | ===== Signature
5 | [x y]
6 | [x y & more]
7 |
8 | ===== Description
9 |
10 | Bitwise "and" `x` with bitwise "not" `y`. Same as `x & ~y` in JavaScript.
11 |
12 | ===== Related
13 | cljs.core/bit-and
14 | cljs.core/bit-not
15 |
16 | ===== Example#16f35d
17 |
18 | Bits can be entered using radix notation:
19 |
20 | ```
21 | (bit-and-not 2r1100 2r1010)
22 | ;;=> 4
23 | ;; 4 = 2r0100
24 | ```
25 |
26 | Same numbers in decimal:
27 |
28 | ```
29 | (bit-and-not 12 10)
30 | ;;=> 4
31 | ```
32 |
33 | Same result using `bit-and` and `bit-not`:
34 |
35 | ```
36 | (bit-and 12 (bit-not 10))
37 | ;;=> 4
38 | ```
39 |
40 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_bit-and.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/bit-and
3 |
4 | ===== Signature
5 | [x y]
6 | [x y & more]
7 |
8 | ===== Description
9 |
10 | Bitwise "and". Same as `x & y` in JavaScript.
11 |
12 | ===== Related
13 | cljs.core/bit-or
14 |
15 | ===== Example#3c0470
16 |
17 | Bits can be entered using radix notation:
18 |
19 | ```
20 | (bit-and 2r1100 2r1010)
21 | ;;=> 8
22 | ;; 8 = 2r1000
23 | ```
24 |
25 | Same numbers in decimal:
26 |
27 | ```
28 | (bit-and 12 10)
29 | ;;=> 8
30 | ```
31 |
32 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_bit-clear.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/bit-clear
3 |
4 | ===== Signature
5 | [x n]
6 |
7 | ===== Description
8 |
9 | Clear bit at index `n`. Same as `x & ~(1 << y)` in JavaScript.
10 |
11 | ===== Related
12 | cljs.core/bit-set
13 |
14 | ===== Example#0f6748
15 |
16 | Bits can be entered using radix notation:
17 |
18 | ```
19 | (bit-clear 2r1111 2)
20 | ;;=> 11
21 | ;; 11 = 2r1011
22 | ```
23 |
24 | Same numbers in decimal:
25 |
26 | ```
27 | (bit-clear 15 2)
28 | ;;=> 11
29 | ```
30 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_bit-flip.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/bit-flip
3 |
4 | ===== Signature
5 | [x n]
6 |
7 | ===== Description
8 |
9 | Flip bit at index `n`
10 |
11 | ===== Related
12 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_bit-not.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/bit-not
3 |
4 | ===== Signature
5 | [x]
6 |
7 | ===== Description
8 |
9 | Bitwise complement
10 |
11 | ===== Related
12 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_bit-or.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/bit-or
3 |
4 | ===== Signature
5 | [x y]
6 |
7 | ===== Description
8 |
9 | Bitwise or
10 |
11 | ===== Related
12 | cljs.core/bit-and
13 | cljs.core/bit-xor
14 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_bit-set.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/bit-set
3 |
4 | ===== Signature
5 | [x n]
6 |
7 | ===== Description
8 |
9 | Set bit at index `n`
10 |
11 | ===== Related
12 | cljs.core/bit-clear
13 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_bit-shift-left.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/bit-shift-left
3 |
4 | ===== Signature
5 | [x n]
6 |
7 | ===== Description
8 |
9 | Bitwise shift left
10 |
11 | ===== Related
12 | cljs.core/bit-shift-right
13 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_bit-shift-right.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/bit-shift-right
3 |
4 | ===== Signature
5 | [x n]
6 |
7 | ===== Description
8 |
9 | Bitwise shift right
10 |
11 | ===== Related
12 | cljs.core/bit-shift-left
13 | cljs.core/unsigned-bit-shift-right
14 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_bit-test.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/bit-test
3 |
4 | ===== Signature
5 | [x n]
6 |
7 | ===== Description
8 |
9 | Test bit at index `n`
10 |
11 | ===== Related
12 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_bit-xor.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/bit-xor
3 |
4 | ===== Signature
5 | [x y]
6 |
7 | ===== Description
8 |
9 | Bitwise exclusive or
10 |
11 | ===== Related
12 | cljs.core/bit-and
13 | cljs.core/bit-or
14 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_butlast.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/butlast
3 |
4 | ===== Signature
5 | [s]
6 |
7 | ===== Description
8 |
9 | Returns a sequence of all but the last item in `s`.
10 |
11 | `butlast` runs in linear time.
12 |
13 | ===== Related
14 | cljs.core/first
15 | cljs.core/rest
16 | cljs.core/last
17 | cljs.core/next
18 | cljs.core/drop-last
19 | cljs.core/take-last
20 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_case.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/case
3 |
4 | ===== Type
5 | macro
6 |
7 | ===== Signature
8 | [e & clauses]
9 |
10 | ===== Description
11 |
12 | Takes an expression and a set of clauses. Each clause can take the form of
13 | either:
14 |
15 | `test-constant result-expr`
16 |
17 | `(test-constant1 ... test-constantN) result-expr`
18 |
19 | The test-constants are not evaluated. They must be compile-time literals, and
20 | need not be quoted. If the expression is equal to a test-constant, the
21 | corresponding `result-expr` is returned. A single default expression can follow
22 | the clauses, and its value will be returned if no clause matches. If no default
23 | expression is provided and no clause matches, an Error is thrown.
24 |
25 | Unlike `cond` and `condp`, `case` does a constant-time dispatch, the clauses are
26 | not considered sequentially. All manner of constant expressions are acceptable
27 | in `case`, including numbers, strings, symbols, keywords, and ClojureScript
28 | composites thereof. Note that since lists are used to group multiple constants
29 | that map to the same expression, a vector can be used to match a list if needed.
30 | The test-constants need not be all of the same type.
31 |
32 | ===== Related
33 | cljs.core/cond
34 | cljs.core/condp
35 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_catch.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/catch
3 |
4 | ===== Type
5 | special form
6 |
7 | ===== Signature
8 | [exception-type name expr*]
9 |
10 | ===== Description
11 |
12 | `catch` should be used inside of a `try` expression.
13 |
14 | `exception-type` should be the type of exception thrown (usually `js/Error` or
15 | `js/Object`). When there is a match, the thrown exception will be bound to
16 | `name` inside of `expr*` and `expr*` will be evaluated and returned as the value
17 | of the `try` expression.
18 |
19 | ===== Related
20 | cljs.core/try
21 | cljs.core/finally
22 | cljs.core/throw
23 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_char.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/char
3 |
4 | ===== Signature
5 | [x]
6 |
7 | ===== Description
8 |
9 | Coerce to char
10 |
11 | ===== Related
12 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_clj-GTjs.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/clj->js
3 |
4 | ===== Signature
5 | [x]
6 |
7 | ===== Description
8 |
9 | Recursively transforms ClojureScript values to JavaScript.
10 |
11 | | ClojureScript | | JavaScript | |
12 | |---------------|--------|------------|---------|
13 | | Set | `#{}` | Array | `[]` |
14 | | Vector | `[]` | Array | `[]` |
15 | | List | `()` | Array | `[]` |
16 | | Keyword | `:foo` | String | `"foo"` |
17 | | Symbol | `bar` | String | `"bar"` |
18 | | Map | `{}` | Object | `{}` |
19 |
20 | ===== Related
21 | cljs.core/js->clj
22 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_collQMARK.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/coll?
3 |
4 | ===== Signature
5 | [x]
6 |
7 | ===== Description
8 |
9 | Returns true if `x` is a collection, false otherwise.
10 |
11 | Lists, maps, sets, and vectors are collections.
12 |
13 | ===== Related
14 | cljs.core/seq?
15 | cljs.core/list?
16 | cljs.core/sequential?
17 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_comp.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/comp
3 |
4 | ===== Signature
5 | []
6 | [f]
7 | [f g]
8 | [f g h]
9 | [f1 f2 f3 & fs]
10 |
11 | ===== Description
12 |
13 | Takes a set of functions (`fn`s) and returns a function that is the composition
14 | of those functions.
15 |
16 | The returned function takes a variable number of arguments, applies the
17 | rightmost of `fn`s to the arguments, the next `fn` (right-to-left) to the
18 | result, etc.
19 |
20 | `((comp a b c) x y)` => `(a (b (c x y)))`
21 |
22 | ===== Related
23 | cljs.core/partial
24 | cljs.core/juxt
25 |
26 | ===== TODO
27 |
28 | this needs work
--------------------------------------------------------------------------------
/docfiles/cljs.core_compare-and-setBANG.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/compare-and-set!
3 |
4 | ===== Signature
5 | [a oldval newval]
6 |
7 | ===== Description
8 |
9 | Atomically sets the value of atom `a` to `newval` if and only if the current
10 | value of the atom is identical to `oldval`.
11 |
12 | Returns true if set happened, false otherwise.
13 |
14 | ===== Related
15 | cljs.core/atom
16 | cljs.core/reset!
17 | cljs.core/swap!
18 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_compare.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/compare
3 |
4 | ===== Signature
5 | [x y]
6 |
7 | ===== Description
8 |
9 | Comparator.
10 |
11 | Returns a negative number, zero, or a positive number when `x` is logically
12 | "less than", "equal to", or "greater than" `y`.
13 |
14 | Uses `IComparable` if available and `google.array.defaultCompare` for objects of
15 | the same type. nil is treated as a special case and is always less than any
16 | other object.
17 |
18 | ===== Related
19 | cljs.core/sort-by
20 | cljs.core/sorted-set-by
21 | cljs.core/sorted-map-by
22 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_complement.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/complement
3 |
4 | ===== Signature
5 | [f]
6 |
7 | ===== Description
8 |
9 | Takes a function `f` and returns a function that takes the same arguments as
10 | `f`, has the same effects, if any, and returns the opposite truth value.
11 |
12 | ===== Related
13 | cljs.core/not
14 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_concat.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/concat
3 |
4 | ===== Signature
5 | []
6 | [x]
7 | [x y]
8 | [x y & zs]
9 |
10 | ===== Description
11 |
12 | Returns a lazy sequence representing the concatenation of the elements in the
13 | supplied collections.
14 |
15 | ===== Related
16 | cljs.core/conj
17 | cljs.core/into
18 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_cond-GT.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/cond->
3 |
4 | ===== Type
5 | macro
6 |
7 | ===== Signature
8 | [expr & clauses]
9 |
10 | ===== Description
11 |
12 | Takes an expression and a set of test/form pairs. Threads `expr` (via `->`)
13 | through each form for which the corresponding test expression is true.
14 |
15 | Note that, unlike `cond` branching, `cond->` threading does not short circuit
16 | after the first true test expression.
17 |
18 | ===== Related
19 | cljs.core/->
20 | cljs.core/->>
21 | cljs.core/cond->>
22 | cljs.core/cond
23 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_cond-GTGT.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/cond->>
3 |
4 | ===== Type
5 | macro
6 |
7 | ===== Signature
8 | [expr & clauses]
9 |
10 | ===== Description
11 |
12 | Takes an expression and a set of test/form pairs. Threads `expr` (via `->>`)
13 | through each form for which the corresponding test expression is true.
14 |
15 | Note that, unlike `cond` branching, `cond->>` threading does not short circuit
16 | after the first true test expression.
17 |
18 | ===== Related
19 | cljs.core/->
20 | cljs.core/->>
21 | cljs.core/cond->
22 | cljs.core/cond
23 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_cond.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/cond
3 |
4 | ===== Type
5 | macro
6 |
7 | ===== Signature
8 | [& clauses]
9 |
10 | ===== Description
11 |
12 | `clauses` must be an even number of forms, ie: `(cond t1 e1, t2 e2, t3 e3)`.
13 | Each test `t` is evaluated one at a time. If a test returns logical true, `cond`
14 | evaluates and returns the corresponding expression `e` and does not evaluate any
15 | of the other tests or expressions.
16 |
17 | It is idiomatic to provide a default case as the last test pair using the
18 | keyword `:else` (a keyword always evaluates to logical true).
19 |
20 | `(cond)` returns nil.
21 |
22 | ===== Related
23 | cljs.core/condp
24 | cljs.core/case
25 | cljs.core/if
26 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_condp.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/condp
3 |
4 | ===== Type
5 | macro
6 |
7 | ===== Signature
8 | [pred expr & clauses]
9 |
10 | ===== Description
11 |
12 | Takes a binary predicate, an expression, and a set of clauses. There are two
13 | kinds of clauses:
14 |
15 | Binary clause: `test-expr` `result-expr`
16 |
17 | Ternary clause: `test-expr` `:>>` `result-fn`
18 | (Note: `:>>` is an ordinary keyword)
19 |
20 | For each clause, `(pred test-expr expr)` is evaluated. If it returns logical
21 | true, the clause is a match.
22 |
23 | If a binary clause matches, its `result-expr` is returned.
24 |
25 | If a ternary clause matches, its `result-fn` is called with the result of the
26 | predicate and returned by `condp`. `result-fn` should take one argument.
27 |
28 | A single default expression can follow the clauses, and its value will be
29 | returned if no clause matches.
30 |
31 | If no default expression is provided and no clause matches, an Error is thrown.
32 |
33 | ===== Related
34 | cljs.core/cond
35 | cljs.core/if
36 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_conj.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/conj
3 |
4 | ===== Signature
5 | []
6 | [coll]
7 | [coll x]
8 | [coll x & xs]
9 |
10 | ===== Description
11 |
12 | conj(oin)
13 |
14 | Returns a new collection with the `x`s "added" to `coll`.
15 |
16 | `conj` adds items to the end of a vector, the beginning of a list, and into a
17 | set.
18 |
19 | `conj` works with maps by merging and also supports vector pairs with two
20 | elements.
21 |
22 | Multiple `x`s are added in order, as if called one at a time.
23 |
24 | `(conj nil item)` returns `(item)`.
25 |
26 | ===== Related
27 | cljs.core/cons
28 | cljs.core/into
29 | cljs.core/merge
30 | cljs.core/peek
31 | cljs.core/pop
32 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_cons.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/cons
3 |
4 | ===== Signature
5 | [x coll]
6 |
7 | ===== Description
8 |
9 | Returns a new sequence where `x` is the first element and `coll` is the rest.
10 |
11 | ===== Related
12 | cljs.core/conj
13 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_constantly.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/constantly
3 |
4 | ===== Signature
5 | [x]
6 |
7 | ===== Description
8 | Returns a function that takes any number of arguments and always returns `x`.
9 |
10 | ===== Related
11 | cljs.core/repeatedly
12 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_containsQMARK.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/contains?
3 |
4 | ===== Signature
5 | [coll k]
6 |
7 | ===== Description
8 |
9 | Returns true if `k` is present in `coll`, otherwise returns false.
10 |
11 | Note that for numerically indexed collections like vectors and arrays, this
12 | tests if the numeric key is within the range of indexes.
13 |
14 | `contains?` operates in constant or logarithmic time; it will not perform a
15 | linear search for a value.
16 |
17 | ===== Related
18 | cljs.core/some
19 | cljs.core/get
20 | clojure.string/includes?
21 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_count.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/count
3 |
4 | ===== Signature
5 | [x]
6 |
7 | ===== Description
8 |
9 | Returns the number of items in `x`.
10 |
11 | `count` works on arrays, lists, maps, sets, strings, and vectors.
12 |
13 | `(count nil)` returns 0.
14 |
15 | ===== Related
16 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_countedQMARK.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/counted?
3 |
4 | ===== Signature
5 | [x]
6 |
7 | ===== Description
8 |
9 | Returns true if `x` executes `count` in constant time, false otherwise.
10 |
11 | Lists, maps, sets, strings, and vectors can be counted in constant time.
12 |
13 | ===== Related
14 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_cycle.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/cycle
3 |
4 | ===== Signature
5 | [coll]
6 |
7 | ===== Description
8 |
9 | Returns an infinite lazy sequence of repetitions of the items in `coll`.
10 |
11 | ===== Related
12 | cljs.core/lazy-seq
13 | cljs.core/repeatedly
14 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_dec.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/dec
3 |
4 | ===== Signature
5 | [x]
6 |
7 | ===== Description
8 |
9 | Returns a number one less than `x`.
10 |
11 | ===== Related
12 | cljs.core/inc
13 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_declare.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/declare
3 |
4 | ===== Type
5 | macro
6 |
7 | ===== Signature
8 | [& names]
9 |
10 | ===== Description
11 |
12 | Uses `def` to establish symbols of `names` with no bindings.
13 |
14 | Useful for making forward declarations.
15 |
16 | ===== Related
17 | cljs.core/def
18 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_def.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/def
3 |
4 | ===== Type
5 | special form
6 |
7 | ===== Signature
8 | [symbol]
9 | [symbol init?]
10 | [symbol doc-string? init?]
11 |
12 | ===== Description
13 |
14 | Creates a global variable with the name of `symbol` and a namespace of the
15 | current namespace.
16 |
17 | If `init` is supplied, it is evaluated and the result is assigned to `symbol`, otherwise `symbol` is `nil`.
18 |
19 | `doc-string` is an optional documentation string.
20 |
21 | `def` is one of ClojureScript's [special forms](http://clojure.org/special_forms)
22 | and is used by many macros to define common elements (ie: `defn`, `defmacro`,
23 | etc).
24 |
25 | ===== Related
26 | cljs.core/defn
27 | cljs.core/fn
28 | cljs.core/defmacro
29 | cljs.core/defmulti
30 |
31 | ===== TODO
32 |
33 | Need to include something about metadata here?
34 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_defn-.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/defn-
3 |
4 | ===== Type
5 | macro
6 |
7 | ===== Signature
8 | [name & decls]
9 |
10 | ===== Description
11 |
12 | Same as `defn`, but adds `{:private true}` metadata to the definition.
13 |
14 | Note: `:private` metadata is not currently enforced by the ClojureScript
15 | compiler.
16 |
17 | ===== Related
18 | cljs.core/defn
19 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_defn.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/defn
3 |
4 | ===== Type
5 | macro
6 |
7 | ===== Signature
8 | [name doc-string? attr-map? [params*] prepost-map? body]
9 | [name doc-string? attr-map? ([params*] prepost-map? body) + attr-map?]
10 |
11 | ===== Description
12 |
13 | Defines a function.
14 |
15 | `doc-string?` is an optional documentation string.
16 |
17 | `attr-map?` is an optional map of [metadata](http://clojure.org/metadata) to
18 | attach to the global variable name.
19 |
20 | `prepost-map?` is an optional map with optional keys `:pre` and `:post` that
21 | contain collections of [pre or post conditions](http://blog.fogus.me/2009/12/21/clojures-pre-and-post/)
22 | for the function.
23 |
24 |
25 |
26 |
27 |
Code
28 |
Expands To
29 |
30 |
31 |
32 | (defn foo [a b c]
33 | (\* a b c))
34 |
35 | (def foo
36 | (fn [a b c]
37 | (\* a b c)))
38 |
39 | ===== Related
40 | cljs.core/def
41 | cljs.core/defn-
42 | cljs.core/defmacro
43 | cljs.core/fn
44 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_deref.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/deref
3 |
4 | ===== Signature
5 | [x]
6 |
7 | ===== Description
8 |
9 | Returns the current value of atom `x`.
10 |
11 | The `@` reader macro is often used instead of `deref`. `@foo` is the same thing
12 | as `(deref foo)`.
13 |
14 | ===== Related
15 | cljs.core/atom
16 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_disj.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/disj
3 |
4 | ===== Signature
5 | [coll]
6 | [coll k]
7 | [coll k & ks]
8 |
9 | ===== Description
10 |
11 | disj(oin). Returns a new set of the same (hashed/sorted) type, that does not
12 | contain key(s).
13 |
14 | ===== Related
15 | cljs.core/dissoc
16 | cljs.core/disj!
17 | clojure.set/difference
18 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_dissoc.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/dissoc
3 |
4 | ===== Signature
5 | [coll]
6 | [coll k]
7 | [coll k & ks]
8 |
9 | ===== Description
10 |
11 | dissoc(iate)
12 |
13 | Returns a new map that does not contain a mapping for key(s).
14 |
15 | Has no effect on the map type (hashed/sorted).
16 |
17 | ===== Related
18 | cljs.core/assoc
19 | cljs.core/disj
20 | cljs.core/select-keys
21 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_distinct.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/distinct
3 |
4 | ===== Signature
5 | [coll]
6 |
7 | ===== Description
8 |
9 | Returns a lazy sequence of the elements of `coll` with duplicates removed.
10 |
11 | ===== Related
12 | cljs.core/distinct?
13 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_distinctQMARK.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/distinct?
3 |
4 | ===== Signature
5 | [x]
6 | [x y]
7 | [x y & more]
8 |
9 | ===== Description
10 |
11 | Returns true if no two of the arguments are `=`
12 |
13 | ===== Related
14 | cljs.core/distinct
15 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_doall.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/doall
3 |
4 | ===== Signature
5 | [coll]
6 | [n coll]
7 |
8 | ===== Description
9 |
10 | Forces evaluation of a lazy sequence. Often used to see the effects of a
11 | sequence produced via functions that have side effects.
12 |
13 | `doall` walks through the successive `next`s of the sequence, returning the head
14 | and causing the entire sequence to reside in memory at one time.
15 |
16 | ===== Related
17 | cljs.core/dorun
18 | cljs.core/doseq
19 |
20 | ===== TODO
21 |
22 | What does `n` do here? This description needs work and probably an example.
23 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_dorun.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/dorun
3 |
4 | ===== Signature
5 | [coll]
6 | [n coll]
7 |
8 | ===== Description
9 |
10 | Forces evaluation of a lazy sequence. Often used to see the effects of a
11 | sequence produced via functions that have side effects.
12 |
13 | `dorun` walks through the successive `next`s of the sequence and returns nil.
14 |
15 | ===== Related
16 | cljs.core/doall
17 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_doseq.cljsdoc:
--------------------------------------------------------------------------------
1 | TODO: this needs a better explanation and example
2 |
3 | ===== Name
4 | cljs.core/doseq
5 |
6 | ===== Type
7 | macro
8 |
9 | ===== Signature
10 | [seq-exprs & body]
11 |
12 | ===== Description
13 |
14 | Repeatedly executes `body` (presumably for side-effects) with bindings and
15 | filtering as provided by `for`. Does not retain the head of the sequence.
16 |
17 | Returns nil.
18 |
19 | ===== Related
20 | cljs.core/doall
21 | cljs.core/dorun
22 | cljs.core/for
23 | cljs.core/dotimes
24 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_dotimes.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/dotimes
3 |
4 | ===== Type
5 | macro
6 |
7 | ===== Signature
8 | [[name n] & body]
9 |
10 | ===== Description
11 |
12 | Repeatedly executes `body` (presumably for side-effects) with `name` bound to
13 | integers from `0` through `n-1`.
14 |
15 | ===== Related
16 | cljs.core/repeat
17 | cljs.core/for
18 | cljs.core/doseq
19 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_drop-last.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/drop-last
3 |
4 | ===== Signature
5 | [s]
6 | [n s]
7 |
8 | ===== Description
9 |
10 | Return a lazy sequence of all but the last `n` items in `s`.
11 |
12 | `n` defaults to 1.
13 |
14 | ===== Related
15 | cljs.core/drop
16 | cljs.core/drop-while
17 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_drop-while.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/drop-while
3 |
4 | ===== Signature
5 | [pred]
6 | [pred coll]
7 |
8 | ===== Description
9 |
10 | Returns a lazy sequence of the items in `coll` starting from the first item for
11 | which `(pred item)` returns logical false.
12 |
13 | Returns a stateful transducer when no collection is provided.
14 |
15 | ===== Related
16 | cljs.core/take-while
17 | cljs.core/split-with
18 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_drop.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/drop
3 |
4 | ===== Signature
5 | [n]
6 | [n coll]
7 |
8 | ===== Description
9 |
10 | Returns a lazy sequence of all but the first `n` items in `coll`.
11 |
12 | Returns a stateful transducer when no collection is provided.
13 |
14 | ===== Related
15 | cljs.core/take
16 | cljs.core/drop-last
17 | cljs.core/drop-while
18 | cljs.core/nthnext
19 | cljs.core/nthrest
20 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_empty.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/empty
3 |
4 | ===== Signature
5 | [coll]
6 |
7 | ===== Description
8 |
9 | Returns an empty collection of the same category as `coll`.
10 |
11 | Returns nil if `coll` is nil.
12 |
13 | ===== Related
14 | cljs.core/not-empty
15 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_emptyQMARK.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/empty?
3 |
4 | ===== Signature
5 | [coll]
6 |
7 | ===== Description
8 |
9 | Returns true if `coll` has no items - same as `(not (seq coll))`.
10 |
11 | Please use the idiom `(seq x)` rather than `(not (empty? x))`.
12 |
13 | ===== Related
14 | cljs.core/seq
15 | clojure.string/blank?
16 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_evenQMARK.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/even?
3 |
4 | ===== Signature
5 | [n]
6 |
7 | ===== Description
8 |
9 | Returns true if `n` is an even number.
10 |
11 | Throws an exception if `n` is not an integer.
12 |
13 | ===== Related
14 | cljs.core/odd?
15 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_every-pred.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/every-pred
3 |
4 | ===== Signature
5 | [p]
6 | [p1 p2]
7 | [p1 p2 p3]
8 | [p1 p2 p3 & ps]
9 |
10 | ===== Description
11 |
12 | Takes a set of predicate functions and returns a function `f` that returns true
13 | if all of its composing predicates return a logical true value against all of
14 | its arguments, else it returns false.
15 |
16 | Note that `f` is short-circuiting in that it will stop execution on the first
17 | argument that triggers a logical false result against the original predicates.
18 |
19 | ===== Related
20 | cljs.core/some-fn
21 | cljs.core/and
22 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_everyQMARK.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/every?
3 |
4 | ===== Signature
5 | [pred coll]
6 |
7 | ===== Description
8 |
9 | Returns true if `(pred x)` is logical true for every `x` in `coll`, else false.
10 |
11 | ===== Related
12 | cljs.core/some
13 | cljs.core/not-any?
14 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_falseQMARK.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/false?
3 |
4 | ===== Signature
5 | [x]
6 |
7 | ===== Description
8 |
9 | Returns true if `x` is the value false, false otherwise.
10 |
11 | ===== Related
12 | cljs.core/true?
13 | cljs.core/not
14 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_ffirst.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/ffirst
3 |
4 | ===== Signature
5 | [coll]
6 |
7 | ===== Description
8 |
9 | Same as `(first (first coll))`.
10 |
11 | ===== Related
12 | cljs.core/first
13 | cljs.core/fnext
14 | cljs.core/nfirst
15 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_filter.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/filter
3 |
4 | ===== Signature
5 | [pred]
6 | [pred coll]
7 |
8 | ===== Description
9 |
10 | Returns a lazy sequence of the items in coll for which `(pred item)` returns
11 | logical true.
12 |
13 | `pred` must be free of side-effects.
14 |
15 | Returns a transducer when no collection is provided.
16 |
17 | ===== Related
18 | cljs.core/remove
19 | cljs.core/keep
20 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_filterv.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/filterv
3 |
4 | ===== Signature
5 | [pred coll]
6 |
7 | ===== Description
8 |
9 | Returns a vector of the items in `coll` for which `(pred item)` returns true.
10 |
11 | `pred` must be free of side-effects.
12 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_finally.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/finally
3 |
4 | ===== Type
5 | special form
6 |
7 | ===== Signature
8 | [expr*]
9 |
10 | ===== Description
11 |
12 | `finally` should be the last form inside of a `try` expression. It is optional.
13 |
14 | `finally` clauses are always evaluated for their side effects whether there was
15 | an error or not, but they are never the return value of a `try` expression.
16 |
17 | ===== Related
18 | cljs.core/try
19 | cljs.core/catch
20 | cljs.core/throw
21 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_find.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/find
3 |
4 | ===== Signature
5 | [coll k]
6 |
7 | ===== Description
8 |
9 | Returns the map entry for key `k`, or nil if `k` is not found.
10 |
11 | ===== Related
12 | cljs.core/get
13 | cljs.core/get-in
14 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_first.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/first
3 |
4 | ===== Signature
5 | [coll]
6 |
7 | ===== Description
8 |
9 | Returns the first item in `coll` and calls `seq` on its argument.
10 |
11 | Returns nil when `coll` is nil.
12 |
13 | ===== Related
14 | cljs.core/rest
15 | cljs.core/next
16 | cljs.core/nth
17 | cljs.core/second
18 | cljs.core/take
19 | cljs.core/ffirst
20 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_flatten.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/flatten
3 |
4 | ===== Signature
5 | [x]
6 |
7 | ===== Description
8 |
9 | Takes any nested combination of sequential things (lists, vectors, etc.) and
10 | returns their contents as a single, flat sequence.
11 |
12 | `(flatten nil)` returns nil.
13 |
14 | ===== Related
15 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_fn.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/fn
3 |
4 | ===== Type
5 | special form
6 |
7 | ===== Signature
8 | [name? [params*] prepost-map? body]
9 | [name? ([params*] prepost-map? body)+]
10 |
11 | ===== Description
12 |
13 | Defines a function.
14 |
15 | `name?` is an optional name of the function to be used inside `body`. This is
16 | useful for recursive calls. Note that `name?` in `fn` is not the same as the
17 | `name` argument to `defn`, which defines a global symbol for the function.
18 |
19 | `params*` are the arguments to the function and a binding form for the symbols
20 | that the arguments will take inside the body of the function. Functions can have
21 | arity of 0-20 and there is no runtime enforcement of arity when calling a
22 | function (just like in JavaScript).
23 |
24 | `prepost-map?` is an optional map with optional keys `:pre` and `:post` that
25 | contain collections of [pre or post conditions](http://blog.fogus.me/2009/12/21/clojures-pre-and-post/)
26 | for the function.
27 |
28 | `body` is a series of expressions that execute when the function is called. The
29 | arguments to the function are mapped to symbols in `params*` and are available
30 | in `body`. The value of the last expression in `body` is the return value of
31 | calling the function.
32 |
33 | ===== Related
34 | cljs.core/defn
35 | cljs.core/defn-
36 |
37 | ===== TODO
38 |
39 | need to provide a link to some function definition examples; we probably need
40 | a whole page dedicated to fn expressions
41 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_fnQMARK.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/fn?
3 |
4 | ===== Signature
5 | [f]
6 |
7 | ===== Description
8 |
9 | Returns true if `f` is a function, false otherwise.
10 |
11 | ===== Related
12 | cljs.core/ifn?
13 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_fnext.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/fnext
3 |
4 | ===== Signature
5 | [coll]
6 |
7 | ===== Description
8 |
9 | Same as `(first (next coll))`
10 |
11 | ===== Related
12 | cljs.core/ffirst
13 | cljs.core/second
14 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_fnil.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/fnil
3 |
4 | ===== Signature
5 | [f x]
6 | [f x y]
7 | [f x y z]
8 |
9 | ===== Description
10 |
11 | Takes a function `f`, and returns a function that calls `f`, replacing a nil
12 | first argument to `f` with the supplied value `x`. Higher arity versions can
13 | replace arguments in the second and third positions (`y`, `z`).
14 |
15 | Note that the function `f` can take any number of arguments, not just the one(s)
16 | being nil-patched.
17 |
18 | ===== Related
19 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_for.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/for
3 |
4 | ===== Type
5 | macro
6 |
7 | ===== Signature
8 | [seq-exprs body-expr]
9 |
10 | ===== Description
11 |
12 | List comprehension.
13 |
14 | Takes a vector of one or more binding-form/collection-expr pairs, each followed
15 | by zero or more modifiers, and yields a lazy sequence of evaluations of expr.
16 |
17 | Collections are iterated in a nested fashion, rightmost fastest, and nested
18 | coll-exprs can refer to bindings created in prior binding-forms. Supported
19 | modifiers are: `:let [binding-form expr ...]`, `:while test`, `:when test`.
20 |
21 | ===== Related
22 | cljs.core/doseq
23 | cljs.core/doall
24 | cljs.core/recur
25 |
26 | ===== TODO
27 |
28 | This description is completely unreadable to someone new to the
29 | language and confusing even to someone with moderate experience (ie: me)
30 |
31 | Need to simplify and provide an inline example.
32 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_frequencies.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/frequencies
3 |
4 | ===== Signature
5 | [coll]
6 |
7 | ===== Description
8 |
9 | Returns a map from distinct items in `coll` to the number of times they appear.
10 |
11 | `(frequencies [:a :a :b])` => `{:a 2, :b 1}`
12 |
13 | ===== Related
14 | cljs.core/group-by
15 | cljs.core/distinct
16 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_get-in.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/get-in
3 |
4 | ===== Signature
5 | [m ks]
6 | [m ks not-found]
7 |
8 | ===== Description
9 |
10 | Returns the value in a nested associative structure, where `ks` is a sequence of
11 | keys.
12 |
13 | Returns nil if the key is not found, or `not-found` if supplied.
14 |
15 | ===== Related
16 | cljs.core/assoc-in
17 | cljs.core/update-in
18 | cljs.core/find
19 | cljs.core/get
20 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_get-validator.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/get-validator
3 |
4 | ===== Signature
5 | [a]
6 |
7 | ===== Description
8 |
9 | Returns the validator function for atom `a`.
10 |
11 | ===== Related
12 | cljs.core/atom
13 | cljs.core/set-validator!
14 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_get.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/get
3 |
4 | ===== Signature
5 | [o k]
6 | [o k not-found]
7 |
8 | ===== Description
9 |
10 | Returns the value mapped to key `k`.
11 |
12 | Returns `not-found` or nil if `k` is not present in `o`.
13 |
14 | ===== Related
15 | cljs.core/get-in
16 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_group-by.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/group-by
3 |
4 | ===== Signature
5 | [f coll]
6 |
7 | ===== Description
8 |
9 | Returns a map of the elements of `coll` keyed by the result of running `f` on
10 | each element.
11 |
12 | The value at each key will be a vector of the corresponding elements in the
13 | order they appeared in `coll`.
14 |
15 | ===== Related
16 | cljs.core/partition-by
17 | cljs.core/frequencies
18 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_hash-map.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/hash-map
3 |
4 | ===== Signature
5 | [& keyvals]
6 |
7 | ===== Description
8 |
9 | Returns a new hash map with supplied mappings.
10 |
11 | `keyvals` must be an even number of forms.
12 |
13 | ===== Related
14 | cljs.core/array-map
15 | cljs.core/sorted-map
16 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_hash-set.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/hash-set
3 |
4 | ===== Signature
5 | []
6 | [& keys]
7 |
8 | ===== Description
9 |
10 | Returns a new hash set with supplied `keys`.
11 |
12 | Any equal keys are handled as if by repeated uses of `conj`.
13 |
14 | ===== Related
15 | cljs.core/set
16 | cljs.core/sorted-set
17 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_identicalQMARK.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/identical?
3 |
4 | ===== Signature
5 | [x y]
6 |
7 | ===== Return Type
8 | boolean
9 |
10 | ===== Description
11 |
12 | Returns true if `x` and `y` are the same object, false otherwise.
13 |
14 | ===== Related
15 | cljs.core/=
16 | cljs.core/==
17 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_identity.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/identity
3 |
4 | ===== Signature
5 | [x]
6 |
7 | ===== Description
8 |
9 | Returns its argument.
10 |
11 | ===== Related
12 | cljs.core/nil?
13 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_if-let.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/if-let
3 |
4 | ===== Type
5 | macro
6 |
7 | ===== Signature
8 | [[x test] then]
9 | [[x test] then else]
10 |
11 | ===== Description
12 |
13 | When `test` is logical true, evaluates `then` with the value of `test` bound to
14 | `x`. Otherwise, evaluates `else` with no bindings.
15 |
16 | `else` defaults to nil.
17 |
18 | ===== Related
19 | cljs.core/when-let
20 | cljs.core/if
21 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_if-not.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/if-not
3 |
4 | ===== Type
5 | macro
6 |
7 | ===== Signature
8 | [test then]
9 | [test then else]
10 |
11 | ===== Description
12 |
13 | If `test` is false or nil, evaluates and returns `then`. Otherwise, evaluates
14 | and returns `else`. `else` defaults to nil if not provided.
15 |
16 | ===== Related
17 | cljs.core/if
18 | cljs.core/when-not
19 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_if-some.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/if-some
3 |
4 | ===== Type
5 | macro
6 |
7 | ===== Signature
8 | [[x test] then]
9 | [[x test] then else]
10 |
11 | ===== Description
12 |
13 | If `test` is not nil, evaluates `then` with `x` bound to the value of `test`. If
14 | not, yields `else`.
15 |
16 | ===== Related
17 | cljs.core/when-some
18 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_if.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/if
3 |
4 | ===== Type
5 | special form
6 |
7 | ===== Signature
8 | [test then else?]
9 |
10 | ===== Description
11 |
12 | If `test` is not false or nil, `then` is evaluated and returned. Otherwise,
13 | `else?` is evaluated and returned. `else?` defaults to nil if not provided.
14 |
15 | `if` is one of ClojureScript's [special forms](http://clojure.org/special_forms)
16 | and is a fundamental building block of the language. All other conditionals in
17 | ClojureScript are based on `if`s notion of truthiness (ie: anything other than
18 | false or nil).
19 |
20 | ===== Related
21 | cljs.core/cond
22 | cljs.core/when
23 | cljs.core/if-let
24 | cljs.core/if-not
25 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_ifnQMARK.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/ifn?
3 |
4 | ===== Signature
5 | [f]
6 |
7 | ===== Description
8 |
9 | Returns true if `f` implements the `IFn` protocol, false otherwise.
10 |
11 | Functions, keywords, map, sets, and vectors can be called as functions.
12 |
13 | ===== Related
14 | cljs.core/fn?
15 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_inc.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/inc
3 |
4 | ===== Signature
5 | [x]
6 |
7 | ===== Description
8 |
9 | Returns a number one greater than `x`.
10 |
11 | ===== Related
12 | cljs.core/dec
13 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_instanceQMARK.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/instance?
3 |
4 | ===== Signature
5 | [t o]
6 |
7 | ===== Description
8 |
9 | Returns true if `o` is an instance of type `t`, false otherwise.
10 |
11 | ===== Related
12 | cljs.core/type
13 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_int.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/int
3 |
4 | ===== Signature
5 | [x]
6 |
7 | ===== Description
8 |
9 | Coerces `x` to an integer by stripping decimal places.
10 |
11 | ===== Related
12 | cljs.core/char
13 | cljs.core/integer?
14 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_integerQMARK.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/integer?
3 |
4 | ===== Signature
5 | [n]
6 |
7 | ===== Description
8 |
9 | Returns true if `n` is an integer, false otherwise.
10 |
11 | ===== Related
12 | cljs.core/int
13 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_interleave.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/interleave
3 |
4 | ===== Signature
5 | [c1 c2]
6 | [c1 c2 & colls]
7 |
8 | ===== Description
9 |
10 | Returns a lazy seq of the first item in each collection, then the second items,
11 | then the third, etc.
12 |
13 | ===== Related
14 | cljs.core/interpose
15 | cljs.core/zipmap
16 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_interpose.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/interpose
3 |
4 | ===== Signature
5 | [sep coll]
6 |
7 | ===== Description
8 |
9 | Returns a lazy seq of the elements of `coll` separated by `sep`.
10 |
11 | ===== Related
12 | cljs.core/interleave
13 | clojure.string/join
14 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_into-array.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/into-array
3 |
4 | ===== Signature
5 | [aseq]
6 |
7 | ===== Description
8 |
9 | Returns a new JavaScript array from the elements of `aseq`.
10 |
11 | ===== Related
12 | cljs.core/to-array
13 | cljs.core/make-array
14 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_into.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/into
3 |
4 | ===== Signature
5 | [to from]
6 | [to xform from]
7 |
8 | ===== Description
9 |
10 | Returns a new collection consisting of `to` with all of the items of `from`
11 | "added" using `conj`.
12 |
13 | A transducer may be supplied as `xform`.
14 |
15 | ===== Related
16 | cljs.core/conj
17 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_iterate.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/iterate
3 |
4 | ===== Signature
5 | [f x]
6 |
7 | ===== Description
8 |
9 | Returns a lazy sequence of `x`, `(f x)`, `(f (f x))` etc.
10 |
11 | `f` must be free of side-effects.
12 |
13 | ===== Related
14 | cljs.core/cycle
15 | cljs.core/repeatedly
16 | cljs.core/repeat
17 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_js-GTclj.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/js->clj
3 |
4 | ===== Signature
5 | [x]
6 | [x & opts]
7 |
8 | ===== Description
9 |
10 | Recursively transforms JavaScript arrays into ClojureScript vectors, and
11 | JavaScript objects into ClojureScript maps.
12 |
13 | Pass options `:keywordize-keys true` to recursively convert object property
14 | names from strings to keywords.
15 |
16 | `(js->clj js-data :keywordize-keys true)`
17 |
18 | Note that `js->clj` is not optimized for speed and the [transit.cljs] library is
19 | recommended when parsing large amounts of JSON data.
20 |
21 | [transit.cljs]:http://swannodette.github.io/2014/07/26/transit-clojurescript
22 |
23 | ===== Related
24 | cljs.core/clj->js
25 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_js-delete.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/js-delete
3 |
4 | ===== Signature
5 | [obj key]
6 |
7 | ===== Description
8 |
9 | Deletes property `key` in JavaScript object `obj`.
10 |
11 | Uses the JavaScript `delete` operator.
12 |
13 | ===== Related
14 | cljs.core/dissoc
15 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_js-obj.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/js-obj
3 |
4 | ===== Signature
5 | [& keyvals]
6 |
7 | ===== Description
8 |
9 | Returns a new JavaScript object using the supplied mappings.
10 |
11 | `keyvals` must be an even number of forms.
12 |
13 | ===== Related
14 | cljs.core/array
15 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_juxt.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/juxt
3 |
4 | ===== Signature
5 | [f]
6 | [f g]
7 | [f g h]
8 | [f g h & fs]
9 |
10 | ===== Description
11 |
12 | Takes a set of functions and returns a function that is the juxtaposition of
13 | those functions.
14 |
15 | The returned function takes a variable number of arguments, and returns a vector
16 | containing the result of applying each function to the arguments (left-to-
17 | right).
18 |
19 | `((juxt a b c) x)` => `[(a x) (b x) (c x)]`
20 |
21 | ===== Related
22 | cljs.core/partial
23 | cljs.core/comp
24 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_keep-indexed.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/keep-indexed
3 |
4 | ===== Signature
5 | [f]
6 | [f coll]
7 |
8 | ===== Description
9 |
10 | Returns a lazy sequence of the non-nil results of `(f index item)`. Note, this
11 | means false return values will be included.
12 |
13 | `f` must be free of side-effects.
14 |
15 | Returns a stateful transducer when no collection is provided.
16 |
17 | ===== Related
18 | cljs.core/map-indexed
19 | cljs.core/keep
20 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_keep.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/keep
3 |
4 | ===== Signature
5 | [f]
6 | [f coll]
7 |
8 | ===== Description
9 |
10 | Returns a lazy sequence of the non-nil results of `(f item)`. Note, this means
11 | false return values will be included.
12 |
13 | `f` must be free of side-effects.
14 |
15 | Returns a transducer when no collection is provided.
16 |
17 | ===== Related
18 | cljs.core/keep-indexed
19 | cljs.core/map
20 | cljs.core/filter
21 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_key.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/key
3 |
4 | ===== Signature
5 | [map-entry]
6 |
7 | ===== Description
8 |
9 | Returns the key of the map entry.
10 |
11 | ===== Related
12 | cljs.core/keys
13 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_keys.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/keys
3 |
4 | ===== Signature
5 | [hash-map]
6 |
7 | ===== Description
8 |
9 | Returns a sequence of the keys in `hash-map`.
10 |
11 | ===== Related
12 | cljs.core/vals
13 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_last.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/last
3 |
4 | ===== Signature
5 | [coll]
6 |
7 | ===== Description
8 |
9 | Returns the last item in `coll` in linear time.
10 |
11 | `peek` is much faster than `last` for a vector.
12 |
13 | ===== Related
14 | cljs.core/first
15 | cljs.core/next
16 | cljs.core/rest
17 | cljs.core/butlast
18 | cljs.core/take-last
19 |
--------------------------------------------------------------------------------
/docfiles/cljs.core_lazy-cat.cljsdoc:
--------------------------------------------------------------------------------
1 | ===== Name
2 | cljs.core/lazy-cat
3 |
4 | ===== Type
5 | macro
6 |
7 | ===== Signature
8 | [& colls]
9 |
10 | ===== Description
11 |
12 | Expands to code which yields a lazy sequence of the concatenation of the
13 | supplied collections. Each collections expression is not evaluated until it is
14 | needed.
15 |
16 |