on 657b415 help sign in
43 lines 669 B history raw
1### `++rap`
3Assemble non-zero
5Concatenates a list of atoms `b` using blocksize `a`, producing an atom.
7Accepts
8-------
10`a` is a block size (see `++bloq`).
12`b` is a `++list` of atoms.
14Produces
15--------
17An atom.
19Source
20------
22 ++ rap :: assemble nonzero
23 ~/ %rap
24 |= {a/bloq b/(list @)}
25 ^- @
26 ?~ b 0
27 (cat a i.b $(b t.b))
29Examples
30--------
32 ~zod/try=> `@ub`(rap 2 (limo [1 2 3 4 ~]))
33 0b100.0011.0010.0001
34 ~zod/try=> `@ub`(rap 1 (limo [1 2 3 4 ~]))
35 0b1.0011.1001
36 ~zod/try=> (rap 0 (limo [0 0 0 ~]))
37 0
38 ~zod/try=> (rap 0 (limo [1 0 1 ~]))
39 3
43***