on master help sign in
link tiwgs
c655a0fTobias Merkle
docs/arvo/basic.md+7−5
@@ -163,7 +163,7 @@ You can write:
163### Lines 12-34
163### Lines 12-34
164
164
165Now let's quickly walk through this code line-by-line. Lines 12-34 are
165Now let's quickly walk through this code line-by-line. Lines 12-34 are
166−wrapped in a `|%` ('barcen'), which produces a core. Cores are a
166+wrapped in a `|%` ('[barcen](/hoon/twig/bar-core/cen-core/)'), which produces a core. Cores are a
167fundamental datatype in Hoon, similar to a struct, class, or object. A
167fundamental datatype in Hoon, similar to a struct, class, or object. A
168core is just a map of names to any kind of code, whether it be functions
168core is just a map of names to any kind of code, whether it be functions
169or data. Each element in this map begins with a `++` followed by the
169or data. Each element in this map begins with a `++` followed by the
@@ -182,7 +182,7 @@ Let's step into each of the three arms within our core.
182 (add (five a) (three a))
182 (add (five a) (three a))
183 --
183 --
184
184
185−`|=` ('bartis') produces a function, much like a lambda in lisp. It
185+`|=` ('[bartis](/hoon/twig/bar-core/tis-gate/)') produces a function, much like a lambda in lisp. It
186takes two children:
186takes two children:
187
187
1881. A set of argument(s). In this case our argument set only contains
1881. A set of argument(s). In this case our argument set only contains
@@ -207,7 +207,7 @@ takes two children:
207As above, `++three` takes an integer argument, `a`, and then executes
207As above, `++three` takes an integer argument, `a`, and then executes
208the remainder of the code with `a` set to the actual arguments.
208the remainder of the code with `a` set to the actual arguments.
209
209
210−Similarly, `=|` ('tisbar') pushes its first child, `b` into our context
210+Similarly, `=|` ('[tisbar](/hoon/twig/tis-flow/bar-new/)') pushes its first child, `b` into our context
211(in other words, it declares a variable `b`) and executes the remainder
211(in other words, it declares a variable `b`) and executes the remainder
212of the code. However, `b` is not an argument; `=|` sets `b` to the
212of the code. However, `b` is not an argument; `=|` sets `b` to the
213default value of whatever type it is declared as. Since the default
213default value of whatever type it is declared as. Since the default
@@ -225,10 +225,10 @@ value of an atom is `0`, b is set to `0`.
225So now we have two variables: `a` is set to our input, and `b` is
225So now we have two variables: `a` is set to our input, and `b` is
226initialized to `0`.
226initialized to `0`.
227
227
228−One way to think about `|-` ('barhep') is that it lays down a recursion
228+One way to think about `|-` ('[barhep](/hoon/twig/bar-core/hep-loop/)') is that it lays down a recursion
229point. More on this later.
229point. More on this later.
230
230
231−`^-` ('kethep') is just a cast that sets the result of the remainder of
231+`^-` ('[kethep](/hoon/core/ket-cast/hep-cast/)') is just a cast that sets the result of the remainder of
232the code to an unsigned integer, `@u`.
232the code to an unsigned integer, `@u`.
233
233
234In pseudocode, the last three lines read like this: if `a` is less than
234In pseudocode, the last three lines read like this: if `a` is less than
@@ -272,6 +272,8 @@ our cheatsheat at the bottom.
272 =(a b) test equality
272 =(a b) test equality
273 (function args ...) call function with args
273 (function args ...) call function with args
274
274
275+Lookup each of these expressions (and all others!) in the [Twig Expressions](/hoon/twig/) definition.
276+
275### New material
277### New material
276
278
2771. There are two syntaxes for writing Hoon: tallform and wideform.
2791. There are two syntaxes for writing Hoon: tallform and wideform.