@@ -65,14 +65,14 @@ A ship's *pier* is its Unix directory. For planets the name of the pier is usua
66> Nock is a Turing-complete, non-lambda combinator interpreter.
66> Nock is a Turing-complete, non-lambda combinator interpreter.
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
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
74+- *subject*: a noun - the data against which a `formula` is
77*See [Nock definition](../../nock/definition/).*
77*See [Nock definition](../../nock/definition/).*
@@ -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.
84−###### <h6 id="span">span:</h6> an inferred type
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*).
90−*See [basic types](../../hoon/basic/#-type-span-and-mold).*
92−###### <h6 id="core">core:</h6> a code-data cell
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.
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
101−*See [basic types](../../hoon/basic)*.
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
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.
121*See [advanced types](/hoon/advanced)*.
102*See [advanced types](/hoon/advanced)*.
123−###### metal: a variance model
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`
129−- `gold`: *invariant*
130−- `lead`: *bivariant*
131−- `zinc`: *covariant*
132−- `iron`: *contravariant*
134−*See [advanced types](/hoon/advanced)*.
136−###### <h6 id="gate">gate:</h6> a function/lambda/closure
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.
143−The payload of a gate has a shape of `{sample context}`.
145−- *sample*: the argument tuple
146−- *context*: the subject in which the gate was defined
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
152−###### <h6 id="mold">mold:</h6> a type constructor / validator
154−A *mold* is an idempotent gate (function), accepting any noun, and
155−producing a range with a useful span.
157−- *bunt*: the value a mold produces when normalizing its default
159−- *icon*: the span of the mold's range
161−*See [mold twigs](/hoon/twig/buc-mold/).*
163###### atom
104###### atom
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:
197*See [basic types](../../hoon/basic/#-atom-p-term-q-unit-atom)*.
138*See [basic types](../../hoon/basic/#-atom-p-term-q-unit-atom)*.
199−###### <h6 id="twig">twig:</h6> a Hoon expression
140+###### <h6 id="core">core:</h6> a code-data cell
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.
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
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.
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*.
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]`.
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.
221−A regular twig has two syntactic forms, *tall* and *flat*:
159+*See [advanced types](../../hoon/advanced/#-face-aliases-and-bridges)*.
223−- *tall*: multiple lines, no parentheses, two or more spaces between
161+###### <h6 id="gate">gate:</h6> a function/lambda/closure
225−- *flat*: one line, parentheses, one space between tokens
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.
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
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
233###### limb: attribute or variable reference
177###### limb: attribute or variable reference
@@ -243,6 +187,44 @@ found, the result is the product of the arm.
244*See [Limbs and wings](../../hoon/twig/limb)*
188*See [Limbs and wings](../../hoon/twig/limb)*
190+###### loobean: a Hoon boolean
192+`0` (`%.y`) is *yes*, `1` (`%.n`) is *no*.
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.
197+###### metal: a variance model
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`
203+- `gold`: *invariant*
204+- `lead`: *bivariant*
205+- `zinc`: *covariant*
206+- `iron`: *contravariant*
208+*See [advanced types](/hoon/advanced)*.
210+###### <h6 id="mold">mold:</h6> a type constructor / validator
212+A *mold* is an idempotent gate (function), accepting any noun, and
213+producing a range with a useful span.
215+- *bunt*: the value a mold produces when normalizing its default
217+- *icon*: the span of the mold's range
219+*See [mold twigs](/hoon/twig/buc-mold/).*
221+###### nest: type compatibility test
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.
226+*See [advanced types](../../hoon/advanced/)*.
246###### slot: a tree addressing scheme
228###### slot: a tree addressing scheme
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)`.
253−###### face: a labeled subtree
235+###### <h6 id="span">span:</h6> an inferred type
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*).
259−A *face* is a span that wraps a name (`@tas`) around another span.
241+*See [basic types](../../hoon/basic/#-type-span-and-mold).*
261−*See [advanced types](../../hoon/advanced/#-face-aliases-and-bridges)*.
243+###### <h6 id="twig">twig:</h6> a Hoon expression
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.
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
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.
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*.
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.
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.
265+A regular twig has two syntactic forms, *tall* and *flat*:
267+- *tall*: multiple lines, no parentheses, two or more spaces between
269+- *flat*: one line, parentheses, one space between tokens
271+Tall twigs can contain flat ones, but not vice versa. All irregular
274+*See [twig concept](../../hoon/concepts/#-twig-expression),
275+[expressions](../../hoon/twig/), and [syntax](../../hoon/syntax/)*.