on 492ae2f help sign in
29 lines 570 B history raw
1### `++hit`
3Hex digits
5Parse a single hexadecimal digit.
7Source
8------
10 ++ hit ;~ pose :: hex digits
11 dit
12 (cook |=(a=char (sub a 87)) (shim 'a' 'f'))
13 (cook |=(a=char (sub a 55)) (shim 'A' 'F'))
14 ==
16Examples
17--------
19 ~zod/try=> (scan "a" hit)
20 10
21 ~zod/try=> (scan "A" hit)
22 10
23 ~zod/try=> (hit [[1 1] "a"])
24 [p=[p=1 q=2] q=[~ [p=10 q=[p=[p=1 q=2] q=""]]]]
25 ~zod/try=> (scan "2A" (star hit))
26 ~[2 10]
29***