2022-04-13 07:02:37 +03:00
|
|
|
:: Perform minimal norm change to delete a file, use =dry & for dry run
|
|
|
|
::
|
2022-04-09 07:20:02 +03:00
|
|
|
:: TODO: recognize when it's going to fail because it's in the head of
|
2022-04-13 07:02:37 +03:00
|
|
|
:: a desk, and maybe offer to |rm
|
2022-04-09 07:20:02 +03:00
|
|
|
::
|
2022-05-15 08:49:10 +03:00
|
|
|
=, clay
|
2022-04-09 07:20:02 +03:00
|
|
|
:- %say
|
|
|
|
|= [[now=@da eny=@uvJ bec=beak] [target=path ~] dry=_|]
|
|
|
|
:- %helm-pans
|
|
|
|
=+ .^(=arch %cy target)
|
|
|
|
?~ fil.arch
|
|
|
|
[%d %flog %text "tomb: not a file"]~ :: should recurse
|
2022-05-15 08:49:10 +03:00
|
|
|
=/ =lobe u.fil.arch
|
|
|
|
=+ .^(=rang %cx /(scot %p p.bec)//(scot %da now)/rang)
|
|
|
|
=+ .^(=cone %cx /(scot %p p.bec)//(scot %da now)/domes)
|
|
|
|
=/ domes=(list [[=ship =desk] =dome tom=(map tako norm) nor=norm])
|
|
|
|
~(tap by cone)
|
2022-04-09 07:20:02 +03:00
|
|
|
=/ norms
|
|
|
|
|^
|
2022-05-15 08:49:10 +03:00
|
|
|
|- ^- (set [ship desk tako norm path])
|
2022-04-09 07:20:02 +03:00
|
|
|
?~ domes
|
|
|
|
~
|
|
|
|
=/ n 1
|
2022-05-15 08:49:10 +03:00
|
|
|
=/ =aeon 1
|
2022-04-09 07:20:02 +03:00
|
|
|
%- ~(uni in $(domes t.domes))
|
2022-05-15 08:49:10 +03:00
|
|
|
|- ^- (set [ship desk tako norm path])
|
2022-04-09 07:20:02 +03:00
|
|
|
?: (lth let.dome.i.domes aeon)
|
|
|
|
~
|
2022-05-15 08:49:10 +03:00
|
|
|
=/ =tako (~(got by hit.dome.i.domes) aeon)
|
|
|
|
=/ paths (draw-tako ship.i.domes desk.i.domes +.i.domes tako)
|
2022-04-09 07:20:02 +03:00
|
|
|
(~(uni in paths) $(aeon +(aeon)))
|
|
|
|
::
|
|
|
|
++ draw-tako
|
2022-05-15 08:49:10 +03:00
|
|
|
|= [=ship =desk [dome tom=(map tako norm) nor=norm] =tako]
|
|
|
|
^- (set [^ship ^desk ^tako norm path])
|
2022-04-09 07:20:02 +03:00
|
|
|
~+
|
2022-05-15 08:49:10 +03:00
|
|
|
=/ =yaki (~(got by hut.rang) tako)
|
2022-04-09 07:20:02 +03:00
|
|
|
=/ takos
|
2022-05-15 08:49:10 +03:00
|
|
|
|- ^- (set [^ship ^desk ^tako norm path])
|
2022-04-09 07:20:02 +03:00
|
|
|
?~ p.yaki
|
|
|
|
~
|
|
|
|
(~(uni in $(p.yaki t.p.yaki)) ^$(tako i.p.yaki))
|
2022-05-15 08:49:10 +03:00
|
|
|
|- ^- (set [^ship ^desk ^tako norm path])
|
2022-04-09 07:20:02 +03:00
|
|
|
?~ q.yaki
|
|
|
|
takos
|
|
|
|
%- ~(uni in $(q.yaki l.q.yaki))
|
|
|
|
%- ~(uni in $(q.yaki r.q.yaki))
|
2022-05-15 08:49:10 +03:00
|
|
|
^- (set [^ship ^desk ^tako norm path])
|
2022-04-09 07:20:02 +03:00
|
|
|
?. =(lobe q.n.q.yaki)
|
|
|
|
~
|
2022-05-15 08:49:10 +03:00
|
|
|
[[ship desk tako (~(gut by tom) tako nor) p.n.q.yaki] ~ ~]
|
2022-04-09 07:20:02 +03:00
|
|
|
--
|
|
|
|
^- (list note-arvo)
|
|
|
|
%+ welp
|
2022-04-13 07:02:37 +03:00
|
|
|
%+ murn ~(tap in norms)
|
2022-05-15 08:49:10 +03:00
|
|
|
|= [=ship =desk =tako =norm =path]
|
2022-04-23 03:55:42 +03:00
|
|
|
?: ?=([~ %|] (~(fit of norm) path))
|
2022-04-13 07:02:37 +03:00
|
|
|
~
|
2022-04-09 07:20:02 +03:00
|
|
|
%- (slog leaf+"tomb: {<ship desk path `@uv`tako norm path>}" ~)
|
|
|
|
?: dry
|
2022-04-13 07:02:37 +03:00
|
|
|
~
|
2022-04-23 03:55:42 +03:00
|
|
|
`[%c %tomb %worn ship desk tako (~(put of norm) path %|)]
|
2022-04-09 07:20:02 +03:00
|
|
|
?: dry
|
2022-04-13 07:02:37 +03:00
|
|
|
~
|
2022-04-09 07:20:02 +03:00
|
|
|
[%c %tomb %pick ~]~
|