on master help sign in
revising language and attempt at example
commitab54cd5919bcc3f8a4913a2e68a45df748d26782 authorsyzygyzer <jon@tlon.io> dateThu 7 May 2020, 15:53 (6 years ago) parent755db71
1 file changed+23−12
reference/hoon-expressions/rune/lus.md+23−12
reference/hoon-expressions/rune/lus.md+23−12
@@ -150,7 +150,7 @@ Regular: **variadic**.
150150
151151`a`, `c`, `e` are arm names and `b`, `d`, `f` are any Hoon expression. Note that unlike all other
152152runes with a variable number of arguments, the list of arguments of `+*` does
153−not end with a terminating rune.
153+not end with a terminator.
154154
155155`+*` arms must always come at the beginning of the battery, before any other
156156type of lus arm.
@@ -158,13 +158,14 @@ type of lus arm.
158158##### Discussion
159159
160160The primary use of `+*` is to assign aliases to doors (see Examples below).
161−However, they may also be used to define "virtual arms" which behave just like
162−ordinary arms (?) except they allow nesting within cores that requires a specific
163−number of arms, such as Gall apps. Put another way, no matter how many virtual
161+However, they may also be used to define "virtual arms" which behave like
162+ordinary arms except that they allow nesting within cores that requires a specific
163+number of arms, such as Gall app cores. Put another way, no matter how many virtual
164164arms are defined in a `+*` statement, the interpreter will see it as only being
165165a single arm for the purposes of nesting.
166166
167−Under the hood, `+*` gets compiled `=*`'s. `+* foo bar` rewrites each `++` arm to include
167+Under the hood, `+*` gets compiled as `=*`'s. `+* foo bar` rewrites each `++`
168+arm beneath it in the core to include
168169`=* foo bar`. For example, the interpreter sees this Hoon expression
169170
170171```hoon
@@ -196,9 +197,10 @@ To assign an alias to a door, we often write the following.
196197```
197198This is the idomatic way to assign the alias `this` to the door.
198199
199−Gall app cores have a fixed number of arms, but sometimes you'd like to have more.
200−This is where virtual arms come in. We note that it is often better style to
201−compose cores with `=>` or `=<` to add more arms to a Gall app, though.
200+Sometimes cores, such as Gall app cores, have a fixed number of arms, but you'd
201+like to include more. This is where virtual arms may be of use. We note that it
202+is often better style to compose cores with `=>` or `=<` to add more arms to a
203+Gall app, though. This usage of `+*` is controversial and should be minimized.
202204
203205```hoon
204206|_ =bowl:gall
@@ -209,8 +211,17 @@ compose cores with `=>` or `=<` to add more arms to a Gall app, though.
209211This assigns the door the alias `this`, the sample of the door `samp`, and the
210212context of the door `cont`.
211213
214+You may also call functions with `+*` by making use of e.g. the `%~` rune.
212215
213−
214−You are not restricted to lark expressions. Functions may be defined as well...
215−(insert example)
216−
216+```hoon
217+=<
218+ |_ a=@
219+ +* do ~(. +> a)
220+ ++ stuff foo:do
221+::etc
222+--
223+|_ b=@
224+++ foo %bar
225+::etc
226+--
227+```