You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
</code></pre><p>When using sets with <code>filter</code>, remember that if nil or false is in the set and in the collection, then the predicate will return itself: <code>nil</code>.</p><p>In this example, when nil and false are tested with the predicate, the predicate returns nil. This is because if the item is present in the set it is returned. This will cause that item to /not/ be included in the returned lazy-sequence.</p><pre><codeclass="klipse-clojure nohighlight">(filter #{:nothing :something nil}
Copy file name to clipboardExpand all lines: articles/language/glossary/index.html
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -70,7 +70,7 @@ <h2>Language: Glossary</h2>
70
70
<ahref="#variadic">variadic</a>.</p><p>Functions can have multiple arity (for example, a function might have
71
71
2 different bodies: one for when 2 args are passed, and another when 3
72
72
args are passed).</p><h3id="binding-form">binding-form</h3><p>Could mean one of two things:</p><ol><li><p>the expression you're binding to in a
73
-
<ahref="#let_binding">let-binding</a>. It might be a simple name, or it
73
+
<ahref="#let-binding">let-binding</a>. It might be a simple name, or it
74
74
might be a data structure used for
75
75
<ahref="#destructuring">destructuring</a>.</p></li><li><p>Clojure provides the <code>binding</code> macro, used for setting the
76
76
thread-local value of a dynamic var. The whole expression (form)
@@ -79,7 +79,7 @@ <h2>Language: Glossary</h2>
79
79
depending whether the first arg is less than, equal to or greater than
80
80
the second. The stock comparator that Clojure.core comes with is
81
81
<code>compare</code>.</p><h3id="coordinates">coordinates</h3><p>The "group-id/artifact-id version-string" identifier used in your
82
-
project.clj to indicate a particular dependency.</p><p>See also <ahref="#libspec">libspec</a>.</p><h3id="destructuring">destructuring</h3><p>The handy trick used in a <ahref="#let_binding">let-binding</a> to "unpack" the
82
+
project.clj to indicate a particular dependency.</p><p>See also <ahref="#libspec">libspec</a>.</p><h3id="destructuring">destructuring</h3><p>The handy trick used in a <ahref="#let-binding">let-binding</a> to "unpack" the
83
83
values from a data structure into the locals you're going to use. See
84
84
also <ahref="#binding-form">binding-form</a> and <ahref="/articles/language/functions#destructuring-of-function-arguments">the destructuring section in
85
85
the functions
@@ -92,7 +92,7 @@ <h2>Language: Glossary</h2>
92
92
function. Functions that are macros are expanded, recursively.</p><p>In general, the next step is to compile this resolved and expanded expression
93
93
to bytecode, and then execute the bytecode. There are some exceptions to this
94
94
process, such as special forms, or some expressions that the REPL interprets
95
-
directly instead of compiling and executing.</p><p>See <ahref="https://clojure.org/reference/evaluation">the official evalation reference</a>
95
+
directly instead of compiling and executing.</p><p>See <ahref="https://clojure.org/reference/evaluation">the official evaluation reference</a>
96
96
on clojure.org for more details.</p><h3id="form">form</h3><p>A valid s-expression. For example: <code>(+ 1 1)</code> and <code>(defn foo [x] (* x x))</code>.</p><h3id="head-retention">head retention</h3><p><ahref="#lazy">Lazy</a> sequences are still <ahref="#persistence">persistent</a>. If you
97
97
make <em>another</em> data structure using one, the original lazy sequence
98
98
will be kept around and not garbage-collected. If the lazy sequence in
@@ -110,7 +110,7 @@ <h2>Language: Glossary</h2>
110
110
different than a pure function, in that a pure function will
111
111
produce no side effects.</p><h3id="identity">identity</h3><p>A logical entity in your program that may change over time --- it may
112
112
take on different states at different times, but it still means the
113
-
same logical entity. Clojure uses <ahref="#reference_types">reference types</a>
113
+
same logical entity. Clojure uses <ahref="#reference-types">reference types</a>
114
114
to represent identities. This is not to be confused with the <code>identity</code> function that just returns the argument given to it.</p><h3id="implicit-do">implicit do</h3><p>The bodies of some expressions act like <code>do</code> in that you can include
115
115
multiple expressions in them, and the expressions will be evaluated in
116
116
the order they appear, with the resulting value of the body being the
@@ -123,15 +123,15 @@ <h2>Language: Glossary</h2>
123
123
instance, instead of having multiple string objects with the same value
124
124
of "clojure".</p><h3id="keyword">keyword</h3><p>A Clojure scalar data type whose literal syntax looks <code>:like</code><code>:this</code>.
125
125
They are like numbers and strings in that they evaluate to themselves,
126
-
and are most often seen being used as keys in <ahref="#map">hash-maps</a>.</p><p>See also <ahref="#namespaced_keyword">namespaced keyword</a></p><p>The term is also used when talking about functions that take "keyword
126
+
and are most often seen being used as keys in <ahref="#map">hash-maps</a>.</p><p>See also <ahref="#namespaced-keyword">namespaced keyword</a></p><p>The term is also used when talking about functions that take "keyword
127
127
arguments", for example, something like: <code>(my-func :speed 42 :mass 2)</code>
128
128
(as opposed to <code>(my-func {:speed 42 :mass 2})</code>).</p><h3id="lazy">lazy</h3><p>Clojure can (and often does) create sequences for you that aren't
129
129
fully computed. Upon casual inspection they <em>look</em> just like a regular
130
130
list, but particular values in them are only computed the moment you
131
131
ask for them --- not sooner.</p><p>This has the added benefit that you can easily create infinite
132
132
sequences that don't consume infinite memory.</p><p>Many of the built-in Clojure functions return lazy sequences.</p><p>See also <ahref="#realize">realize</a>.</p><h3id="let-binding">let-binding</h3><p>AKA, "binding vector", or just "bindings": in a <code>let</code> (and expressions
133
133
that work like let, for example, <code>defn</code>, <code>loop</code>, <code>loop</code>, & <code>fn</code>), the
134
-
vector that comes first where you specify lexical bindings.</p><p>See also <ahref="#binding_form">binding form</a></p><p><aname="libspec"></a></p><h3id="libspec">libspec</h3><p>The docstring of <code>require</code> defines a libspec as:</p><blockquote><p>A libspec is a lib name or a vector containing a lib name followed by options expressed as sequential keywords and arguments.</p></blockquote><p>A lib name is in turn defined thus:</p><blockquote><p>Lib names are symbols and each lib is associated with a Clojure namespace and a Java package that share its name. A lib's name also locates its root directory within classpath using Java's package name to classpath-relative path mapping.</p></blockquote><p>Examples of libspecs:</p><pre><codeclass="clojure"> clojure.string
134
+
vector that comes first where you specify lexical bindings.</p><p>See also <ahref="#binding-form">binding form</a></p><p><aname="libspec"></a></p><h3id="libspec">libspec</h3><p>The docstring of <code>require</code> defines a libspec as:</p><blockquote><p>A libspec is a lib name or a vector containing a lib name followed by options expressed as sequential keywords and arguments.</p></blockquote><p>A lib name is in turn defined thus:</p><blockquote><p>Lib names are symbols and each lib is associated with a Clojure namespace and a Java package that share its name. A lib's name also locates its root directory within classpath using Java's package name to classpath-relative path mapping.</p></blockquote><p>Examples of libspecs:</p><pre><codeclass="clojure"> clojure.string
135
135
[clojure.string :as str]
136
136
[clojure.string :refer [join split]]
137
137
[clojure.string :as-alias s] ;; :as-alias is new in Clojure 1.11
@@ -231,7 +231,7 @@ <h2>Language: Glossary</h2>
231
231
type erasure.</p><h3id="value">value</h3><p>An immutable object, such as the number 1, the character <code>\a</code>, the
232
232
string "hello", or the vector <code>[1 2 3]</code>. In Clojure, all scalars and
233
233
built-in core data structures are values.</p><h3id="variadic">variadic</h3><p>A function that can take a variable number of arguments.
0 commit comments