on master help sign in
various rune page revisions
commitb63272f160c40c4b4c6c5296555671836ced5ae7 authorjoshuareagan <joshuareagan@gmail.com> dateWed 10 Oct 2018, 16:04 (8 years ago) parent160aa63
13 files changed+49−72
docs/reference/rune/bus/base.udon+3−14 docs/reference/rune/bus/cab.udon+7−7 docs/reference/rune/bus/cen.udon+6−14 docs/reference/rune/bus/hep.udon+3−3 docs/reference/rune/bus/ket.udon+4−4 docs/reference/rune/bus/tis.udon+4−4 docs/reference/rune/bus/vat.udon+4−4 docs/reference/rune/bus/wut.udon+6−7 docs/reference/rune/ket/hep.udon+1−1 docs/reference/rune/ket/tis.udon+5−1 docs/reference/rune/mic/col.udon+2 docs/reference/rune/mic/mic.udon+1−9 docs/reference/rune/mic/sig.udon+3−4
docs/reference/rune/bus/base.udon+3−14
@@ -11,24 +11,13 @@
1111
1212## Produces
1313
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+
1416A 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
1618`@f`1)``. `%null` is zero with aura `@n`.
1719
1820## Syntax
1921
2022Irregular: `*` makes `%noun`, `^` makes `%cell`, `?` makes
2123`%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)`.
2323
2424## Discussion
2525
26−`$_` ("buscab") discards the sample it's supposedly normalizing
26+`$_` discards the sample it's supposedly normalizing
2727and produces its *example* instead.
2828
2929## Examples
3030
3131```
32−~zod:dojo> =foo $_([%foobar %moobaz])
32+~zod:dojo> =foo $_([%foobaz %moobaz])
3333
34−~zod:dojo> (foo %foo %bar)
35−[%foobar %moobaz]
34+~zod:dojo> (foo %foo %baz)
35+[%foobaz %moobaz]
3636
37−~zod:dojo> `foo`[%foobar %moobaz]
38−[%foobar %moobaz]
37+~zod:dojo> `foo`[%foobaz %moobaz]
38+[%foobaz %moobaz]
3939
4040~zod:dojo $:foo
41−[%foobar %moobaz]
41+[%foobaz %moobaz]
4242```
docs/reference/rune/bus/cen.udon+6−14
@@ -7,19 +7,11 @@
77
88# `$% "buscen"`
99
10−`[%bscn p=(list [[aura @] 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.
10+`[%bscn p=(list spec)]`: structure which recognizes a union tagged by head atom.
1811
1912## Defaults to
2013
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.
2315
2416## Syntax
2517
@@ -27,7 +19,7 @@ Regular form: *2-running*.
2719
2820## Discussion
2921
30−A `$%` ("buscen") is a tagged union, an extremely common data model.
22+A `$%` is a tagged union, a common data model.
3123
3224Make sure the first item in your `$%` terminates, or the default will
3325be an infinite loop!
@@ -35,10 +27,10 @@ be an infinite loop!
3527## Examples
3628
3729```
38−~zod:dojo> =foo $%([%foo p=@ud q=@ud] [%bar p=@ud])
30+~zod:dojo> =foo $%([%foo p=@ud q=@ud] [%baz p=@ud])
3931
40−~zod:dojo> (foo [%bar 37])
41−[%bar p=37]
32+~zod:dojo> (foo [%baz 37])
33+[%baz p=37]
4234
4335~zod:dojo> $:foo
4436[%foo p=0 q=0]~
docs/reference/rune/bus/hep.udon+3−3
@@ -22,13 +22,13 @@ Regular: *2-fixed*.
2222
2323## Discussion
2424
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!
2626
2727## Examples
2828
2929```
30−~zod:dojo> =foo $-(%foo %bar)
30+~zod:dojo> =foo $-(%foo %baz)
3131
3232~zod:dojo> ($:foo %foo)
33−%bar
33+%baz
3434```
docs/reference/rune/bus/ket.udon+4−4
@@ -25,16 +25,16 @@ Regular: *2-fixed*.
2525## Examples
2626
2727```
28−~zod:dojo> =a $%([%foo p=@ud q=@ud] [%bar p=@ud])
28+~zod:dojo> =a $%([%foo p=@ud q=@ud] [%baz p=@ud])
2929
3030~zod:dojo> =b $^([a a] a)
3131
32−~zod:dojo> (b [[%bar 33] [%foo 19 22]])
33−[[%bar p=33] [%foo p=19 q=22]]
32+~zod:dojo> (b [[%baz 33] [%foo 19 22]])
33+[[%baz p=33] [%foo p=19 q=22]]
3434
3535~zod:dojo> (b [%foo 19 22])
3636[%foo p=19 q=22]
3737
3838~zod:dojo> $:b
39−[%bar p=0]
39+[%baz p=0]
4040```
docs/reference/rune/bus/tis.udon+4−4
@@ -7,7 +7,7 @@
77
88# `$= "bustis"`
99
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.
1111
1212## Expands to
1313
@@ -20,12 +20,12 @@
2020
2121Regular: *2-fixed*.
2222
23−Irregular (mold mode): `foo=bar` is `$=(foo bar)`.
23+Irregular (structure mode): `foo=baz` is `$=(foo baz)`.
2424
2525## Discussion
2626
2727Note 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
2929layer (as seen in the expansion above) to apply a `$=`.
3030
3131## Examples
@@ -36,6 +36,6 @@ layer (as seen in the expansion above) to apply a `$=`.
3636~zod:dojo> (a %foo)
3737p=%foo
3838
39−~zod:dojo> (a %bar)
39+~zod:dojo> (a %baz)
4040p=%foo
4141```
docs/reference/rune/bus/vat.udon+4−4
@@ -22,7 +22,7 @@ The default of `p`.
2222
2323Regular: *2-fixed*.
2424
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,
2626`q` if its sample is a cell.
2727
2828Regular form: *2-fixed*.
@@ -30,13 +30,13 @@ Regular form: *2-fixed*.
3030Example:
3131
3232```
33−~zod:dojo> =a $@(%foo $:(p=%bar q=@ud))
33+~zod:dojo> =a $@(%foo $:(p=%baz q=@ud))
3434
3535~zod:dojo> (a %foo)
3636%foo
3737
38−~zod:dojo> `a`[%bar 99]
39−[p=%bar q=99]
38+~zod:dojo> `a`[%baz 99]
39+[p=%baz q=99]
4040
4141~zod:dojo> $:a
4242[%foo p=0 q=0]
docs/reference/rune/bus/wut.udon+6−7
@@ -11,8 +11,7 @@
1111
1212## Normalizes to
1313
14−The first item in `p` which normalizes the sample to itself;
15−otherwise, default.
14+The first item in `p` which normalizes the sample to itself.
1615
1716Void, if `p` is empty.
1817
@@ -24,19 +23,19 @@ The first item in `p`.
2423
2524Regular: *running*.
2625
27−Irregular: `?(%foo %bar)` is `$?(%foo %bar)`.
26+Irregular: `?(%foo %baz)` is `$?(%foo %baz)`.
2827
2928## Discussion
3029
31−For a union of atoms, a `$?` ("buswut") is fine. For more complex nouns,
32−always try to use a [`$%` ("buscen")](../cen/), [`$@` ("busvat")](../vat/) or
33−[`$^` ("busket")](../ket/), at least if you expect your structure to be used as a
30+For a union of atoms, a `$?` is fine. For more complex nouns,
31+always try to use a [`$%`](../cen/), [`$@`](../vat/) or
32+[`$^`](../ket/), at least if you expect your structure to be used as a
3433normalizer.
3534
3635## Examples
3736
3837```
39−~zod:dojo> =a ?(%foo %bar %baz)
38+~zod:dojo> =a ?(%foo %baz %baz)
4039
4140~zod:dojo> (a %baz)
4241%baz
docs/reference/rune/ket/hep.udon+1−1
@@ -19,7 +19,7 @@
1919
2020Regular: *2-fixed*.
2121
22−Irregular: `` `foo`bar`` is `^-(foo bar)`.
22+Irregular: `` `foo`baz`` is `^-(foo baz)`.
2323
2424## Discussion
2525
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
1919
2020Regular: *2-fixed*.
2121
22−Irregular: `foo=bar` is `^=(foo bar)`.
22+Irregular: `foo=baz` is `^=(foo baz)`.
2323
2424## Examples
2525
2626```
2727~zod:dojo> a=1
2828a=1
29+
2930~zod:dojo> ^= a
3031 1
3132a=1
33+
3234~zod:dojo> ^=(a 1)
3335a=1
36+
3437~zod:dojo> [b c d]=[1 2 3 4]
3538[b=1 c=2 d=[3 4]]
39+
3640~zod:dojo> [b c d=[x y]]=[1 2 3 4]
3741[b=1 c=2 d=[x=3 y4]]
3842```
docs/reference/rune/mic/col.udon+2
@@ -47,8 +47,10 @@ Irregular: `:(add a b c)` is `;:(add a b c)`.
4747```
4848~zod:dojo> (add 3 (add 4 5))
494912
50+
5051~zod:dojo> ;:(add 3 4 5)
515212
53+
5254~zod:dojo> :(add 3 4 5)
535512
5456```
docs/reference/rune/mic/mic.udon+1−9
@@ -17,8 +17,7 @@
1717a
1818```
1919
20−> Note: the expansion implementation is hygienic -- it doesn't actually add the
21−> `a` face to the subject.
20+> Note: the expansion implementation is hygienic -- it doesn't actually add the `a` face to the subject.
2221
2322## Syntax
2423
@@ -41,13 +40,6 @@ Succeeds because molds don't care about auras:
4140"abc"
4241```
4342
44−Succeeds because the mold normalizes:
45−
46−```
47−~zod:dojo> (tape [50 51 52])
48−"23"
49−```
50−
5143Fails because not a fixpoint:
5244
5345```
docs/reference/rune/mic/sig.udon+3−4
@@ -12,8 +12,7 @@ product-sample adapter.
1212
1313## Produces
1414
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.
1716
1817## Expands to
1918
@@ -51,9 +50,9 @@ transforms a `q` product and a `q` gate into a `q` sample.
5150
5251## Discussion
5352
54−Apparently `;~` ("micsig") is a "Kleisli arrow." It's also
53+Apparently `;~` is a "Kleisli arrow." It's also
5554a 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,
5756so you don't need to either.
5857
5958`;~` is often used in parsers, but is not only for parsers.