on master help sign in
revisions to cen runes
160aa63joshuareagan
docs/reference/rune/cen/cab.udon+5−6
@@ -7,7 +7,7 @@
7
7
8# `%_ "cencab"`
8# `%_ "cencab"`
9
9
10−`[%cncb p=wing q=(list (pair wing hoon))]`: take a wing with changes, preserving type.
10+`[%cncb p=wing q=(list (pair wing hoon))]`: resolve a wing with changes, preserving type.
11
11
12## Expands to
12## Expands to
13
13
@@ -21,21 +21,20 @@ Regular: *1-fixed*, then *jogging*.
21
21
22## Discussion
22## Discussion
23
23
24−`%_` ("cencab") is different from `%=` ("centis") because `%=`
25−can change the type of a limb with mutations.
24+`%_` is different from `%=` because `%=` can change the type of a limb with mutations. `%_` preserves the limb type.
26
25
27## Examples
26## Examples
28
27
29```
28```
30~zod:dojo> =foo [p=42 q=6]
29~zod:dojo> =foo [p=42 q=6]
31
30
32−~zod:dojo> foo(p %bar)
31+~zod:dojo> foo(p %baz)
33−[p=%bar q=6]
32+[p=%baz q=6]
34
33
35~zod:dojo> foo(p [55 99])
34~zod:dojo> foo(p [55 99])
36[p=[55 99] q=6]
35[p=[55 99] q=6]
37
36
38−~zod:dojo> %_(foo p %bar)
37+~zod:dojo> %_(foo p %baz)
39[p=7.496.034 99]
38[p=7.496.034 99]
40
39
41~zod:dojo> %_(foo p [55 99])
40~zod:dojo> %_(foo p [55 99])
docs/reference/rune/cen/dot.udon+5−1
@@ -7,7 +7,7 @@
7
7
8# `%. "cendot"`
8# `%. "cendot"`
9
9
10−`[%cndt p=hoon q=hoon]`: call a gate (function), reversed.
10+`[%cndt p=hoon q=hoon]`: call a gate (function), inverted.
11
11
12## Expands to
12## Expands to
13
13
@@ -19,6 +19,10 @@
19
19
20Regular: *2-fixed*.
20Regular: *2-fixed*.
21
21
22+## Discussion
23+
24+`%.` is just like `%-`, but with its subexpressions reversed; the argument comes first, and then the gate.
25+
22## Examples
26## Examples
23
27
24```
28```
docs/reference/rune/cen/hep.udon+1−10
@@ -23,19 +23,10 @@ Irregular: `(a)` is `$:a`; `(a b c d)` is `%-(a [b c d])`.
23
23
24## Discussion
24## Discussion
25
25
26−`%-` ("cenhep") is a function call; `p` is the function ([`gate`](../../bar/tis),
26+`%-` is used to call a function; `p` is the function ([`gate`](../../bar/tis),
27`q` the argument. `%-` is a special case of [`%~` ("censig")](../sig), and a gate
27`q` the argument. `%-` is a special case of [`%~` ("censig")](../sig), and a gate
28is a special case of a [door](../../bar/cab).
28is a special case of a [door](../../bar/cab).
29
29
30−In a gate, the modified core has only one anonymous arm; in a
31−door it gets a full battery. Intuitively, a gate defines one
32−algorithm it can compute upon its sample, `+6`. A door defines
33−many such algorithms.
34−
35−In classical languages, doors correspond to groups of functions
36−with the same argument list, or at least sharing a prefix. In
37−Hoon, this shared sample is likely to be pulled into a door.
38−
39## Examples
30## Examples
40
31
41```
32```
docs/reference/rune/cen/ket.udon+1−1
@@ -22,7 +22,7 @@ Regular: *4-fixed*.
22## Examples
22## Examples
23
23
24```
24```
25−~zod:dojo> =add-triple |=([a/@ b/@ c/@] :(add a b c))
25+~zod:dojo> =add-triple |=([a=@ b=@ c=@] :(add a b c))
26
26
27~zod:dojo> %^(add-triple 1 2 3)
27~zod:dojo> %^(add-triple 1 2 3)
286
286
docs/reference/rune/cen/lus.udon+1−1
@@ -7,7 +7,7 @@
7
7
8# `%+ "cenlus"`
8# `%+ "cenlus"`
9
9
10−`[%cnls p=hoon q=hoon r=hoon]`: call with pair sample.
10+`[%cnls p=hoon q=hoon r=hoon]`: call gate with a cell sample.
11
11
12## Expands to
12## Expands to
13
13
docs/reference/rune/cen/sig.udon+5−6
@@ -7,7 +7,7 @@
7
7
8# `%~ "censig"`
8# `%~ "censig"`
9
9
10−`[%cnsg p=wing q=hoon r=(list hoon)]`: call with multi-armed door.
10+`[%cnsg p=wing q=hoon r=(list hoon)]`: call an arm in a door.
11
11
12## Expands to
12## Expands to
13
13
@@ -16,7 +16,7 @@
16=<(p %=(a +6 r))
16=<(p %=(a +6 r))
17```
17```
18
18
19−> Note: the expansion implementation is hygienic -- it doesn't actually add the `a` face to the subject. It's shown here because `%=` ("centis") requires a `wing`.
19+> Note: the expansion implementation is hygienic -- it doesn't actually add the `a` face to the subject. It's shown here because `%=` requires a `wing`.
20
20
21## Syntax
21## Syntax
22
22
@@ -29,11 +29,10 @@ Irregular: `~(a b c)` is `%~(a b c)`; `~(a b c d e)` is `%~(a b
29
29
30`%~` ("censig") is the general case of a function call, `%-` ("cenhep"). In
30`%~` ("censig") is the general case of a function call, `%-` ("cenhep"). In
31both, we replace the sample (`+6`) of a core. In `%-` the
31both, we replace the sample (`+6`) of a core. In `%-` the
32−core is a gate and we pull the `$` arm. In `%~` the
32+core is a gate and the `$` arm is evaluated. In `%~` the
33−core is a door and we can pull any of its arms.
33+core is a door and any arm may be evaluated. You must identify the arm to be run: `%~(arm door arg)`.
34
34
35−Most languages do not have cores, doors, or `%~`. "Just
35+See also [`|_`](../../bar/cab).
36−learn to step outside your linear, Western way of thinking."
37
36
38## Examples
37## Examples
39
38
docs/reference/rune/cen/tis.udon+9−10
@@ -7,15 +7,13 @@
7
7
8# `%= "centis"`
8# `%= "centis"`
9
9
10−`[%cnts p=wing q=(list (pair wing hoon))]`: take a wing with changes.
10+`[%cnts p=wing q=(list (pair wing hoon))]`: resolve a wing with changes.
11
11
12## Produces
12## Produces
13
13
14−`p`, modified by the change list `q`.
14+Product of resolution to `p`, modified by the change list `q`.
15
15
16−If `p` resolves to a leg, `q` is a list of changes to that leg.
16+If `p` resolves to a leg, `q` is a list of changes to that leg. The modified leg is returned. If `p` resolves to an arm, `q` is a list of changes to the core containing that arm. The arm is computed with the modified core as the subject, and the product is returned.
17−If `p` resolves to an arm, `q` is a list of changes to the core
18−containing that arm. We compute the arm on the modified core.
19
17
20## Syntax
18## Syntax
21
19
@@ -26,20 +24,21 @@ Irregular: `foo(x 1, y 2, z 3)` is `%=(foo x 1, y 2, z 3)`.
26## Discussion
24## Discussion
27
25
28Note that `p` is a wing, not just any expression. Knowing that a function
26Note that `p` is a wing, not just any expression. Knowing that a function
29−call `(foo bar)` involves making `foo`, replacing its sample
27+call `(foo baz)` involves making `foo`, replacing its sample
30−at slot `+6` with `bar`, and taking the `$` limb, you might think
28+at slot `+6` with `baz`, and resolving to the `$` limb, you might think
31−`(foo bar)` would mean `%=(foo +6 bar)`.
29+`(foo baz)` would mean `%=(foo +6 baz)`.
32
30
33−But it's actually `=+(foo =>(%=(+2 +6 bar) $))`. Even if `foo` is
31+But it's actually `=+(foo =>(%=(+2 +6 baz) $))`. Even if `foo` is
34a wing, we would just be mutating `+6` within the core that defines the
32a wing, we would just be mutating `+6` within the core that defines the
35`foo` arm. Instead we want to modify the *product* of `foo` -- the gate
33`foo` arm. Instead we want to modify the *product* of `foo` -- the gate
36-- so we have to pin it into the subject.
34-- so we have to pin it into the subject.
37
35
38Here's that again in tall form:
36Here's that again in tall form:
37+
39```
38```
40=+ foo
39=+ foo
41=> %= +2
40=> %= +2
42− +6 bar
41+ +6 baz
43 ==
42 ==
44 $
43 $
45```
44```
docs/reference/rune/col/hep.udon+1−1
@@ -35,7 +35,7 @@ Irregular: `[a b c]~` is `[[a b c] ~]`.
35
35
36Hoon expressions actually use the same "autocons" pattern as Nock
36Hoon expressions actually use the same "autocons" pattern as Nock
37formulas. If you're assembling expressions (which usually only the
37formulas. If you're assembling expressions (which usually only the
38−compiler does), `[a b]` is the same as `[%clhp a b]`.
38+compiler does), `[a b]` is the same as `:-(a b)`.
39
39
40## Examples
40## Examples
41
41