on master help sign in
various rune page revisions
b63272fjoshuareagan
docs/reference/rune/bus/base.udon+3−14
@@ -11,24 +11,13 @@
11
11
12## Produces
12## Produces
13
13
14+A structure is a noun produced, usually at compile-time, for use in tracking types. In most cases, structures don't exist in the runtime semantics.
15+
14A structure for the base in `p`. `%noun` is any noun; `%atom` is any
16A structure for the base in `p`. `%noun` is any noun; `%atom` is any
15−atom; `%cell` is a cell of nouns; `%bean` is a loobean, ``?(`@f`0
17+atom; `%cell` is a cell of nouns; `%flag` is a loobean, ``?(`@f`0
16`@f`1)``. `%null` is zero with aura `@n`.
18`@f`1)``. `%null` is zero with aura `@n`.
17
19
18## Syntax
20## Syntax
19
21
20Irregular: `*` makes `%noun`, `^` makes `%cell`, `?` makes
22Irregular: `*` makes `%noun`, `^` makes `%cell`, `?` makes
21`%bean`, `~` makes `%null`, `@aura` makes atom `aura`.
23`%bean`, `~` makes `%null`, `@aura` makes atom `aura`.
22−
23−## Examples
24−
25−```
26−~zod:dojo> (* %foo)
27−7.303.014
28−~zod:dojo> (,~ 0)
29−~
30−~zod:dojo> (^ 0)
31−^
32−~zod:dojo> (@ux [1 1])
33−0x0
34−```
docs/reference/rune/bus/cab.udon+7−7
@@ -23,20 +23,20 @@ Irregular: `_foo` is `$_(foo)`.
23
23
24## Discussion
24## Discussion
25
25
26−`$_` ("buscab") discards the sample it's supposedly normalizing
26+`$_` discards the sample it's supposedly normalizing
27and produces its *example* instead.
27and produces its *example* instead.
28
28
29## Examples
29## Examples
30
30
31```
31```
32−~zod:dojo> =foo $_([%foobar %moobaz])
32+~zod:dojo> =foo $_([%foobaz %moobaz])
33
33
34−~zod:dojo> (foo %foo %bar)
34+~zod:dojo> (foo %foo %baz)
35−[%foobar %moobaz]
35+[%foobaz %moobaz]
36
36
37−~zod:dojo> `foo`[%foobar %moobaz]
37+~zod:dojo> `foo`[%foobaz %moobaz]
38−[%foobar %moobaz]
38+[%foobaz %moobaz]
39
39
40~zod:dojo $:foo
40~zod:dojo $:foo
41−[%foobar %moobaz]
41+[%foobaz %moobaz]
42```
42```
docs/reference/rune/bus/cen.udon+6−14
@@ -7,19 +7,11 @@
7
7
8# `$% "buscen"`
8# `$% "buscen"`
9
9
10−`[%bscn p=(list [[aura @] spec])]`: structure which recognizes a union tagged by head atom.
10+`[%bscn p=(list spec)]`: structure which recognizes a union tagged by head atom.
11−
12−## Normalizes to
13−
14−For any item `i` in `p`, a cell whose head is the atom `q.p.i.p`,
15−and whose tail recognizes `q.i.p`.
16−
17−Void if `p` is empty.
18
11
19## Defaults to
12## Defaults to
20
13
21−For the first item `i` in `p`, the cell `[q.p.i.p $:q.i.p]`.
22−Crashes if `p` is empty.
14+The default of the last item `i` in `p`. Crashes if `p` is empty.
23
15
24## Syntax
16## Syntax
25
17
@@ -27,7 +19,7 @@ Regular form: *2-running*.
27
19
28## Discussion
20## Discussion
29
21
30−A `$%` ("buscen") is a tagged union, an extremely common data model.
22+A `$%` is a tagged union, a common data model.
31
23
32Make sure the first item in your `$%` terminates, or the default will
24Make sure the first item in your `$%` terminates, or the default will
33be an infinite loop!
25be an infinite loop!
@@ -35,10 +27,10 @@ be an infinite loop!
35## Examples
27## Examples
36
28
37```
29```
38−~zod:dojo> =foo $%([%foo p=@ud q=@ud] [%bar p=@ud])
30+~zod:dojo> =foo $%([%foo p=@ud q=@ud] [%baz p=@ud])
39
31
40−~zod:dojo> (foo [%bar 37])
32+~zod:dojo> (foo [%baz 37])
41−[%bar p=37]
33+[%baz p=37]
42
34
43~zod:dojo> $:foo
35~zod:dojo> $:foo
44[%foo p=0 q=0]~
36[%foo p=0 q=0]~
docs/reference/rune/bus/hep.udon+3−3
@@ -22,13 +22,13 @@ Regular: *2-fixed*.
22
22
23## Discussion
23## Discussion
24
24
25−Since a `$-` ("bushep") is a [`$_` ("buscab")](../cab/), it is not useful for normalizing, just for typechecking. In particular, the existence of `$-`s does *not* let us send gates or other cores over the network!
25+Since a `$-` reduces to a [`$_`](../cab/), it is not useful for normalizing, just for typechecking. In particular, the existence of `$-`s does *not* let us send gates or other cores over the network!
26
26
27## Examples
27## Examples
28
28
29```
29```
30−~zod:dojo> =foo $-(%foo %bar)
30+~zod:dojo> =foo $-(%foo %baz)
31
31
32~zod:dojo> ($:foo %foo)
32~zod:dojo> ($:foo %foo)
33−%bar
33+%baz
34```
34```
docs/reference/rune/bus/ket.udon+4−4
@@ -25,16 +25,16 @@ Regular: *2-fixed*.
25## Examples
25## Examples
26
26
27```
27```
28−~zod:dojo> =a $%([%foo p=@ud q=@ud] [%bar p=@ud])
28+~zod:dojo> =a $%([%foo p=@ud q=@ud] [%baz p=@ud])
29
29
30~zod:dojo> =b $^([a a] a)
30~zod:dojo> =b $^([a a] a)
31
31
32−~zod:dojo> (b [[%bar 33] [%foo 19 22]])
32+~zod:dojo> (b [[%baz 33] [%foo 19 22]])
33−[[%bar p=33] [%foo p=19 q=22]]
33+[[%baz p=33] [%foo p=19 q=22]]
34
34
35~zod:dojo> (b [%foo 19 22])
35~zod:dojo> (b [%foo 19 22])
36[%foo p=19 q=22]
36[%foo p=19 q=22]
37
37
38~zod:dojo> $:b
38~zod:dojo> $:b
39−[%bar p=0]
39+[%baz p=0]
40```
40```
docs/reference/rune/bus/tis.udon+4−4
@@ -7,7 +7,7 @@
7
7
8# `$= "bustis"`
8# `$= "bustis"`
9
9
10−`[%bsts p=@tas q=spec]`: structure which wraps a face around another structure.
10+`[%bsts p=skin q=spec]`: structure which wraps a face around another structure.
11
11
12## Expands to
12## Expands to
13
13
@@ -20,12 +20,12 @@
20
20
21Regular: *2-fixed*.
21Regular: *2-fixed*.
22
22
23−Irregular (mold mode): `foo=bar` is `$=(foo bar)`.
23+Irregular (structure mode): `foo=baz` is `$=(foo baz)`.
24
24
25## Discussion
25## Discussion
26
26
27Note that the Hoon compiler is at least slightly clever about
27Note that the Hoon compiler is at least slightly clever about
28−compiling molds, and almost never has to actually put in a gate
28+compiling structures, and almost never has to actually put in a gate
29layer (as seen in the expansion above) to apply a `$=`.
29layer (as seen in the expansion above) to apply a `$=`.
30
30
31## Examples
31## Examples
@@ -36,6 +36,6 @@ layer (as seen in the expansion above) to apply a `$=`.
36~zod:dojo> (a %foo)
36~zod:dojo> (a %foo)
37p=%foo
37p=%foo
38
38
39−~zod:dojo> (a %bar)
39+~zod:dojo> (a %baz)
40p=%foo
40p=%foo
41```
41```
docs/reference/rune/bus/vat.udon+4−4
@@ -22,7 +22,7 @@ The default of `p`.
22
22
23Regular: *2-fixed*.
23Regular: *2-fixed*.
24
24
25−Product: a structure which applies `p` if its sample is an atom,
25+Product: a structure which applies `p` if its sample is an atom,
26`q` if its sample is a cell.
26`q` if its sample is a cell.
27
27
28Regular form: *2-fixed*.
28Regular form: *2-fixed*.
@@ -30,13 +30,13 @@ Regular form: *2-fixed*.
30Example:
30Example:
31
31
32```
32```
33−~zod:dojo> =a $@(%foo $:(p=%bar q=@ud))
33+~zod:dojo> =a $@(%foo $:(p=%baz q=@ud))
34
34
35~zod:dojo> (a %foo)
35~zod:dojo> (a %foo)
36%foo
36%foo
37
37
38−~zod:dojo> `a`[%bar 99]
38+~zod:dojo> `a`[%baz 99]
39−[p=%bar q=99]
39+[p=%baz q=99]
40
40
41~zod:dojo> $:a
41~zod:dojo> $:a
42[%foo p=0 q=0]
42[%foo p=0 q=0]
docs/reference/rune/bus/wut.udon+6−7
@@ -11,8 +11,7 @@
11
11
12## Normalizes to
12## Normalizes to
13
13
14−The first item in `p` which normalizes the sample to itself;
14+The first item in `p` which normalizes the sample to itself.
15−otherwise, default.
16
15
17Void, if `p` is empty.
16Void, if `p` is empty.
18
17
@@ -24,19 +23,19 @@ The first item in `p`.
24
23
25Regular: *running*.
24Regular: *running*.
26
25
27−Irregular: `?(%foo %bar)` is `$?(%foo %bar)`.
26+Irregular: `?(%foo %baz)` is `$?(%foo %baz)`.
28
27
29## Discussion
28## Discussion
30
29
31−For a union of atoms, a `$?` ("buswut") is fine. For more complex nouns,
30+For a union of atoms, a `$?` is fine. For more complex nouns,
32−always try to use a [`$%` ("buscen")](../cen/), [`$@` ("busvat")](../vat/) or
31+always try to use a [`$%`](../cen/), [`$@`](../vat/) or
33−[`$^` ("busket")](../ket/), at least if you expect your structure to be used as a
32+[`$^`](../ket/), at least if you expect your structure to be used as a
34normalizer.
33normalizer.
35
34
36## Examples
35## Examples
37
36
38```
37```
39−~zod:dojo> =a ?(%foo %bar %baz)
38+~zod:dojo> =a ?(%foo %baz %baz)
40
39
41~zod:dojo> (a %baz)
40~zod:dojo> (a %baz)
42%baz
41%baz
docs/reference/rune/ket/hep.udon+1−1
@@ -19,7 +19,7 @@
19
19
20Regular: *2-fixed*.
20Regular: *2-fixed*.
21
21
22−Irregular: `` `foo`bar`` is `^-(foo bar)`.
22+Irregular: `` `foo`baz`` is `^-(foo baz)`.
23
23
24## Discussion
24## Discussion
25
25
docs/reference/rune/ket/tis.udon+5−1
@@ -19,20 +19,24 @@ may also be a tuple of terms, or a term-skin pair; the type of
19
19
20Regular: *2-fixed*.
20Regular: *2-fixed*.
21
21
22−Irregular: `foo=bar` is `^=(foo bar)`.
22+Irregular: `foo=baz` is `^=(foo baz)`.
23
23
24## Examples
24## Examples
25
25
26```
26```
27~zod:dojo> a=1
27~zod:dojo> a=1
28a=1
28a=1
29+
29~zod:dojo> ^= a
30~zod:dojo> ^= a
30 1
31 1
31a=1
32a=1
33+
32~zod:dojo> ^=(a 1)
34~zod:dojo> ^=(a 1)
33a=1
35a=1
36+
34~zod:dojo> [b c d]=[1 2 3 4]
37~zod:dojo> [b c d]=[1 2 3 4]
35[b=1 c=2 d=[3 4]]
38[b=1 c=2 d=[3 4]]
39+
36~zod:dojo> [b c d=[x y]]=[1 2 3 4]
40~zod:dojo> [b c d=[x y]]=[1 2 3 4]
37[b=1 c=2 d=[x=3 y4]]
41[b=1 c=2 d=[x=3 y4]]
38```
42```
docs/reference/rune/mic/col.udon+2
@@ -47,8 +47,10 @@ Irregular: `:(add a b c)` is `;:(add a b c)`.
47```
47```
48~zod:dojo> (add 3 (add 4 5))
48~zod:dojo> (add 3 (add 4 5))
4912
4912
50+
50~zod:dojo> ;:(add 3 4 5)
51~zod:dojo> ;:(add 3 4 5)
5112
5212
53+
52~zod:dojo> :(add 3 4 5)
54~zod:dojo> :(add 3 4 5)
5312
5512
54```
56```
docs/reference/rune/mic/mic.udon+1−9
@@ -17,8 +17,7 @@
17a
17a
18```
18```
19
19
20−> Note: the expansion implementation is hygienic -- it doesn't actually add the
20+> Note: the expansion implementation is hygienic -- it doesn't actually add the `a` face to the subject.
21−> `a` face to the subject.
22
21
23## Syntax
22## Syntax
24
23
@@ -41,13 +40,6 @@ Succeeds because molds don't care about auras:
41"abc"
40"abc"
42```
41```
43
42
44−Succeeds because the mold normalizes:
45−
46−```
47−~zod:dojo> (tape [50 51 52])
48−"23"
49−```
50−
51Fails because not a fixpoint:
43Fails because not a fixpoint:
52
44
53```
45```
docs/reference/rune/mic/sig.udon+3−4
@@ -12,8 +12,7 @@ product-sample adapter.
12
12
13## Produces
13## Produces
14
14
15−The gates in `q` connected together using the gate `p`, which
16−transforms a `q` product and a `q` gate into a `q` sample.
15+The gates in `q` are composed together using the gate `p` as an intermediate function, which transforms a `q` product and a `q` gate into a `q` sample.
17
16
18## Expands to
17## Expands to
19
18
@@ -51,9 +50,9 @@ transforms a `q` product and a `q` gate into a `q` sample.
51
50
52## Discussion
51## Discussion
53
52
54−Apparently `;~` ("micsig") is a "Kleisli arrow." It's also
53+Apparently `;~` is a "Kleisli arrow." It's also
55a close cousin of the infamous "monad." Don't let that bother
54a close cousin of the infamous "monad." Don't let that bother
56−you either. Hoon doesn't know anything about category theory,
55+you. Hoon doesn't know anything about category theory,
57so you don't need to either.
56so you don't need to either.
58
57
59`;~` is often used in parsers, but is not only for parsers.
58`;~` is often used in parsers, but is not only for parsers.