2c
commit35c05e6a828ab7ee10c6a281895701ac9c953d0e
authorHenry Ault <henry@tlon.io>
dateMon 14 Mar 2016, 18:16 (11 years ago)
parent42a1833
docs/system/hoon/library/src/2c/gate/bex.md+2−2
@@ -2,7 +2,7 @@
22
33Binary exponent
44
5−Computes the result of `2^a`, producing an [atom]().
5+Computes the result of `2^a`, producing an atom.
66
77Accepts
88-------
@@ -19,7 +19,7 @@ Source
1919
2020 ++ bex :: binary exponent
2121 ~/ %bex
22− |= a=@
22+ |= a/@
2323 ^- @
2424 ?: =(0 a) 1
2525 (mul 2 $(a (dec a)))
docs/system/hoon/library/src/2c/gate/can.md+4−4
@@ -3,16 +3,16 @@
33
44Assemble
55
6−Produces an [atom]() from a list `b` of length-value pairs `p` and `q`,
6+Produces an atom from a list `b` of length-value pairs `p` and `q`,
77where `p` is the length in bloqs of size `a`, and `q` is an atomic
88value.
99
1010Accepts
1111-------
1212
13−`a` is a block size (see [`++bloq`]()).
13+`a` is a block size (see `++bloq`).
1414
15−`b` is a [`++list`]() of length value pairs, `p` and `q`.
15+`b` is a `++list` of length value pairs, `p` and `q`.
1616
1717Produces
1818--------
@@ -24,7 +24,7 @@ Source
2424
2525 ++ can :: assemble
2626 ~/ %can
27− |= [a=bloq b=(list ,[p=@ q=@])]
27+ |= [a/bloq b/(list [p=@ q=@])]
2828 ^- @
2929 ?~ b 0
3030 (mix (end a p.i.b q.i.b) (lsh a p.i.b $(b t.b)))
docs/system/hoon/library/src/2c/gate/cat.md+4−3
@@ -2,13 +2,13 @@
22
33Concatenate
44
5−Concatenates two [atom]()s, `b` and `c`, according to bloq size `a`, producing an
5+Concatenates two atoms, `b` and `c`, according to bloq size `a`, producing an
66atom.
77
88Accepts
99-------
1010
11−`a` is a block size (see [`++bloq`]()).
11+`a` is a block size (see `++bloq`).
1212
1313`b` is an atom.
1414
@@ -24,9 +24,10 @@ Source
2424
2525 ++ cat :: concatenate
2626 ~/ %cat
27− |= [a=bloq b=@ c=@]
27+ |= {a/bloq b/@ c/@}
2828 (add (lsh a (met a b) c) b)
2929
30+
3031Examples
3132--------
3233
docs/system/hoon/library/src/2c/gate/cut.md+3−3
@@ -7,9 +7,9 @@ Slices `c` blocks of size `a` that are `b` blocks from the end of `d`.
77Accepts
88-------
99
10−`a` is a block size (see [++bloq]()).
10+`a` is a block size (see ++bloq).
1111
12−`b` is an [atom]().
12+`b` is an atom.
1313
1414`c` is an atom.
1515
@@ -23,7 +23,7 @@ Source
2323
2424 ++ cut :: slice
2525 ~/ %cut
26− |= [a=bloq [b=@ c=@] d=@]
26+ |= {a/bloq {b/@u c/@u} d/@}
2727 (end a c (rsh a b d))
2828
2929Examples
docs/system/hoon/library/src/2c/gate/end.md+5−4
@@ -2,16 +2,16 @@
22
33Tail
44
5−Produces an [atom]() by taking the last `b` blocks of size `a` from `c`.
5+Produces an atom by taking the last `b` blocks of size `a` from `c`.
66
77Accepts
88-------
99
10−`a` is a block size (see [`++bloq`]()).
10+`a` is a block size (see `++bloq`).
1111
1212`b` is an atom.
1313
14−`c` is an [atom]().
14+`c` is an atom.
1515
1616Produces
1717--------
@@ -24,9 +24,10 @@ Source
2424
2525 ++ end :: tail
2626 ~/ %end
27− |= [a=bloq b=@ c=@]
27+ |= {a/bloq b/@u c/@}
2828 (mod c (bex (mul (bex a) b)))
2929
30+
3031Examples
3132--------
3233
docs/system/hoon/library/src/2c/gate/fil.md+5−4
@@ -2,16 +2,16 @@
22
33Fill bloqstream
44
5−Produces an [atom]() by repeating `c` for `b` blocks of size `a`.
5+Produces an atom by repeating `c` for `b` blocks of size `a`.
66
77Accepts
88-------
99
10−`a` is a block size (see [`++bloq`]()).
10+`a` is a block size (see `++bloq`).
1111
1212`b` is an atom.
1313
14−`c` is an [atom]().
14+`c` is an atom.
1515
1616Produces
1717--------
@@ -22,7 +22,7 @@ Source
2222------
2323
2424 ++ fil :: fill bloqstream
25− |= [a=bloq b=@ c=@]
25+ |= {a/bloq b/@u c/@}
2626 =+ n=0
2727 =+ d=c
2828 |- ^- @
@@ -30,6 +30,7 @@ Source
3030 (rsh a 1 d)
3131 $(d (add c (lsh a 1 d)), n +(n))
3232
33+
3334Examples
3435--------
3536
docs/system/hoon/library/src/2c/gate/lsh.md+4−3
@@ -2,12 +2,12 @@
22
33Left-shift
44
5−Produces an [atom]() by left-shifting `c` by `b` blocks of size `a`.
5+Produces an atom by left-shifting `c` by `b` blocks of size `a`.
66
77Accepts
88-------
99
10−`a` is a block size (see [`++bloq`]()).
10+`a` is a block size (see `++bloq`).
1111
1212`b` is an atom.
1313
@@ -23,9 +23,10 @@ Source
2323
2424 ++ lsh :: left-shift
2525 ~/ %lsh
26− |= [a=bloq b=@ c=@]
26+ |= {a/bloq b/@u c/@}
2727 (mul (bex (mul (bex a) b)) c)
2828
29+
2930Examples
3031--------
3132
docs/system/hoon/library/src/2c/gate/met.md+3−3
@@ -2,9 +2,9 @@
22
33Measure
44
5−Computes the number of blocks of size `a` in `b`, producing an [atom]().
5+Computes the number of blocks of size `a` in `b`, producing an atom.
66
7−`a` is a block size (see [`++bloq`]()).
7+`a` is a block size (see `++bloq`).
88
99`b` is an atom.
1010
@@ -13,7 +13,7 @@ Source
1313
1414 ++ met :: measure
1515 ~/ %met
16− |= [a=bloq b=@]
16+ |= {a/bloq b/@}
1717 ^- @
1818 =+ c=0
1919 |-
docs/system/hoon/library/src/2c/gate/rap.md+4−4
@@ -2,14 +2,14 @@
22
33Assemble non-zero
44
5−Concatenates a list of [atom]()s `b` using blocksize `a`, producing an atom.
5+Concatenates a list of atoms `b` using blocksize `a`, producing an atom.
66
77Accepts
88-------
99
10−`a` is a block size (see [`++bloq`]()).
10+`a` is a block size (see `++bloq`).
1111
12−`b` is a [`++list`]() of [atom]()s.
12+`b` is a `++list` of atoms.
1313
1414Produces
1515--------
@@ -21,7 +21,7 @@ Source
2121
2222 ++ rap :: assemble nonzero
2323 ~/ %rap
24− |= [a=bloq b=(list ,@)]
24+ |= {a/bloq b/(list @)}
2525 ^- @
2626 ?~ b 0
2727 (cat a i.b $(b t.b))
docs/system/hoon/library/src/2c/gate/rep.md+3−3
@@ -2,12 +2,12 @@
22
33Assemble single
44
5−Produces an [atom]() by assembling a list of atoms `b` using block size `a`.
5+Produces an atom by assembling a list of atoms `b` using block size `a`.
66
77Accepts
88-------
99
10−`a` is a block size (see [`++bloq`]()).
10+`a` is a block size (see `++bloq`).
1111
1212`b` is a list of atoms.
1313
@@ -21,7 +21,7 @@ Source
2121
2222 ++ rep :: assemble single
2323 ~/ %rep
24− |= [a=bloq b=(list ,@)]
24+ |= {a/bloq b/(list @)}
2525 ^- @
2626 =+ c=0
2727 |-
docs/system/hoon/library/src/2c/gate/rip.md+4−4
@@ -2,12 +2,12 @@
22
33Disassemble
44
5−Produces a list of [atom]()s from the bits of `b` using block size `a`.
5+Produces a list of atoms from the bits of `b` using block size `a`.
66
77Accepts
88-------
99
10−`a` is a block size (see [`++bloq`]()).
10+`a` is a block size (see `++bloq`).
1111
1212`b` is an atom.
1313
@@ -21,8 +21,8 @@ Source
2121
2222 ++ rip :: disassemble
2323 ~/ %rip
24− |= [a=bloq b=@]
25− ^- (list ,@)
24+ |= {a/bloq b/@}
25+ ^- (list @)
2626 ?: =(0 b) ~
2727 [(end a 1 b) $(b (rsh a 1 b))]
2828
docs/system/hoon/library/src/2c/gate/rsh.md+3−3
@@ -2,12 +2,12 @@
22
33Right-shift
44
5−Right-shifts `c` by `b` blocks of size `a`, producing an [atom]().
5+Right-shifts `c` by `b` blocks of size `a`, producing an atom.
66
77Accepts
88-------
99
10−`a` is a block size (see [`++bloq`]()).
10+`a` is a block size (see `++bloq`).
1111
1212`b` is an atom.
1313
@@ -23,7 +23,7 @@ Source
2323
2424 ++ rsh :: right-shift
2525 ~/ %rsh
26− |= [a=bloq b=@ c=@]
26+ |= {a/bloq b/@u c/@}
2727 (div c (bex (mul (bex a) b)))
2828
2929Examples
docs/system/hoon/library/src/2c/gate/swp.md+3−3
@@ -2,14 +2,14 @@
22
33Reverse block order
44
5−Switches little endian to big and vice versa: produces an [atom]() by
5+Switches little endian to big and vice versa: produces an atom by
66reversing the block order of `b` using block size `a`.
77
88
99Accepts
1010-------
1111
12−`a` is a block size (see [`++bloq`]()).
12+`a` is a block size (see `++bloq`).
1313
1414`b` is an atom.
1515
@@ -21,7 +21,7 @@ An atom
2121Source
2222------
2323
24− ++ swap |=([a=bloq b=@] (rep a (flop (rip a b)))) :: reverse bloq order
24+ ++ swap |=({a/bloq b/@} (rep a (flop (rip a b)))) :: reverse bloq order
2525
2626Examples
2727--------
docs/system/hoon/library/src/2c/gate/xeb.md+3−3
@@ -2,7 +2,7 @@
22
33Binary logarithm
44
5−Computes the base-2 logarithm of `a`, producing an [atom]().
5+Computes the base-2 logarithm of `a`, producing an atom.
66
77Accepts
88-------
@@ -18,8 +18,8 @@ Source
1818------
1919
2020 ++ xeb :: binary logarithm
21− :: ~/ %xeb
22− |= a=@
21+ ~/ %xeb
22+ |= a/@
2323 ^- @
2424 (met 0 a)
2525