on master help sign in
simplify example, clarify initial accumulator
commite7adaa386dc8503a9d4a3bebdeaf3f47915c0ff0 authordrbeefsupreme <drbeefsupreme@discordja.net> dateWed 16 Jun 2021, 11:31 (5 years ago) parent24662ea
1 file changed+7−7
hoon/reference/stdlib/2b.md+7−7
hoon/reference/stdlib/2b.md+7−7
@@ -564,7 +564,7 @@ the final value of the accumulator.
564564(To "slam" means to call a gate and give it a sample/samples. In this instance,
565565`a` is the list of samples that are given to the gate b.)
566566
567−The initial value of the accumulator is the bunt of `b`'s second argument. This can occasionally produce
567+The initial value of the accumulator is the bunt of `b`'s second argument (`+<+`). This can occasionally produce
568568undesired behavior (see examples). If you need more control over the initial
569569value, try making use of `$_` and `|:`, or perhaps [`+spin`](#spin) or
570570[`+spun`](#spun).
@@ -621,7 +621,7 @@ since that is the bunt of `@`:
621621```
622622We can fix this with `|:`:
623623```
624−> (reel `(list @)`~[1 2 3 4] |:([a=`@`1 b=`@`1] (mul a b)))
624+> (reel `(list @)`~[1 2 3 4] |:([a=1 b=1] (mul a b)))
62562524
626626```
627627
@@ -639,10 +639,10 @@ producing the final value of the accumulator.
639639(To "slam" means to call a gate and give it a sample/samples. In this instance,
640640`a` is the list of samples that are given to the gate b.)
641641
642−The initial value of the accumulator is `+>+.$`. This can occasionally produce
643−unexpected behavior (see examples). If you need more control over the initial
644−value, try making use of `$_` and `|:`, or perhaps [`+spin`](#spin) or
645−[`+spun`](#spun).
642+The initial value of the accumulator is `b`'s second argument (`+<+`). This can
643+occasionally produce undesired behavior (see examples). If you need more control
644+over the initial value, try making use of `$_` and `|:`, or perhaps
645+[`+spin`](#spin) or [`+spun`](#spun).
646646
647647#### Accepts
648648
@@ -696,7 +696,7 @@ since that is the bunt of `@`:
696696```
697697We can fix this with `|:`:
698698```
699−> (roll `(list @)`~[1 2 3 4] |:([a=`@`1 b=`@`1] (mul a b)))
699+> (roll `(list @)`~[1 2 3 4] |:([a=1 b=1] (mul a b)))
70070024
701701```
702702