on master help sign in
2c
35c05e6Henry Ault
docs/system/hoon/library/src/2c/gate/bex.md+2−2
@@ -2,7 +2,7 @@
2
2
3Binary exponent
3Binary exponent
4
4
5−Computes the result of `2^a`, producing an [atom]().
5+Computes the result of `2^a`, producing an atom.
6
6
7Accepts
7Accepts
8-------
8-------
@@ -19,7 +19,7 @@ Source
19
19
20 ++ bex :: binary exponent
20 ++ bex :: binary exponent
21 ~/ %bex
21 ~/ %bex
22− |= a=@
22+ |= a/@
23 ^- @
23 ^- @
24 ?: =(0 a) 1
24 ?: =(0 a) 1
25 (mul 2 $(a (dec a)))
25 (mul 2 $(a (dec a)))
docs/system/hoon/library/src/2c/gate/can.md+4−4
@@ -3,16 +3,16 @@
3
3
4Assemble
4Assemble
5
5
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`,
7where `p` is the length in bloqs of size `a`, and `q` is an atomic
7where `p` is the length in bloqs of size `a`, and `q` is an atomic
8value.
8value.
9
9
10Accepts
10Accepts
11-------
11-------
12
12
13−`a` is a block size (see [`++bloq`]()).
13+`a` is a block size (see `++bloq`).
14
14
15−`b` is a [`++list`]() of length value pairs, `p` and `q`.
15+`b` is a `++list` of length value pairs, `p` and `q`.
16
16
17Produces
17Produces
18--------
18--------
@@ -24,7 +24,7 @@ Source
24
24
25 ++ can :: assemble
25 ++ can :: assemble
26 ~/ %can
26 ~/ %can
27− |= [a=bloq b=(list ,[p=@ q=@])]
27+ |= [a/bloq b/(list [p=@ q=@])]
28 ^- @
28 ^- @
29 ?~ b 0
29 ?~ b 0
30 (mix (end a p.i.b q.i.b) (lsh a p.i.b $(b t.b)))
30 (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 @@
2
2
3Concatenate
3Concatenate
4
4
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
6atom.
6atom.
7
7
8Accepts
8Accepts
9-------
9-------
10
10
11−`a` is a block size (see [`++bloq`]()).
11+`a` is a block size (see `++bloq`).
12
12
13`b` is an atom.
13`b` is an atom.
14
14
@@ -24,9 +24,10 @@ Source
24
24
25 ++ cat :: concatenate
25 ++ cat :: concatenate
26 ~/ %cat
26 ~/ %cat
27− |= [a=bloq b=@ c=@]
27+ |= {a/bloq b/@ c/@}
28 (add (lsh a (met a b) c) b)
28 (add (lsh a (met a b) c) b)
29
29
30+
30Examples
31Examples
31--------
32--------
32
33
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`.
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is a block size (see [++bloq]()).
10+`a` is a block size (see ++bloq).
11
11
12−`b` is an [atom]().
12+`b` is an atom.
13
13
14`c` is an atom.
14`c` is an atom.
15
15
@@ -23,7 +23,7 @@ Source
23
23
24 ++ cut :: slice
24 ++ cut :: slice
25 ~/ %cut
25 ~/ %cut
26− |= [a=bloq [b=@ c=@] d=@]
26+ |= {a/bloq {b/@u c/@u} d/@}
27 (end a c (rsh a b d))
27 (end a c (rsh a b d))
28
28
29Examples
29Examples
docs/system/hoon/library/src/2c/gate/end.md+5−4
@@ -2,16 +2,16 @@
2
2
3Tail
3Tail
4
4
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`.
6
6
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is a block size (see [`++bloq`]()).
10+`a` is a block size (see `++bloq`).
11
11
12`b` is an atom.
12`b` is an atom.
13
13
14−`c` is an [atom]().
14+`c` is an atom.
15
15
16Produces
16Produces
17--------
17--------
@@ -24,9 +24,10 @@ Source
24
24
25 ++ end :: tail
25 ++ end :: tail
26 ~/ %end
26 ~/ %end
27− |= [a=bloq b=@ c=@]
27+ |= {a/bloq b/@u c/@}
28 (mod c (bex (mul (bex a) b)))
28 (mod c (bex (mul (bex a) b)))
29
29
30+
30Examples
31Examples
31--------
32--------
32
33
docs/system/hoon/library/src/2c/gate/fil.md+5−4
@@ -2,16 +2,16 @@
2
2
3Fill bloqstream
3Fill bloqstream
4
4
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`.
6
6
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is a block size (see [`++bloq`]()).
10+`a` is a block size (see `++bloq`).
11
11
12`b` is an atom.
12`b` is an atom.
13
13
14−`c` is an [atom]().
14+`c` is an atom.
15
15
16Produces
16Produces
17--------
17--------
@@ -22,7 +22,7 @@ Source
22------
22------
23
23
24 ++ fil :: fill bloqstream
24 ++ fil :: fill bloqstream
25− |= [a=bloq b=@ c=@]
25+ |= {a/bloq b/@u c/@}
26 =+ n=0
26 =+ n=0
27 =+ d=c
27 =+ d=c
28 |- ^- @
28 |- ^- @
@@ -30,6 +30,7 @@ Source
30 (rsh a 1 d)
30 (rsh a 1 d)
31 $(d (add c (lsh a 1 d)), n +(n))
31 $(d (add c (lsh a 1 d)), n +(n))
32
32
33+
33Examples
34Examples
34--------
35--------
35
36
docs/system/hoon/library/src/2c/gate/lsh.md+4−3
@@ -2,12 +2,12 @@
2
2
3Left-shift
3Left-shift
4
4
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`.
6
6
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is a block size (see [`++bloq`]()).
10+`a` is a block size (see `++bloq`).
11
11
12`b` is an atom.
12`b` is an atom.
13
13
@@ -23,9 +23,10 @@ Source
23
23
24 ++ lsh :: left-shift
24 ++ lsh :: left-shift
25 ~/ %lsh
25 ~/ %lsh
26− |= [a=bloq b=@ c=@]
26+ |= {a/bloq b/@u c/@}
27 (mul (bex (mul (bex a) b)) c)
27 (mul (bex (mul (bex a) b)) c)
28
28
29+
29Examples
30Examples
30--------
31--------
31
32
docs/system/hoon/library/src/2c/gate/met.md+3−3
@@ -2,9 +2,9 @@
2
2
3Measure
3Measure
4
4
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.
6
6
7−`a` is a block size (see [`++bloq`]()).
7+`a` is a block size (see `++bloq`).
8
8
9`b` is an atom.
9`b` is an atom.
10
10
@@ -13,7 +13,7 @@ Source
13
13
14 ++ met :: measure
14 ++ met :: measure
15 ~/ %met
15 ~/ %met
16− |= [a=bloq b=@]
16+ |= {a/bloq b/@}
17 ^- @
17 ^- @
18 =+ c=0
18 =+ c=0
19 |-
19 |-
docs/system/hoon/library/src/2c/gate/rap.md+4−4
@@ -2,14 +2,14 @@
2
2
3Assemble non-zero
3Assemble non-zero
4
4
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.
6
6
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is a block size (see [`++bloq`]()).
10+`a` is a block size (see `++bloq`).
11
11
12−`b` is a [`++list`]() of [atom]()s.
12+`b` is a `++list` of atoms.
13
13
14Produces
14Produces
15--------
15--------
@@ -21,7 +21,7 @@ Source
21
21
22 ++ rap :: assemble nonzero
22 ++ rap :: assemble nonzero
23 ~/ %rap
23 ~/ %rap
24− |= [a=bloq b=(list ,@)]
24+ |= {a/bloq b/(list @)}
25 ^- @
25 ^- @
26 ?~ b 0
26 ?~ b 0
27 (cat a i.b $(b t.b))
27 (cat a i.b $(b t.b))
docs/system/hoon/library/src/2c/gate/rep.md+3−3
@@ -2,12 +2,12 @@
2
2
3Assemble single
3Assemble single
4
4
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`.
6
6
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is a block size (see [`++bloq`]()).
10+`a` is a block size (see `++bloq`).
11
11
12`b` is a list of atoms.
12`b` is a list of atoms.
13
13
@@ -21,7 +21,7 @@ Source
21
21
22 ++ rep :: assemble single
22 ++ rep :: assemble single
23 ~/ %rep
23 ~/ %rep
24− |= [a=bloq b=(list ,@)]
24+ |= {a/bloq b/(list @)}
25 ^- @
25 ^- @
26 =+ c=0
26 =+ c=0
27 |-
27 |-
docs/system/hoon/library/src/2c/gate/rip.md+4−4
@@ -2,12 +2,12 @@
2
2
3Disassemble
3Disassemble
4
4
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`.
6
6
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is a block size (see [`++bloq`]()).
10+`a` is a block size (see `++bloq`).
11
11
12`b` is an atom.
12`b` is an atom.
13
13
@@ -21,8 +21,8 @@ Source
21
21
22 ++ rip :: disassemble
22 ++ rip :: disassemble
23 ~/ %rip
23 ~/ %rip
24− |= [a=bloq b=@]
24+ |= {a/bloq b/@}
25− ^- (list ,@)
25+ ^- (list @)
26 ?: =(0 b) ~
26 ?: =(0 b) ~
27 [(end a 1 b) $(b (rsh a 1 b))]
27 [(end a 1 b) $(b (rsh a 1 b))]
28
28
docs/system/hoon/library/src/2c/gate/rsh.md+3−3
@@ -2,12 +2,12 @@
2
2
3Right-shift
3Right-shift
4
4
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.
6
6
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is a block size (see [`++bloq`]()).
10+`a` is a block size (see `++bloq`).
11
11
12`b` is an atom.
12`b` is an atom.
13
13
@@ -23,7 +23,7 @@ Source
23
23
24 ++ rsh :: right-shift
24 ++ rsh :: right-shift
25 ~/ %rsh
25 ~/ %rsh
26− |= [a=bloq b=@ c=@]
26+ |= {a/bloq b/@u c/@}
27 (div c (bex (mul (bex a) b)))
27 (div c (bex (mul (bex a) b)))
28
28
29Examples
29Examples
docs/system/hoon/library/src/2c/gate/swp.md+3−3
@@ -2,14 +2,14 @@
2
2
3Reverse block order
3Reverse block order
4
4
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
6reversing the block order of `b` using block size `a`.
6reversing the block order of `b` using block size `a`.
7
7
8
8
9Accepts
9Accepts
10-------
10-------
11
11
12−`a` is a block size (see [`++bloq`]()).
12+`a` is a block size (see `++bloq`).
13
13
14`b` is an atom.
14`b` is an atom.
15
15
@@ -21,7 +21,7 @@ An atom
21Source
21Source
22------
22------
23
23
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
25
25
26Examples
26Examples
27--------
27--------
docs/system/hoon/library/src/2c/gate/xeb.md+3−3
@@ -2,7 +2,7 @@
2
2
3Binary logarithm
3Binary logarithm
4
4
5−Computes the base-2 logarithm of `a`, producing an [atom]().
5+Computes the base-2 logarithm of `a`, producing an atom.
6
6
7Accepts
7Accepts
8-------
8-------
@@ -18,8 +18,8 @@ Source
18------
18------
19
19
20 ++ xeb :: binary logarithm
20 ++ xeb :: binary logarithm
21− :: ~/ %xeb
21+ ~/ %xeb
22− |= a=@
22+ |= a/@
23 ^- @
23 ^- @
24 (met 0 a)
24 (met 0 a)
25
25