on 492ae2f help sign in
50 lines 905 B history raw
1### `++slaw`
3Parse span to input odor
5Parses a span `txt` to an atom of the odor specified by `mod`.
7Accepts
8-------
10Produces
11--------
13`mod` is a term, an atom of odor `@tas`.
15`txt` is a span, an atom of odor `@ta`.
17Source
18------
20 ++ slaw
21 ~/ %slaw
22 |= {mod/@tas txt/@ta}
23 ^- (unit @)
24 =+ con=(slay txt)
25 ?.(&(?=({$~ $$ @ @} con) =(p.p.u.con mod)) ~ [~ q.p.u.con])
28Examples
29--------
31 ~zod/try=> `(unit @p)`(slaw %p '~pillyt')
32 [~ ~pillyt]
33 ~zod/try=> `(unit @p)`(slaw %p '~pillam')
34 ~
35 ~zod/try=> `(unit @ux)`(slaw %ux '0x12')
36 [~ 0x12]
37 ~zod/try=> `(unit @ux)`(slaw %ux '0b10')
38 ~
39 ~zod/try=> `(unit @if)`(slaw %if '.127.0.0.1')
40 [~ .127.0.0.1]
41 ~zod/try=> `(unit @if)`(slaw %if '.fe80.0.0.202')
42 ~
43 ~zod/try=> `(unit @ta)`(slaw %ta '~.asd_a')
44 [~ ~.asd_a]
45 ~zod/try=> `(unit @ta)`(slaw %ta '~~asd-a')
46 ~
50***