file
is an (oxal page)
if
is an engine for common operations on file
oxal
is like axal
but with two differences.
it addresses by pith
(instead of path
)
it orders children intuitively by the pith
's iota
s (instead of by +mug
hash)
these differences are useful because you can rely on the order after tap
or dir
as a programmer without needing to do expensive sorts.
+if
is an engine for the common file
operations (like +of
for axal
)
+$ page :: typed data $+ page $~ [p=%n q=~] $% [p=%ub q=@ub] [p=%uc q=@uc] [p=%ud q=@ud] [p=%ui q=@ui] [p=%ux q=@ux] [p=%uv q=@uv] [p=%uw q=@uw] [p=%sb q=@sb] [p=%sc q=@sc] [p=%sd q=@sd] [p=%si q=@si] [p=%sx q=@sx] [p=%sv q=@sv] [p=%sw q=@sw] [p=%da q=@da] [p=%dr q=@dr] [p=%f q=?] [p=%n q=~] [p=%if q=@if] [p=%is q=@is] [p=%t q=@t] [p=%ta q=@ta] [p=%tas q=@tas] [p=%p q=@p] [p=%q q=@q] [p=%rs q=@rs] [p=%rd q=@rd] [p=%rh q=@rh] [p=%rq q=@rq] :: [p=%code q=@t] [p=%hoon q=hoon] [p=%mime q=mime] [p=%pith q=pith] [p=%iota q=iota] [p=%tang q=tang] == ++ oxal |$ [item] [fil=(unit item) dir=((mop iota $) comp-iotas)] ++ file (oxal page) ++ ion ((on iota file) comp-iotas) ++ comp-iotas |= [a=* b=*] ^- ? => .(a ?@(a [%tas a] a), b ?@(b [%tas b] b)) ?> ?=([@ @] a) ?> ?=([@ @] b) ?. =(-.a -.b) (aor -.a -.b) ?: ?=(?(%t %ta %tas %f) -.a) (aor +.a +.b) (lte +.a +.b)
this shape, file
, is a solid foundation for a recursive interface application system.
hawk intends to realize this recursive vision, integrated with an editor.
test data
this is the file
used in the rest of the examples.
x
is the face bound to an file engine (++if
) with a the test data mounted.
=/ f ~(. if test-data)
build
build the code in the file
and resolves any mirrors
poke
poke
a card to /foo/baz/bar
the hoon at /foo/bar/baz/~/poke
is compiled against /foo/bar/baz
and the card and evaluates against a new ixal to put at /foo/bar/baz
this recurses up the tree triggering:
/foo/~/poke
(which runs the code from /bar/~/poke
)
then /~/poke
(which crashes)