@@ -77,7 +77,7 @@ nest-fail
78### The `.=` and `.+` Runes
78### The `.=` and `.+` Runes
80−You saw earlier in the chapter how a type check is performed when `.=` -- or its irregular variant, `=( )` -- is used. For any expression of the form `=(a b)`, either the type of `a` must be a subset of the type of `b` or the type of `b` must be a subset of the type of `a`. Otherwise, the type check fails and you'll get a `nest-fail`.
80+You saw earlier in Chapter 1 how a type check is performed when `.=` -- or its irregular variant, `=( )` -- is used. For any expression of the form `=(a b)`, either the type of `a` must be a subset of the type of `b` or the type of `b` must be a subset of the type of `a`. Otherwise, the type check fails and you'll get a `nest-fail`.
83> =(12 [33 44])
83> =(12 [33 44])
@@ -129,7 +129,7 @@ nest-fail
132−We'll talk in more detail about the various kinds of type-checking that can occur at arm evaluation when we discuss type polymorphism in Chapter 3.
132+We'll talk in more detail about the various kinds of type-checking that can occur at arm evaluation when we discuss type polymorphism later in Chapter 2.
134This isn't a comprehensive list of the type checks in Hoon. It's only some of the most commonly used kinds. Two other runes that include a type check are `=.` and `%_`.
134This isn't a comprehensive list of the type checks in Hoon. It's only some of the most commonly used kinds. Two other runes that include a type check are `=.` and `%_`.
@@ -175,7 +175,7 @@ It's important to remember to include a cast rune with each gate expression. Th
176### (Dry) Gate Sample Definitions
176### (Dry) Gate Sample Definitions
178−By now you've used the `|=` rune to define several gates. This rune is used to produce a 'dry' gate, which has different type-checking and type-inference properties than a 'wet' gate does. We won't explain the wet/dry distinction until Chapter 3 -- for now, just keep in mind that we're only dealing with one kind of gate (albeit the more common kind).
178+By now you've used the `|=` rune to define several gates. This rune is used to produce a 'dry' gate, which has different type-checking and type-inference properties than a 'wet' gate does. We won't explain the wet/dry distinction until later in Chapter 2 -- for now, just keep in mind that we're only dealing with one kind of gate (albeit the more common kind).
180The first subexpression after the `|=` defines the sample type. Any faces used in this definition have the type declared for it in this definition. Consider again the addition function:
180The first subexpression after the `|=` defines the sample type. Any faces used in this definition have the type declared for it in this definition. Consider again the addition function:
@@ -190,13 +190,11 @@ $(a +(a), b (dec b)) :: add a+1 and b-1
190We run it in the dojo using a cell to pass the two arguments:
190We run it in the dojo using a cell to pass the two arguments:
193−> +add [12 14]
193+> +add 12 14
202If you try to call this gate with the wrong kind of argument, you get a `nest-fail`. If the call succeeds, then the argument takes on the type of the sample definition: `[a=@ b=@]`. Accordingly, the inferred type of `a` is `@`, and the inferred type of `b` is `@`. In this case some type information has been thrown away; the inferred type of `[12 14]` is `[@ud @ud]`, but the addition program takes all atoms, regardless of aura.
200If you try to call this gate with the wrong kind of argument, you get a `nest-fail`. If the call succeeds, then the argument takes on the type of the sample definition: `[a=@ b=@]`. Accordingly, the inferred type of `a` is `@`, and the inferred type of `b` is `@`. In this case some type information has been thrown away; the inferred type of `[12 14]` is `[@ud @ud]`, but the addition program takes all atoms, regardless of aura.