@@ -256,12 +256,45 @@ We can use `ten(b 25)` to produce a variant of `ten`. Calling this mutant versi
259−Before finishing the lesson let's unbind `ten`:
259+Let's unbind `ten`:
267+Let's examine a new gate.
275+$(c (add a c), b (dec b))
278+This gate takes two arguments and multiplies them together using only `add` and `dec` This is an extremely naive way to do multiplication but let's examine it anyway.
280+The first thing worth noticing is the new rune `|-` which you can think of as a looping structure. We're denoting some bit of code that we want to run multiple times. This is a lie but go with it for a moment.
282+The next few lines should be pretty clear, if `b` is `0` we're going to return `c`.
283+When it isn't, we are going to use the irregular form of the `%=` rune, the wide form of this line would look like this.
286+%=($ c (add a c), b (dec b))
289+What this rune does is resolve a wing with changes. In this case, and in many you will see, the wing we want to resolve is `$` or the `|-` we are inside. The rest are a set of changes to make to the subject of that wing. We are going to add `a` to `c` and decrement `b` and then run the code again starting from `|-`.
291+In the next lesson, we'll examine `|-` in more detail.
295+Hoon code is compiled to Nock and Nock is extremely simple and naive in the way a number of things are done. For example, the only mathematical operation Nock has is increment. All other mathematical functions are built out of this. While this is conceptually doable, actually running this code could be unnecessarily slow. This is the reason for jets, a set of functionally identical code that could be run instead of the compiled Nock to speed up execution. To learn more about Jets see [jets doc].
265## Exercise 1.5.1 Solution
298## Exercise 1.5.1 Solution
267Write a gate that takes an atom, `a=@`, and which returns double the value of `a`. Bind this gate to `double` and test it in the dojo.
300Write a gate that takes an atom, `a=@`, and which returns double the value of `a`. Bind this gate to `double` and test it in the dojo.
@@ -276,4 +309,4 @@ Write a gate that takes an atom, `a=@`, and which returns double the value of `a
279−### [Next Lesson: Multi-gate Cores and Doors](../multi-gate-cores-and-doors)
312+### [Recursion](../recursion)