on 5e6a67f help sign in
44 lines 700 B history raw
1### `++mesc`
3Escape special chars
5Escape special characters, used in `++show`.
7Accepts
8-------
10`vib` is a `++tape`.
12Produces
13--------
15A `++tape`.
17Source
18------
20 ++ mesc :: ctrl code escape
21 |= vib/tape
22 ^- tape
23 ?~ vib
24 ~
25 ?: =('\\' i.vib)
26 ['\\' '\\' $(vib t.vib)]
27 ?: ?|((gth i.vib 126) (lth i.vib 32) =(`@`39 i.vib))
28 ['\\' (welp ~(rux at i.vib) '/' $(vib t.vib))]
29 [i.vib $(vib t.vib)]
30 ::
32Examples
33--------
35 /~zod/try=> (mesc "ham lus")
36 "ham lus"
37 /~zod/try=> (mesc "bas\\hur")
38 "bas\\\\hur"
39 /~zod/try=> (mesc "as'saß")
40 "as\0x27/sa\0xc3/\0x9f/"
44***