on 492ae2f help sign in
48 lines 735 B history raw
1### `++fil`
3Fill bloqstream
5Produces an atom by repeating `c` for `b` blocks of size `a`.
7Accepts
8-------
10`a` is a block size (see `++bloq`).
12`b` is an atom.
14`c` is an atom.
16Produces
17--------
19An atom.
21Source
22------
24 ++ fil :: fill bloqstream
25 |= {a/bloq b/@u c/@}
26 =+ n=0
27 =+ d=c
28 |- ^- @
29 ?: =(n b)
30 (rsh a 1 d)
31 $(d (add c (lsh a 1 d)), n +(n))
34Examples
35--------
37 ~zod/try=> `@t`(fil 3 5 %a)
38 'aaaaa'
39 ~zod/try=> `@t`(fil 5 10 %ceeb)
40 'ceebceebceebceebceebceebceebceebceebceeb'
41 ~zod/try=> `@t`(fil 4 10 %eced)
42 'ʇʇʇʇʇʇʇʇʇʇed'
43 ~zod/try=> `@tas`(fil 4 10 %bf)
44 %bfbfbfbfbfbfbfbfbfbf
48***