hawk utils

a library of helper function for common hawk tasks.

the source code lives in /lib/hawk/hoon

not all functions are yet documented.

table of contents


relative

up

$-([from=path up=@ud down=path] path) construct a relative path. start at FROM, move UP, then move DOWN. this gate is most useful when FROM is filled with the 'here' face in a hawk-500 context. (the 'here' face contains the current location).

parent
(relative /some/path 1 /)
/some

stub

up

$-([=cord] (unit path)) unitized path parsing. mnuemonic: soft stab.

parsing: "/some/path"
(stub '/some/path')
[~ /some/path]
parsing: "/so me/p at h"
(stub '/so me/p at h')
~

mong

up

$-([index=@ from=(list)] (unit)) unitized list index lookup mnuemonic: mole'd snag


fong

up

$-([index=@ fallback=* from=(list)] <type of fallback>) list index with fallback mnuemonic: fallen mong. alias: nth-or type of list item and fallback must be the same.