on bfaa358 help sign in
46 lines 947 B history raw
2### `++tome`
4Parse path to beam
6Parses a [`++path`]() `pax` to a [`++beam](), a well-typed location.
8Accepts
9-------
11`pax` is a [`++path`]().
13Produces
14--------
16A `(unit beam)`.
18Source
19------
21 ++ tome :: parse path to beam
22 |= pax=path
23 ^- (unit beam)
24 ?. ?=([* * * *] pax) ~
25 %+ biff (slaw %p i.pax)
26 |= who=ship
27 %+ biff (slaw %tas i.t.pax)
28 |= dex=desk
29 %+ biff (slay i.t.t.pax)
30 |= cis=coin
31 ?. ?=([%$ case] cis) ~
32 `(unit beam)`[~ [who dex `case`p.cis] (flop t.t.t.pax)]
33 ::
35Examples
36--------
38 ~zod/try=/zop> (tome /~fyr/try/2/for/me)
39 [~ [[p=~fyr q=%try r=[%ud p=2]] s=/me/for]]
40 ~zod/try=/zop> (tome /~zod/main/1)
41 [~ [[p=~zod q=%main r=[%ud p=1]] s=/]]
42 ~zod/try=/zop> (tome /0/main/1)
43 ~
44 ~zod/try=/zop> (tome /~zod/main/0x12)
45 ~