on 492ae2f help sign in
47 lines 762 B history raw
1### `++wack`
3Coin format encode
5Escape `++span` `~` as `~~` and `_` as `~-`. Used for printing.
7Accepts
8-------
10`a` is a `++span` (`@ta`).
12Produces
13--------
15A `++span` (`@ta`).
17Source
18------
20 ++ wack :: coin format
21 |= a/@ta
22 ^- @ta
23 =+ b=(rip 3 a)
24 %+ rap 3
25 |- ^- tape
26 ?~ b
27 ~
28 ?: =('~' i.b) ['~' '~' $(b t.b)]
29 ?: =('_' i.b) ['~' '-' $(b t.b)]
30 [i.b $(b t.b)]
31 ::
33Examples
34--------
36 /~zod/try=> (wack '~20_sam~')
37 ~.~~20~-sam~~
38 /~zod/try=> `@t`(wack '~20_sam~')
39 '~~20~-sam~~'
40 ~zod/try=> ~(rend co %many ~[`ud/5 `ta/'~20_sam'])
41 "._5_~~.~~20~-sam__"
42 ~zod/try=> ._5_~~.~~20~-sam__
43 [5 ~.~20_sam]
47***