on 492ae2f help sign in
40 lines 520 B history raw
1### `++runt`
3Prepend `n` times
5Add `a` repetitions of character `b` to the head of `++tape` `c`.
7Accepts
8-------
10`a` and `b` are atoms.
12`c` is a `++tape`.
14Produces
15--------
17A `++tape`.
19Source
20------
22 ++ runt :: prepend repeatedly
23 |= [[a/@ b/@] c/tape]
24 ^- tape
25 ?: =(0 a)
26 c
27 [b $(a (dec a))]
28 ::
30Examples
31--------
33 /~zod/try=> (runt [2 '/'] "ham")
34 "//ham"
35 /~zod/try=> (runt [10 'a'] "")
36 "aaaaaaaaaa"
40***