2016-10-24 21:52:54 +03:00
|
|
|
:: Describe available comands: +help, +help %tree, +help %hood
|
2017-02-21 00:41:53 +03:00
|
|
|
::
|
2016-10-22 03:46:20 +03:00
|
|
|
:::: /hoon/help/gen
|
|
|
|
::
|
|
|
|
/? 310
|
2016-11-17 04:42:58 +03:00
|
|
|
::
|
2016-10-22 03:46:20 +03:00
|
|
|
::::
|
|
|
|
::
|
|
|
|
|%
|
|
|
|
++ path-heps
|
2020-11-25 23:22:55 +03:00
|
|
|
|= a=path ^- tape
|
2016-10-22 03:46:20 +03:00
|
|
|
?~ a ""
|
|
|
|
|- ^- tape
|
|
|
|
%+ welp (trip i.a)
|
|
|
|
?~ t.a ""
|
|
|
|
['-' $(a t.a)]
|
|
|
|
::
|
|
|
|
++ rend
|
2020-11-26 17:09:31 +03:00
|
|
|
|= [a=@thoon b=path] ^- tank
|
2020-11-25 23:22:55 +03:00
|
|
|
=; c=(pair tape tape)
|
2016-10-22 03:46:20 +03:00
|
|
|
=/ tab (sub 10 (mod (lent "{p.c} ") 10))
|
|
|
|
[%palm [" {(reap tab ' ')}" ``~] leaf+p.c leaf+q.c ~]
|
|
|
|
:- ?- b
|
2018-03-19 07:18:20 +03:00
|
|
|
~ "/" :: XX !! maybe?
|
2020-11-26 17:09:31 +03:00
|
|
|
[%hood ^] "|{(path-heps t.b)}"
|
2020-10-02 05:49:16 +03:00
|
|
|
^ "+{(path-heps b)}" :: XX deal with :graph-store|foo
|
2016-10-22 03:46:20 +03:00
|
|
|
==
|
2017-02-21 00:41:53 +03:00
|
|
|
=/ c (to-wain:format a)
|
2016-10-22 03:46:20 +03:00
|
|
|
?~ c "~"
|
2020-12-02 11:47:29 +03:00
|
|
|
?. =(':: ' (end [3 4] i.c))
|
2016-10-22 03:46:20 +03:00
|
|
|
"<undocumented>"
|
|
|
|
(trip i.c)
|
2016-10-22 03:59:51 +03:00
|
|
|
::
|
|
|
|
++ read-at
|
2020-11-26 17:09:31 +03:00
|
|
|
|= [len=@u pax=path]
|
|
|
|
|= [nam=@t ark=arch] ^- (unit [@t path])
|
2016-10-22 03:59:51 +03:00
|
|
|
?. (~(has by dir.ark) %hoon) ~
|
2017-02-21 00:41:53 +03:00
|
|
|
%+ bind (file:space:userlib (welp pax /[nam]/hoon))
|
2020-11-26 17:09:31 +03:00
|
|
|
|= a=* ^- [cord path]
|
2017-02-21 00:41:53 +03:00
|
|
|
[;;(@t a) (welp (slag len pax) /[nam])]
|
2016-10-22 03:46:20 +03:00
|
|
|
--
|
|
|
|
::
|
|
|
|
:- %say
|
2020-11-26 17:09:31 +03:00
|
|
|
|= [[now=time @ our=ship ^] typ=$@(~ [p=term ~]) ~]
|
2020-11-25 23:22:55 +03:00
|
|
|
=/ pax=path /(scot %p our)/home/(scot %da now)/gen :: XX hardcoded
|
2016-10-22 03:46:20 +03:00
|
|
|
=+ len=(lent pax)
|
2016-10-22 03:56:24 +03:00
|
|
|
=. pax ?~(typ pax (welp pax /[p.typ]))
|
2016-10-22 03:59:51 +03:00
|
|
|
:- %tang %- flop ^- tang
|
2016-10-22 03:46:20 +03:00
|
|
|
=+ ark=.^(arch cy+pax)
|
2016-10-22 03:59:51 +03:00
|
|
|
%+ welp
|
|
|
|
?~ typ ~
|
|
|
|
=/ red ((read-at len (scag len pax)) p.typ ark) :: XX ugly
|
|
|
|
(drop (bind red rend))
|
2016-10-22 03:46:20 +03:00
|
|
|
|- ^- tang
|
2017-02-13 23:43:18 +03:00
|
|
|
=+ =< arl=~(tap by (~(urn by dir.ark) .))
|
2020-11-26 17:09:31 +03:00
|
|
|
|=([a=@t ~] .^(arch cy+(welp pax /[a])))
|
2016-10-22 03:59:51 +03:00
|
|
|
%+ welp
|
2020-11-26 17:09:31 +03:00
|
|
|
=/ dir=(list [@ path])
|
2016-10-22 03:59:51 +03:00
|
|
|
(murn arl (read-at len pax))
|
|
|
|
`tang`(turn (sort dir aor) rend)
|
|
|
|
%- zing ^- (list tang)
|
|
|
|
%+ turn (sort arl aor)
|
2020-11-26 17:09:31 +03:00
|
|
|
|= [a=@t b=arch]
|
2016-10-22 03:59:51 +03:00
|
|
|
^$(pax (welp pax /[a]), ark b)
|