on master help sign in
Update 1c.md
01fa0afrmariani
docs/hoon/library/1c.md+15−11
@@ -17,17 +17,16 @@ Atom representing block size. A block of size `a` has a bitwidth of `2^a`.
17
17
18#### Examples
18#### Examples
19
19
20− ::++met measures how many a-bloqs long an atom is. In other words, how
20+ :: ++met measures how many a-bloqs long an atom is.
21− many bloqs of size a would be needed to represent b.
22
21
23− > (met 3 256) ::one 3-bloq has a bidwidth of 8, which can represent 0-255
22+ > (met 3 256)
24 2
23 2
25
24
26 > (met 3 255)
25 > (met 3 255)
27 1
26 1
28
27
29− > (met 3 65.535) ::two 3-bloqs together have a bidwidth of 16, which can represent 0-65,535
28+ > (met 3 65.535)
30− > 2
29+ 2
31
30
32 > (met 2 65.536)
31 > (met 2 65.536)
33 > 3
32 > 3
@@ -47,8 +46,8 @@ Atom representing block size. A block of size `a` has a bitwidth of `2^a`.
47#### Discussion
46#### Discussion
48
47
49You can think of `bloq` as a numeral system that can represent values of
48You can think of `bloq` as a numeral system that can represent values of
50−`a^2^2`, where `a` is the size of a given block. That's because a block of size
49+`a^2^2`, where `a` is the block size. That's because a block of size
51−`a` is `a^2` bits wide, and a binary number that is `b` bits wide can represent
50+`a` contains `a^2` bits, and a binary number that is `b` bits wide can represent
52`b^2` values.
51`b^2` values.
53
52
54A `bloq` of 0 has a bitwidth of 1. (2^0 bits; can represent 2 values.)
53A `bloq` of 0 has a bitwidth of 1. (2^0 bits; can represent 2 values.)
@@ -61,6 +60,7 @@ A `bloq` of 3 has a bitwidth of 8. (2^3 bits; can represent 256 values.)
61
60
62And so on.
61And so on.
63
62
63+See the [bit arithmetic](../2c) section for operations that use `bloq`s.
64
64
65***
65***
66
66
@@ -109,14 +109,18 @@ product noun. If used dryly as a type, the subject must have a sample type of
109 <1.rdl {* <31.ohr 1.jmk $143>}>
109 <1.rdl {* <31.ohr 1.jmk $143>}>
110 <1.rdl {* <31.ohr 1.jmk $143>}>
110 <1.rdl {* <31.ohr 1.jmk $143>}>
111
111
112− > (`gate`|=(a/* [a 'b']) 1)
112+ > (`gate`|=(a=* [a 'b']) 1)
113 [1 98]
113 [1 98]
114
114
115+ > (`gate`|=(a=@ [a 'b']) 1)
116+ ! nest-fail
117+ ! exit
118+
115#### Discussion
119#### Discussion
116
120
117A `gate` is analogous to a function in other programming languages. We created
121A `gate` is analogous to a function in other programming languages. We created
118this new jargon because other constructs in Urbit are "functions" in the
122this new jargon because other constructs in Urbit are "functions" in the
119−mathematical sense.
123+mathematical sense. Any `gate` normalizes to an iron `gate`.
120
124
121See also: [`++lift`](../2a), [`++cork`](../2n)
125See also: [`++lift`](../2a), [`++cork`](../2n)
122
126
@@ -257,7 +261,7 @@ A mold generator. Produces a tuple of four of the types passed in.
257
261
258Mold of pair of `list` and type
262Mold of pair of `list` and type
259
263
260−A mold generator. Produces a tuple of a list of `a` and the mold of `b`.
264+A mold generator. Produces a tuple of a `list` of `a` and the mold of `b`.
261
265
262#### Source
266#### Source
263
267
@@ -275,7 +279,7 @@ A mold generator. Produces a tuple of a list of `a` and the mold of `b`.
275#### Discussion
279#### Discussion
276
280
277A common pattern in Hoon code is to return a `list` of changes, along with a
281A common pattern in Hoon code is to return a `list` of changes, along with a
278−new state. You'll often see `quip` it used in Gall apps.
282+new state. You'll often see `quip` used in Gall apps.
279
283
280***
284***
281### `++trap`
285### `++trap`