@@ -7,28 +7,56 @@
8# `|_ "barcab"`
8# `|_ "barcab"`
10−`[%brcb p=spec q=(map term hoon)]`: produce a door, a many-armed core
11−with a sample.
10+Produce a *door* (a core with a sample).
13−## Expands to
12+## Syntax
17−|% q
18+++ name-1 b=hoon
21−## Syntax
25+Note: The `++` rune may be replaced with any other rune in the `+` family.
30+[%brcb p=spec q=alas r=(map term tome)]
23−Regular: *1-fixed*, then *battery*.
33+## Semantics
35+The product of a `|_` expression is a *door*, a core with one or more arms whose payload includes a sample. That is, a door is a cell of `[battery [sample context]]`, where the `battery` contains one or more arms.
37+`a` defines the door sample type and usually includes a name assignment (e.g., `n=@`). `a` is followed by a series of arm definitions, each of which begins with a rune in the `+` family (most of `++`). There must be at least one arm, but there may be arbitrarily many. Each arm must include a name, which is followed by the expression (`b`, `c`, and `d` above) that defines the arm product.
39+The context of the door is the subject of the `|_` expression.
25## Discussion
53## Discussion
27A door is the general case of a gate (function). A gate is a
55A door is the general case of a gate (function). A gate is a
28−door with only one arm, which has the empty name `$`.
56+door with only one arm, which has the name `$`.
30Calling a door is like calling a gate except the caller also needs
58Calling a door is like calling a gate except the caller also needs
31−to specify the arm to be computed. So, for example, if you have some door `d` which contains some arm `a`, and you want to pass some argument (i.e., input value `arg`, you would call it with `~(a d arg)`.
59+to specify the arm to be computed. So, for example, if you have some door `door` which contains some arm `arm`, and you want to pass some argument (i.e., input value `arg`), you would call it with `~(arm door arg)`.
33Because gates are also doors, you can call them the same way. To call the gate `foo` as a door, instead of `(foo baz)` we would write `~($ foo baz)`. This
61Because gates are also doors, you can call them the same way. To call the gate `foo` as a door, instead of `(foo baz)` we would write `~($ foo baz)`. This
34is an irregular form for `%~($ foo baz)`, [%~](../../cen/sig).
62is an irregular form for `%~($ foo baz)`, [%~](../../cen/sig).