on 6d45ede help sign in
53 lines 980 B history raw
1---
2navhome: /docs
3---
6### `++deft`
8Import URL path
10Parse the extension the from last element of url, which is delimited
11either by a `.` or a `/`.
13Accepts
14-------
16`rax` is a [`++list`]() of [`@t`]().
18Produces
19--------
21A [`++pork`]().
23Source
24------
26 ++ deft :: import url path
27 |= rax=(list ,@t)
28 |- ^- pork
29 ?~ rax
30 [~ ~]
31 ?~ t.rax
32 =+ den=(trip i.rax)
33 =+ ^= vex
34 %- %- full
35 ;~(plug sym ;~(pose (stag ~ ;~(pfix dot sym)) (easy ~)))
36 [[1 1] (trip i.rax)]
37 ?~ q.vex
38 [~ [i.rax ~]]
39 [+.p.u.q.vex [-.p.u.q.vex ~]]
40 =+ pok=$(rax t.rax)
41 :- p.pok
42 [i.rax q.pok]
43 ::
45Examples
46--------
48 ~zod/try=> (deft /foo/bar/'baz.txt')
49 [p=[~ ~.txt] q=<|foo bar baz|>]
50 ~zod/try=> (deft /foo/bar/baz)
51 [p=~ q=<|foo bar baz|>]