on master help sign in
Merge branch 'cleanorg' of https://github.com/urbit/docs into cleanorg
7e26f16Henry Ault
docs.md+2−1
@@ -1,5 +1,6 @@
1---
1---
2anchor: none
2anchor: none
3+footer: true
3---
4---
4
5
5<div class="lead">
6<div class="lead">
@@ -8,5 +9,5 @@ anchor: none
8</div>
9</div>
9
10
10<div class="sections lead-offset">
11<div class="sections lead-offset">
11− <kids></kids>
12+ <kids grid="true"></kids>
12</div>
13</div>
docs/system/hoon/core/twig/mold.md+2−2
@@ -10,7 +10,7 @@ molds are often called "structures.")
10
10
11## Overview
11## Overview
12
12
13−While Hoon can't check this property statically, any true mold
13+While Hoon can't check this property statically, a proper mold
14is a *rectifier*: an idempotent function across all nouns. If
14is a *rectifier*: an idempotent function across all nouns. If
15the sample of a gate has span `%noun`, and its body obeys the
15the sample of a gate has span `%noun`, and its body obeys the
16constraint that for any x, `=((mold x) (mold (mold x)))`, it's a
16constraint that for any x, `=((mold x) (mold (mold x)))`, it's a
@@ -129,7 +129,7 @@ Similarly, `%foo` is the number `7.303.014` or `0x6f.6f66`;
129Translation:
129Translation:
130
130
131```
131```
132−{a b c}` :bank(a b c)
132+{a b c} :bank(a b c)
133a/b :coat(a b)
133a/b :coat(a b)
134?(a b c) :pick(a b c)
134?(a b c) :pick(a b c)
135_a :shoe(a)
135_a :shoe(a)
docs/system/hoon/runes/bc/bcbr.mddeleted−41
@@ -1,41 +0,0 @@
1−`$| bucbar`
2−===========
3−
4−Union between atom and cell.
5−
6−[mold]() that's a union of an atom `p` and cell `q`.
7−`$|` is similar to [`$?`](), but is more strict in that in
8−only contains one atom mold and one cell mold.
9−
10−### Produces
11−
12−A validator function that validates atoms as mold `p` and cells as mold `q`.
13−
14−### Accepts
15−
16−`p` is a `mold` of an atom and `q` is a `mold` of a cell.
17−
18−### Tall form
19−
20− $| p
21− q
22−
23−### Wide form
24−
25− $|(p q)
26−
27−### Examples
28−
29− ~zod/try=> ($|(@t [@ud @ux]) 'hello')
30− 'hello'
31− ~zod/try=> (,$|(@ [@t @ud]) 44 44)
32− [',' 44]
33− ~zod/try=> *$|(~ [~ u=@])
34− ~
35−
36− ++ list |* a=_,* :: null-terminated list
37− $|(~ [i=a t=(list a)]) ::
38−
39−In `++list`, `$|` specifies that every element in a noun that can be
40−cast to a `++list` is either the atom `~` or the cell
41−`[i=a t=(list a)]`.
docs/system/hoon/runes/bc/bccb.md+18−44
@@ -1,52 +1,26 @@
1−`$_ buccab`
1+# `:shoe, $_, "buccab", {$shoe p/twig}`
2−===========
3
2
4−Unbunt (create mold from example).
3+Type as a single example.
5
4
6−Uses a [++twig]() `p` to produce a [mold]() for the type (span)
5+Product: a mold whose product is always `p`.
7−of `p`. The validator function has a default value of `p`. Used
8−when either (1) you want the default value of a mold to be
9−anything other than the standard default value ([bunt]()), or (2)
10−you are referring to a type (span) that is difficult or
11−cumbersome to describe in any way other than by example.
12
6
13−Produces
7+Regular form: *1-fixed*.
14−--------
15
8
16−A mold whose span is the span of `p`.
9+Irregular form:
10+```
11+_%foo :shoe(%foo)
12+```
17
13
18−Accepts
14+Example:
19−-------
15+```
16+~zod:dojo> =a :shoe([%foobar %moobaz])
20
17
21−`p` is a twig.
18+~zod:dojo> (a %foo %bar)
19+[%foobar %moobaz]
22
20
23−Tall form
21+~zod:dojo> `a`[%foobar %moobaz]
24−---------
22+[%foobar %moobaz]
25
23
26− $_ p
24+~zod:dojo $:a
27−
25+[%foobar %moobaz]
28−Wide form
26+```
29−---------
30−
31− $_(p)
32−
33−Irregular form
34−--------------
35−
36− _p
37−
38−Examples
39−--------
40−
41− ~zod/try=> *_12
42− 12
43− ~zod/try=> *@
44− 0
45− ~zod/try=> :type; *_12
46− 12
47− @ud
48− ~zod/try=> ^-(_(add 2 2) 'a')
49− 97
50−
51−Here, see how the default value of `_12` is 12, whereas the
52−default value of `@`--the type ([span]()) of `12`--is `0`.
docs/system/hoon/runes/bc/bccl.md+18−36
@@ -1,44 +1,26 @@
1−`$: buccol`
1+# `:bank, $:, "buccol", {$bank p/(list moss)}`
2−===========
3
2
4−Tuple of molds.
3+Tuple of molds
5
4
6−Produces
5+Product: a mold which applies the tuple `p` to its sample.
7−--------
8
6
9−A validator function that validates a tuple of nouns against a tuple of [mold]()s.
7+Regular form: *running*.
10
8
11−Accepts
9+Irregular form:
12−--------
10+```
11+{a b c} :bank(a b c)
12+```
13
13
14−`p` is a list of molds.
14+Example:
15+```
16+~zod:dojo> =a :bank(p/@ud q/@tas)
15
17
16−Tall form
18+~zod:dojo> (a 33 %foo)
17−---------
19+[p=33 q=%foo]
18
20
19− $: i.p
21+~zod:dojo> `a`[33 %foo]
20− i.t.p
22+[p=33 q=%foo]
21− i.t.t.p
22− ==
23
23
24−Wide form
24+~zod:dojo> $:a
25−---------
25+[p=0 q=%$]
26−
26+```
27− $:(i.p i.t.p i.t.t.p)
28−
29−Irregular form
30−--------------
31−
32− {i.p i.t.p i.t.t.p}
33−
34−Examples
35−--------
36−
37− ~zod/try=> *[1 2]
38− [%1 %2]
39− ~zod/try=> (,$:(1 2) "ham")
40− [%1 %2]
41− ~zod/try=> (,[1 2] "ham")
42− [%1 %2]
43− ~zod/try=> (,[@ 2] "ham")
44− [104 %2]
docs/system/hoon/runes/bc/bccn.md+14−45
@@ -1,52 +1,21 @@
1−`$% buccen`
1+# `:book, $%, "buctis", {$book p/(list moss)}`
2−====
3
2
4−Tagged union.
3+Tagged union
5
4
6−Produces a [mold]() of a tagged union of a list of case pairs.
5+Product: a mold producing the tagged union of the molds in
6+`p`, all of which must be of the form `:bank(stem bulb)`, where
7+`stem` is an atomic mold.
7
8
8−Produces
9+Regular form: *running*.
9−--------
10
10
11−A validator function that uses the value's [head]() as a tag to select a mold validate the tail of the value.
11+Examples:
12
12
13−Accepts
13+```
14−-------
14+~zod:dojo> =a :book({$foo p/@ud q/@ud} {$bar p/@ud})
15
15
16−A list of cells of molds whose heads must be a [cube]().
16+~zod:dojo> (a [%bar 37])
17+[%bar p=37]
17
18
18−Tall form
19+~zod:dojo> $:a
19−---------
20+[%foo p=0 q=0]~
20−
21+```
21− $% p
22− q
23− ==
24−
25−Examples
26−--------
27−
28− ~zod/try=> $%([%& @p] [%| @t])
29− <1.dhe [* @n <246.qra 41.uuw 374.glo 100.rip 1.ypj %164>]>
30− ~zod/try=> *$%([%& @p] [%| @t])
31− [%.y ~zod]
32− ~zod/try=> :type; *$%([%& @p] [%| @t])
33− [%.y ~zod]
34− {[%.y @p] [%.n @t]}
35− ~zod/try=> :type; *(each ,@p ,@t)
36− [%.y p=~zod]
37− {[%.y p=@p] [%.n p=@t]}
38− ~zod/try=> $%(~ [%a 1])
39− ~ <syntax error at [1 13]>
40− ~zod/try=> $%([%~ ~] [%a 1])
41− <1.yck [* @n <246.qra 41.uuw 374.glo 100.rip 1.ypj %164>]>
42− ~zod/try=> *$%([%~ ~] [%a 1])
43− [~ ~]
44−
45− ++ foot $% [%ash p=twig] :: dry, geometric
46− [%elm p=twig] :: wet, generic
47− [%oak ~] :: XX not used
48− [%yew p=(map term foot)] :: XX not used
49− ==
50−
51−In `++foot`, `$%` creates a list of possible cases. That is, a `++foot`
52−can be either `%ash`, `%elm`, `%oak` or `%yew`.
docs/system/hoon/runes/bc/bchp.mdnew file+15
@@ -0,0 +1,15 @@
1+# `:lamb, $-, "buchep", {$lamb p/moss q/moss}`
2+
3+Function type.
4+
5+Product: a mold producing a gate accepting
6+
7+Regular form: *2-fixed*.
8+
9+Example:
10+```
11+~zod:dojo> =a :lamb($foo $bar)
12+
13+~zod:dojo> ($:a %foo)
14+%bar
15+```
docs/system/hoon/runes/bc/bcls.mddeleted−57
@@ -1,57 +0,0 @@
1−`$+ buclus`
2−===========
3−
4−Type of function (type signature).
5−
6−Produces a [mold]() for a function that accepts `p` and produces `q`. Used when we want to use the type of a function that we do not want to compute.
7−
8−Reduces to `$_(|+(p _q))`.
9−
10−Produces
11−--------
12−
13−A mold whose [span]() is used to validate the types of functions.
14−
15−Accepts
16−-------
17−
18−`p` is the mold of the [argument]() ([sample]()) and `q` is a mold of the product.
19−
20−Tall form
21−---------
22−
23− $+ p q
24−
25−Wide form
26−---------
27−
28− $+(p q)
29−
30−Examples
31−--------
32−
33− ++ sort :: quicksort
34− ~/ %sort
35− !:
36− |* [a=(list) b=$+([* *] ?)]
37− => .(a ^.(homo a))
38− |- ^+ a
39− ?~ a ~
40− %+ weld
41− $(a (skim t.a |=(c=_i.a (b c i.a))))
42− ^+ t.a
43− [i.a $(a (skim t.a |=(c=_i.a !(b c i.a))))]
44−
45−In ++sort, `$+` is a mold for a comparator gate, which takes two nouns
46−and produces a loobean.
47−
48− ~zod/try=> |=(a=@ (add 2 a))
49− <1.sgg [a=@ [[@da @ta] [@p @ta] *''] @n <246.qra 41.uuw 374.glo 100.rip 1.ypj %164>]>
50− ~zod/try=> `$+(@ @)`|=(a=@ (add 2 a))
51− <1|crm [@ [[@da @ta] [@p @ta] *''] @n <246.qra 41.uuw 374.glo 100.rip 1.ypj %164>]>
52− ~zod/try=> +<:|=(a=@ (add 2 a))
53− a=0
54− ~zod/try=> +<:`$+(@ @)`|=(a=@ (add 2 a))
55− ! -axis.6
56− ! peek-park
57− ! exit
docs/system/hoon/runes/bc/bcpm.md+15−21
@@ -1,30 +1,24 @@
1−`$& bucpam`
1+# `:bush, $&, "bucpam", {$bush p/moss q/moss}`
2−===========
3
2
4Union of two cells: one w/cellular head & other w/atomic head.
3Union of two cells: one w/cellular head & other w/atomic head.
5
4
6−Produces a [mold]() that's a union between two different kinds of noun: a cell whose head is a cell (`p`), and cell whose head is an atom (`q`). Its default value ([bunt]()) is the value of `q`. One important use of `$&` is to implement autocons in [`++twig`]().
5+Product: a mold which applies `p` if the head of its sample
6+is a cell, `q` if the head of its sample is a cell.
7
7
8−Produces
8+Regular form: *2-fixed*.
9−--------
10
9
11−A validator function that uses mold `p` to validate cells whose head is a cell, and `q` to validate cells whose head is an atom. Default value is the bunt of `q`.
10+Example:
11+```
12+~zod:dojo> =a :book({$foo p/@ud q/@ud} {$bar p/@ud})
12
13
13−Accepts
14+~zod:dojo> =b :bush({a a} a)
14−-------
15
15
16−A mold of a cell whose head is a cell `p` and a mold of a cell whose head is an atom `q`.
16+~zod:dojo> (b [[%bar 33] [%foo 19 22]])
17+[[%bar p=33] [%foo p=19 q=22]]
17
18
18−Tall form
19+~zod:dojo> (b [%foo 19 22])
19−---------
20+[%foo p=19 q=22]
20
21
21− $& p
22+~zod:dojo> $:b
22− q
23+[%bar p=0]
23−
24+```
24−Wide form
25−---------
26−
27− $&(p q)
28−
29−Examples
30−--------
docs/system/hoon/runes/bc/bcpt.mdnew file+22
@@ -0,0 +1,22 @@
1+# `:claw, $@, "bucpat", {$claw p/moss q/moss}`
2+
3+Type: either an atom or a cell.
4+
5+Product: a mold which applies `p` if its sample is an atom,
6+`q` if its sample is a cell.
7+
8+Regular form: *2-fixed*.
9+
10+Example:
11+```
12+~zod:dojo> =a :claw($foo :bank(p/$bar q/@ud))
13+
14+~zod:dojo> (a %foo)
15+%foo
16+
17+~zod:dojo> `a`[%bar 99]
18+[p=%bar q=99]
19+
20+~zod:dojo> $:a
21+[%foo p=0 q=0]
22+```
docs/system/hoon/runes/bc/bctr.mddeleted−41
@@ -1,41 +0,0 @@
1−`$* buctar`
2−===========
3−
4−Bunt (default value).
5−
6−Produces the default value ([bunt]()) of [mold]() `p`. Does so as a compile-time constant if possible. If not possible, then it is produced dynamically.
7−
8−Produces
9−--------
10−
11−The default value (bunt) of the mold `p`.
12−
13−Accepts
14−-------
15−
16−A mold `p`.
17−
18−Tall form
19−---------
20−
21− $* p
22−
23−Wide form
24−---------
25−
26− $*(p)
27−
28−Irregular form
29−--------------
30−
31− *p
32−
33−Examples
34−--------
35−
36− ~zod/try=> *@t
37− ''
38− ~zod/try=> *[@p @ux]
39− [~zod 0x0]
40− ~zod/try=> *(list ,@)
41− ~
docs/system/hoon/runes/bc/bcts.md+14−52
@@ -1,59 +1,21 @@
1−`$= buctis`
1+# `:coat, $=, "buctis", {$coat p/@tas q/moss}`
2−===========
3
2
4−Add variable name.
3+Add variable name
5
4
6−Wraps a [++face]() around another [mold](). Used primarily to add variable names to values.
5+Product: a mold which puts the label `p` on the mold `q`.
7
6
8−Produces
7+Regular form: *2-fixed*.
9−--------
10
8
11−Produces a [mold]() that validates the input value with `q`, before adding face `p`.
9+Irregular form:
10+```
11+a/b :coat(a b)
12+```
12
13
13−Accepts
14−------
15−
16−`p` is a [++term]().
17−
18−`q` is a mold.
19−
20−Tall form
21−---------
22−
23− $= p
24− q
25−
26−Wide form
27−---------
28−
29− $=(p q)
30−
31−Irregular form
32−--------------
33−
34− `p=q`
35−note: this is only the case when in mold syntax
36−
37−Examples
14+Examples:
38−--------
39−
40−`a=*` parses as `[%bark %a %noun]`.
41−
42− ~zod/try=> *$=(a @)
43− a=0
44− ~zod/try=> :type; *$=(a @)
45− a=0
46− a=@
47− ~zod/try=> :type; *a=@
48− a=0
49− a=@
50− ~zod/try=> :type; *a=[1 2]
51− a=[%1 %2]
52− a=[%1 %2]
53−
54− |_ [hid=bowl vat=axle]
55− ...
56− --
57−See here how we wrap the faces 'hid' and 'vat' around the two [sample]() (input) types of the core above. We can now refer to our 'bowl' and 'vat' by these names.
58
15
16+```
17+~zod:dojo> =a :coat(p $foo)
59
18
19+~zod:dojo> (a %bar)
20+p=%foo
21+```
docs/system/hoon/runes/bc/bcwt.md+15−34
@@ -1,42 +1,23 @@
1−`$? bucwut`
1+# `:pick, $?, "bucwut", {$? p/(list moss)}`
2−===========
3
2
4−Union of types.
3+Generalized type union.
5
4
6−Produce a union between a non-empty list of [mold]()s `p`. The default value ([bunt]()) is the value of the first element.
5+Product: a mold which tries each of the alternatives in `p`.
7
6
8−Produces
7+Note: Use `:pick` only if none of `:book` (`$%`), `:claw` (`$@`) or `:bush` (`$&`) applies.
9−--------
10
8
11−A validator function that keeps trying to validate a value using every mold in `p` from left to right. On a success, the value is produced. If no mold in `p` succeeds, the default value of the last element in `p` is produced.
9+Regular form: *running*.
12
10
13−Accepts
11+Example:
14−-------
12+```
13+~zod:dojo> =a :pick($foo $bar $baz)
15
14
16−`p` is a [++list]() of mold.
15+~zod:dojo> (a %baz)
16+%baz
17
17
18−Tall form
18+~zod:dojo> (a [37 45])
19−---------
19+%foo
20
20
21− $? p
21+~zod:dojo> $:a
22− q
22+$foo
23− ==
23+```
24−
25−Irregular form
26−--------------
27−
28− ?(p q)
29−
30−Examples
31−--------
32−
33− ++ base ?([%atom p=odor] %noun %cell %bean %null) :: axils, @ * ^ ? ~
34−
35−`++base`, `?` (the irregular form of `$?`) specifies a list of
36−orthoganal cases for the `%axil` mold.
37−
38− ~zod/try=> *?(%a %b %c)
39− %a
40− ~zod/try=> :type; *?(%a %b %c)
41− %a
42− {%a %b %c}
docs/system/hoon/runes/br/brcb.md+7−24
@@ -2,37 +2,20 @@
2sort: 7
2sort: 7
3---
3---
4
4
5−`|_ barcab`
5+# `:door`, `|_`, "buccab", `{$door p/moss q/(map term twig)}`
6−===========
7
6
8Door: core with sample (input values).
7Door: core with sample (input values).
9
8
9+Product: a core whose sample is `p` and arms are `q`.
10+
11+Regular form: *1-fixed*, then *battery*
12+
10−Similar to [`|%`](), but also takes input data (aka [sample]())
13+Similar to `|%`, but also takes input data (aka sample)
11available within the entire core. Cores of this type are called doors.
14available within the entire core. Cores of this type are called doors.
12Moreover, `|_` only accepts [dry or `%elm`]() arms--in other words,
15Moreover, `|_` only accepts [dry or `%elm`]() arms--in other words,
13type checking on these arms is performed on the input before computation.
16type checking on these arms is performed on the input before computation.
14
17
15−Produces
16−--------
17−
18−Twig: `[%brcb p=twig q=(map term foot)]`
19−
20−Accepts
21−-------
22−
23−`p` is a a [mold](). `q` is a [`++map`]() with [`++term`]() keys and
24−[`++foot`]() values.
25−
26−Tall form
27−---------
28−
29− |_ p
30− ++ p.n.q
31− q.n.q
32− --
33−
34−Examples
18+Examples:
35−--------
36
19
37 /~zod/try=> =mol
20 /~zod/try=> =mol
38 |_ a=@ud
21 |_ a=@ud
docs/walkthroughs/shell.md+1−1
@@ -248,7 +248,7 @@ The current urbit plot. Read-only.
248
248
249The hood is the system daemon. See `gen/hood` and `app/hood`.
249The hood is the system daemon. See `gen/hood` and `app/hood`.
250
250
251−**`|hi`** - Sends a direct message. Sort of like `finger`. Accepts an urbit name (`@p`) and a string (`cord`).
251+**`|hi`** - Sends a direct message. Sort of like Unix `write`. Accepts an urbit name (`@p`) and a string (`cord`).
252
252
253 ~your-urbit:dojo> |hi ~doznec 'you there?'
253 ~your-urbit:dojo> |hi ~doznec 'you there?'
254
254