on master help sign in
revisions to cen runes
commit160aa63ef3a24b409dfd3b39569667bf24286f22 authorjoshuareagan <joshuareagan@gmail.com> dateWed 10 Oct 2018, 15:23 (8 years ago) parent7b592de
8 files changed+28−36
docs/reference/rune/cen/cab.udon+5−6 docs/reference/rune/cen/dot.udon+5−1 docs/reference/rune/cen/hep.udon+1−10 docs/reference/rune/cen/ket.udon+1−1 docs/reference/rune/cen/lus.udon+1−1 docs/reference/rune/cen/sig.udon+5−6 docs/reference/rune/cen/tis.udon+9−10 docs/reference/rune/col/hep.udon+1−1
docs/reference/rune/cen/cab.udon+5−6
@@ -7,7 +7,7 @@
77
88# `%_ "cencab"`
99
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.
1111
1212## Expands to
1313
@@ -21,21 +21,20 @@ Regular: *1-fixed*, then *jogging*.
2121
2222## Discussion
2323
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.
2625
2726## Examples
2827
2928```
3029~zod:dojo> =foo [p=42 q=6]
3130
32−~zod:dojo> foo(p %bar)
33−[p=%bar q=6]
31+~zod:dojo> foo(p %baz)
32+[p=%baz q=6]
3433
3534~zod:dojo> foo(p [55 99])
3635[p=[55 99] q=6]
3736
38−~zod:dojo> %_(foo p %bar)
37+~zod:dojo> %_(foo p %baz)
3938[p=7.496.034 99]
4039
4140~zod:dojo> %_(foo p [55 99])
docs/reference/rune/cen/dot.udon+5−1
@@ -7,7 +7,7 @@
77
88# `%. "cendot"`
99
10−`[%cndt p=hoon q=hoon]`: call a gate (function), reversed.
10+`[%cndt p=hoon q=hoon]`: call a gate (function), inverted.
1111
1212## Expands to
1313
@@ -19,6 +19,10 @@
1919
2020Regular: *2-fixed*.
2121
22+## Discussion
23+
24+`%.` is just like `%-`, but with its subexpressions reversed; the argument comes first, and then the gate.
25+
2226## Examples
2327
2428```
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])`.
2323
2424## Discussion
2525
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),
2727`q` the argument. `%-` is a special case of [`%~` ("censig")](../sig), and a gate
2828is a special case of a [door](../../bar/cab).
2929
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−
3930## Examples
4031
4132```
docs/reference/rune/cen/ket.udon+1−1
@@ -22,7 +22,7 @@ Regular: *4-fixed*.
2222## Examples
2323
2424```
25−~zod:dojo> =add-triple |=([a/@ b/@ c/@] :(add a b c))
25+~zod:dojo> =add-triple |=([a=@ b=@ c=@] :(add a b c))
2626
2727~zod:dojo> %^(add-triple 1 2 3)
28286
docs/reference/rune/cen/lus.udon+1−1
@@ -7,7 +7,7 @@
77
88# `%+ "cenlus"`
99
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.
1111
1212## Expands to
1313
docs/reference/rune/cen/sig.udon+5−6
@@ -7,7 +7,7 @@
77
88# `%~ "censig"`
99
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.
1111
1212## Expands to
1313
@@ -16,7 +16,7 @@
1616=<(p %=(a +6 r))
1717```
1818
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`.
2020
2121## Syntax
2222
@@ -29,11 +29,10 @@ Irregular: `~(a b c)` is `%~(a b c)`; `~(a b c d e)` is `%~(a b
2929
3030`%~` ("censig") is the general case of a function call, `%-` ("cenhep"). In
3131both, we replace the sample (`+6`) of a core. In `%-` the
32−core is a gate and we pull the `$` arm. In `%~` the
33−core is a door and we can pull any of its arms.
32+core is a gate and the `$` arm is evaluated. In `%~` the
33+core is a door and any arm may be evaluated. You must identify the arm to be run: `%~(arm door arg)`.
3434
35−Most languages do not have cores, doors, or `%~`. "Just
36−learn to step outside your linear, Western way of thinking."
35+See also [`|_`](../../bar/cab).
3736
3837## Examples
3938
docs/reference/rune/cen/tis.udon+9−10
@@ -7,15 +7,13 @@
77
88# `%= "centis"`
99
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.
1111
1212## Produces
1313
14−`p`, modified by the change list `q`.
14+Product of resolution to `p`, modified by the change list `q`.
1515
16−If `p` resolves to a leg, `q` is a list of changes to that leg.
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.
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.
1917
2018## Syntax
2119
@@ -26,20 +24,21 @@ Irregular: `foo(x 1, y 2, z 3)` is `%=(foo x 1, y 2, z 3)`.
2624## Discussion
2725
2826Note that `p` is a wing, not just any expression. Knowing that a function
29−call `(foo bar)` involves making `foo`, replacing its sample
30−at slot `+6` with `bar`, and taking the `$` limb, you might think
31−`(foo bar)` would mean `%=(foo +6 bar)`.
27+call `(foo baz)` involves making `foo`, replacing its sample
28+at slot `+6` with `baz`, and resolving to the `$` limb, you might think
29+`(foo baz)` would mean `%=(foo +6 baz)`.
3230
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
3432a wing, we would just be mutating `+6` within the core that defines the
3533`foo` arm. Instead we want to modify the *product* of `foo` -- the gate
3634-- so we have to pin it into the subject.
3735
3836Here's that again in tall form:
37+
3938```
4039=+ foo
4140=> %= +2
42− +6 bar
41+ +6 baz
4342 ==
4443 $
4544```
docs/reference/rune/col/hep.udon+1−1
@@ -35,7 +35,7 @@ Irregular: `[a b c]~` is `[[a b c] ~]`.
3535
3636Hoon expressions actually use the same "autocons" pattern as Nock
3737formulas. 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)`.
3939
4040## Examples
4141