on master help sign in
Merge pull request #209 from joshuareagan/patch-15
784a2e4Keaton Dunsford
docs/about/glossary.md+99−99
@@ -65,14 +65,14 @@ A ship's *pier* is its Unix directory. For planets the name of the pier is usua
65
65
66> Nock is a Turing-complete, non-lambda combinator interpreter.
66> Nock is a Turing-complete, non-lambda combinator interpreter.
67
67
68−- *noun*: an *atom* or a *cell*
69- *atom*: any natural number
68- *atom*: any natural number
70- *cell*: any ordered pair of nouns
69- *cell*: any ordered pair of nouns
71−- *subject*: a noun - the data against which a `formula` is
72− evaluated
73- *formula*: a noun - a function at the Nock level
70- *formula*: a noun - a function at the Nock level
71+- *noun*: an *atom* or a *cell*
74- *product*: a noun - the result of evaluating a formula against a
72- *product*: a noun - the result of evaluating a formula against a
75 subject
73 subject
74+- *subject*: a noun - the data against which a `formula` is
75+ evaluated
76
76
77*See [Nock definition](../../nock/definition/).*
77*See [Nock definition](../../nock/definition/).*
78
78
@@ -81,25 +81,6 @@ A ship's *pier* is its Unix directory. For planets the name of the pier is usua
81> Hoon is a strict, higher-order typed functional language that compiles
81> Hoon is a strict, higher-order typed functional language that compiles
82> itself to Nock.
82> itself to Nock.
83
83
84−###### <h6 id="span">span:</h6> an inferred type
85−
86−A *span* defines a set (finite or infinite) of nouns and ascribes some
87−semantics to it. There is no Hoon syntax for a span; it is always
88−produced as the inferred range of an expression (*twig*).
89−
90−*See [basic types](../../hoon/basic/#-type-span-and-mold).*
91−
92−###### <h6 id="core">core:</h6> a code-data cell
93−
94−The code (*battery*) is the head, the data (*payload*) is the tail. All
95−code-data structures in normal languages (functions, objects, modules,
96−etc) become *core*s in Hoon.
97−
98−- <h6 id="battery">*battery*:</h6> the code of a core, a tree of *arms*
99−- <h6 id="payload">*payload*:</h6> the data in a core
100−
101−*See [basic types](../../hoon/basic)*.
102−
103###### <h6 id="arm">arm:</h6> a named, functionally-computed attribute of a core
84###### <h6 id="arm">arm:</h6> a named, functionally-computed attribute of a core
104
85
105The *twig* of each arm is compiled to a Nock formula, with the
86The *twig* of each arm is compiled to a Nock formula, with the
@@ -120,46 +101,6 @@ context.
120
101
121*See [advanced types](/hoon/advanced)*.
102*See [advanced types](/hoon/advanced)*.
122
103
123−###### metal: a variance model
124−
125−Every core has a *metal* which defines its variance model (ie, the
126−properties of the span of a compatible core). The default is `gold`
127−(invariant).
128−
129−- `gold`: *invariant*
130−- `lead`: *bivariant*
131−- `zinc`: *covariant*
132−- `iron`: *contravariant*
133−
134−*See [advanced types](/hoon/advanced)*.
135−
136−###### <h6 id="gate">gate:</h6> a function/lambda/closure
137−
138−A *gate* is a core with one arm. To call a gate on an argument,
139−replace the sample (at [tree
140−address](../../hoon/twig/limb/limb/) `+6` in the core) with the
141−argument, and then compute the arm.
142−
143−The payload of a gate has a shape of `{sample context}`.
144−
145−- *sample*: the argument tuple
146−- *context*: the subject in which the gate was defined
147−
148−*See [basic types](../../hoon/basic/#-core-p-span-q-map-term-span),
149−[`%-` or `:call`](../../hoon/twig/cen-call/hep-call/) (the `twig` for
150−calling a `gate`).*
151−
152−###### <h6 id="mold">mold:</h6> a type constructor / validator
153−
154−A *mold* is an idempotent gate (function), accepting any noun, and
155−producing a range with a useful span.
156−
157−- *bunt*: the value a mold produces when normalizing its default
158− sample
159−- *icon*: the span of the mold's range
160−
161−*See [mold twigs](/hoon/twig/buc-mold/).*
162−
163###### atom
104###### atom
164
105
165A Hoon *atom* span describes a Nock atom, with two additional pieces
106A Hoon *atom* span describes a Nock atom, with two additional pieces
@@ -196,39 +137,42 @@ Some common auras and their aliases:
196
137
197*See [basic types](../../hoon/basic/#-atom-p-term-q-unit-atom)*.
138*See [basic types](../../hoon/basic/#-atom-p-term-q-unit-atom)*.
198
139
199−###### <h6 id="twig">twig:</h6> a Hoon expression
140+###### <h6 id="core">core:</h6> a code-data cell
200
141
201−A *twig* is a Hoon expression. Specifically, twig is the mold for the
142+The code (*battery*) is the head, the data (*payload*) is the tail. All
202−noun that a Hoon source expression compiles to. A twig is always a cell.
143+code-data structures in normal languages (functions, objects, modules,
144+etc) become *core*s in Hoon.
203
145
204−A twig has one of two forms: `{twig twig}`, which produces the ordered
146+- <h6 id="battery">*battery*:</h6> the code of a core, a tree of *arms*
205−pair of the two twigs, or a cell `{stem bulb}`, where `stem` is an
147+- <h6 id="payload">*payload*:</h6> the data in a core
206−atomic symbol.
207
148
208−- <h6 id="stem">*stem*:</h6> an atomic symbol (`@tas`) - the name of a twig.
149+*See [basic types](../../hoon/basic)*.
209−- <h6 id="bulb">*bulb*:</h6> The mold of the twig's contents.
210
150
211−Most twigs have a *regular form*, beginning with a *rune*. Some twigs
151+###### face: a labeled subtree
212−also have a syntactic *irregular form*; a few have *only* an *irregular form*.
213
152
214−- <h6 id="rune">*rune*:</h6> a pair of ASCII symbols used to begin a twig.
153+Hoon has no scope or symbol-table; there is only the subject. To
154+"declare" a "variable" is to construct a new subject:
155+`[name=value old-subject]`.
215
156
216−For example, the rune [`?:`](../../hoon/twig/wut-test/col-if/) is
157+A *face* is a span that wraps a name (`@tas`) around another span.
217−Hoon's most common conditional, a branch on a boolean test. The first symbol
218−in a rune represents a family of related `twig`s. For example, the
219−[`?` family](../../hoon/twig/wut-test/) are all conditionals.
220
158
221−A regular twig has two syntactic forms, *tall* and *flat*:
159+*See [advanced types](../../hoon/advanced/#-face-aliases-and-bridges)*.
222
160
223−- *tall*: multiple lines, no parentheses, two or more spaces between
161+###### <h6 id="gate">gate:</h6> a function/lambda/closure
224− tokens
225−- *flat*: one line, parentheses, one space between tokens
226
162
227−Tall twigs can contain flat ones, but not vice versa. All irregular
163+A *gate* is a core with one arm. To call a gate on an argument,
228−forms are flat.
164+replace the sample (at [tree
165+address](../../hoon/twig/limb/limb/) `+6` in the core) with the
166+argument, and then compute the arm.
229
167
230−*See [twig concept](../../hoon/concepts/#-twig-expression),
168+The payload of a gate has a shape of `{sample context}`.
231−[expressions](../../hoon/twig/), and [syntax](../../hoon/syntax/)*.
169+
170+- *sample*: the argument tuple
171+- *context*: the subject in which the gate was defined
172+
173+*See [basic types](../../hoon/basic/#-core-p-span-q-map-term-span),
174+[`%-` or `:call`](../../hoon/twig/cen-call/hep-call/) (the `twig` for
175+calling a `gate`).*
232
176
233###### limb: attribute or variable reference
177###### limb: attribute or variable reference
234
178
@@ -243,6 +187,44 @@ found, the result is the product of the arm.
243
187
244*See [Limbs and wings](../../hoon/twig/limb)*
188*See [Limbs and wings](../../hoon/twig/limb)*
245
189
190+###### loobean: a Hoon boolean
191+
192+`0` (`%.y`) is *yes*, `1` (`%.n`) is *no*.
193+
194+> Why? It's fresh, it's different, it's new. And it's annoying. And it
195+> keeps you on your toes. And it's also just intuitively right.
196+
197+###### metal: a variance model
198+
199+Every core has a *metal* which defines its variance model (ie, the
200+properties of the span of a compatible core). The default is `gold`
201+(invariant).
202+
203+- `gold`: *invariant*
204+- `lead`: *bivariant*
205+- `zinc`: *covariant*
206+- `iron`: *contravariant*
207+
208+*See [advanced types](/hoon/advanced)*.
209+
210+###### <h6 id="mold">mold:</h6> a type constructor / validator
211+
212+A *mold* is an idempotent gate (function), accepting any noun, and
213+producing a range with a useful span.
214+
215+- *bunt*: the value a mold produces when normalizing its default
216+ sample
217+- *icon*: the span of the mold's range
218+
219+*See [mold twigs](/hoon/twig/buc-mold/).*
220+
221+###### nest: type compatibility test
222+
223+*nest* is an internal function on two spans, which produces yes if the
224+set of nouns in the second span is provably a subset of the first.
225+
226+*See [advanced types](../../hoon/advanced/)*.
227+
246###### slot: a tree addressing scheme
228###### slot: a tree addressing scheme
247
229
248Every cell has a head and a tail, each of which may be either an atom or
230Every cell has a head and a tail, each of which may be either an atom or
@@ -250,26 +232,44 @@ a cell. Therefore every noun is a binary tree. `+1` or `.` resolves to
250the whole cell (technically this would work against an atom as well).
232the whole cell (technically this would work against an atom as well).
251The head of `+n` is `+2n`, the tail is `+(2n+1)`.
233The head of `+n` is `+2n`, the tail is `+(2n+1)`.
252
234
253−###### face: a labeled subtree
235+###### <h6 id="span">span:</h6> an inferred type
254
236
255−Hoon has no scope or symbol-table; there is only the subject. To
237+A *span* defines a set (finite or infinite) of nouns and ascribes some
256−"declare" a "variable" is to construct a new subject:
238+semantics to it. There is no Hoon syntax for a span; it is always
257−`[name=value old-subject]`.
239+produced as the inferred range of an expression (*twig*).
258
240
259−A *face* is a span that wraps a name (`@tas`) around another span.
241+*See [basic types](../../hoon/basic/#-type-span-and-mold).*
260
242
261−*See [advanced types](../../hoon/advanced/#-face-aliases-and-bridges)*.
243+###### <h6 id="twig">twig:</h6> a Hoon expression
262
244
263−###### nest: type compatibility test
245+A *twig* is a Hoon expression. Specifically, twig is the mold for the
246+noun that a Hoon source expression compiles to. A twig is always a cell.
264
247
265−*nest* is an internal function on two spans, which produces yes if the
248+A twig has one of two forms: `{twig twig}`, which produces the ordered
266−set of nouns in the second span is provably a subset of the first.
249+pair of the two twigs, or a cell `{stem bulb}`, where `stem` is an
250+atomic symbol.
267
251
268−*See [advanced types](../../hoon/advanced/)*.
252+- <h6 id="stem">*stem*:</h6> an atomic symbol (`@tas`) - the name of a twig.
253+- <h6 id="bulb">*bulb*:</h6> The mold of the twig's contents.
269
254
270−###### loobean: a Hoon boolean
255+Most twigs have a *regular form*, beginning with a *rune*. Some twigs
256+also have a syntactic *irregular form*; a few have *only* an *irregular form*.
271
257
272−`0` (`%.y`) is *yes*, `1` (`%.n`) is *no*.
258+- <h6 id="rune">*rune*:</h6> a pair of ASCII symbols used to begin a twig.
273
259
274−> Why? It's fresh, it's different, it's new. And it's annoying. And it
260+For example, the rune [`?:`](../../hoon/twig/wut-test/col-if/) is
275−> keeps you on your toes. And it's also just intuitively right.
261+Hoon's most common conditional, a branch on a boolean test. The first symbol
262+in a rune represents a family of related `twig`s. For example, the
263+[`?` family](../../hoon/twig/wut-test/) are all conditionals.
264+
265+A regular twig has two syntactic forms, *tall* and *flat*:
266+
267+- *tall*: multiple lines, no parentheses, two or more spaces between
268+ tokens
269+- *flat*: one line, parentheses, one space between tokens
270+
271+Tall twigs can contain flat ones, but not vice versa. All irregular
272+forms are flat.
273+
274+*See [twig concept](../../hoon/concepts/#-twig-expression),
275+[expressions](../../hoon/twig/), and [syntax](../../hoon/syntax/)*.