on 657b415 help sign in
62 lines 1.1 kB history raw
1### `++woad`
3Unescape cord
5Unescape `++cord` codepoints.
7Accepts
8-------
10`a` is a `@ta`.
12Produces
13--------
15A `++cord`.
17Source
18------
20 ++ woad :: cord format
21 |= a/@ta
22 ^- @t
23 %+ rap 3
24 |- ^- (list @)
25 ?: =(`@`0 a)
26 ~
27 =+ b=(end 3 1 a)
28 =+ c=(rsh 3 1 a)
29 ?: =('.' b)
30 [' ' $(a c)]
31 ?. =('~' b)
32 [b $(a c)]
33 => .(b (end 3 1 c), c (rsh 3 1 c))
34 ?+ b =- (weld (rip 3 (tuft p.d)) $(a q.d))
35 ^= d
36 =+ d=0
37 |- ^- {p/@ q/@}
38 ?: =('.' b)
39 [d c]
40 ?< =(0 c)
41 %= $
42 b (end 3 1 c)
43 c (rsh 3 1 c)
44 d %+ add (mul 16 d)
45 %+ sub b
46 ?: &((gte b '0') (lte b '9')) 48
47 ?>(&((gte b 'a') (lte b 'z')) 87)
48 ==
49 $'.' ['.' $(a c)]
50 $'~' ['~' $(a c)]
51 ==
52 ::
54Examples
55--------
57 /~zod/try=> (woad ~.~b6.20.as)
58 '¶20 as'
62***