on 492ae2f help sign in
54 lines 1.4 kB history raw
1### `++tame`
3Parse kite path
5Parses a clay [.\^]()
6[`++path` ]()to request details. Produces the [`++unit`]() of a [`++kite`]().
8Accepts
9-------
11`hap` is a [`++path`]().
13Produces
14--------
16A `(unit kite)`.
18Source
19------
21 ++ tame :: parse kite path
22 |= hap=path
23 ^- (unit kite)
24 ?. ?=([@ @ @ @ *] hap) ~
25 =+ :* hyr=(slay i.hap)
26 fal=(slay i.t.hap)
27 dyc=(slay i.t.t.hap)
28 ved=(slay i.t.t.t.hap)
29 :: ved=(slay i.t.hap)
30 :: fal=(slay i.t.t.hap)
31 :: dyc=(slay i.t.t.t.hap))
32 tyl=t.t.t.t.hap
33 ==
34 ?. ?=([~ %$ %tas @] hyr) ~
35 ?. ?=([~ %$ %p @] fal) ~
36 ?. ?=([~ %$ %tas @] dyc) ~
37 ?. ?=([~ %$ case] ved) ~
38 =+ his=`@p`q.p.u.fal
39 =+ [dis=(end 3 1 q.p.u.hyr) rem=(rsh 3 1 q.p.u.hyr)]
40 ?. ?&(?=(%c dis) ?=(?(%v %w %x %y %z) rem)) ~
41 [~ rem p.u.ved q.p.u.fal q.p.u.dyc tyl]
42 ::
44Examples
45--------
47 ~zod/try=/zop> (tame /cx/~zod/main/1/sur/down/gate/hook)
48 [~ [p=%x q=[%ud p=1] r=~zod s=%main t=/sur/down/gate/hook]]
49 ~zod/try=/zop> (tame /cx/0/main/1/sur/down/gate/hook)
50 ~
51 ~zod/try=/zop> (tame /~zod/main/0x12/sur/down/gate/hook)
52 ~