@@ -10,15 +10,72 @@ needed to run those formulas correctly.
11Four core runes (`|=`, `|.`, `|-`, and `|*`) produce a
11Four core runes (`|=`, `|.`, `|-`, and `|*`) produce a
12core with a single arm, named `$`. We can recompute this arm
12core with a single arm, named `$`. We can recompute this arm
13−with changes, which useful for recursion among other things:
13+with changes, which is useful for recursion among other things.
17### |$ "barbuc"
17### |$ "barbuc"
19−`{$brbs sample=(lest term) body=spec} `
19+Produces a wet gate that creates a structure parameterized by molds.
21−Produces a wet gate with a single arm named `$` (I think).
21+##### Syntax
25+|$ a=(lest term) b=spec
30+[%brbs sample=(lest term) body=spec]
35+`|$` is used to create a wet gate that is polymorphic in its input types and
36+produces a structure. `a` is a `lest` of `term` used as identifiers for the
37+input types. `b` is a structure built from elements of `a`. The output of `|$`
38+is a `spec` obtained by substituting the input types parameterized by `a` into
43+I'm having some trouble deciphering this, would appreciate help. From `hoon.hoon`:
46+ [%brtr [%bscl -] [%ktcl body.gen]]
47+ %+ turn `(list term)`sample.gen
51+ [%bsts term [%bssg tar [%bshp tar tar]]]
56+`|$` is a restricted form of `|*`. The use of `|$` over `|*` is one of style, as either could
57+be used to make wet gates that produce structures. The buc in `|$` is a hint that
58+`|$` is closely related to buc runes, and thus `|$` should be used to make wet
59+gates that produce structures, while `|*` should be used for any other sort of
60+wet gate. Thus, the second argument of `|$` is frequently a buc
61+rune. For further discussion of wet gates, see the entry for [`|*`](#bartar).
63+Unlike other single-armed cores, `|$` does not have an arm named `$` that can be recursed upon.
65+Proper style for `|$` is to enclose the first argument with brackets, even if it
66+is only a single term. The interpeter will accept a single term without brackets
67+just fine, but this style is for consistency with the fact that the first argument is a `lest`.
72+~zod:dojo> =foo |$([a b] [b a])
74+~zod:dojo> =bar (foo [@ @tas])
76+~zod:dojo> (bar %cat 3)
23### |_ "barcab"
80### |_ "barcab"
@@ -236,7 +293,7 @@ AST:
236[%brdt p=hoon]
293[%brdt p=hoon]
239−Semantics:
296+##### Semantics
241A `|.` expression produces a core with a single arm, `$`. The core isn't explicitly given a sample. `a` is a Hoon expression that defines the computation of the `$` arm.
298A `|.` expression produces a core with a single arm, `$`. The core isn't explicitly given a sample. `a` is a Hoon expression that defines the computation of the `$` arm.
@@ -460,7 +517,8 @@ AST:
461##### Semantics
518##### Semantics
520+A `|*` expression produces a wet gate. `a` defines the gate's sample, and `b`
463−A `|*` expression produces a wet gate. `a` defines the gate's sample, and `b` is a Hoon expression that determines the output value of the gate.
521+is a Hoon expression that determines the output value of the gate.
465##### Expands to
523##### Expands to
@@ -487,6 +545,9 @@ with `$()`.
488> `$(...)` expands to `%=($ ...)` (["centis"](@/docs/reference/hoon-expressions/rune/cen.md#centis)).
546> `$(...)` expands to `%=($ ...)` (["centis"](@/docs/reference/hoon-expressions/rune/cen.md#centis)).
548+`|*` can be used to make wet gates that produce structures, but this usage is
549+discouraged in favor of `|$`.
490##### Examples
551##### Examples
492Wet and dry gates in a nutshell:
553Wet and dry gates in a nutshell: