forked from urbit/archaeology
-
Notifications
You must be signed in to change notification settings - Fork 0
Hoon is
Adam Bliss edited this page Oct 25, 2013
·
1 revision
++ is :: operate in time
|= [eny=@ vil=vile bud=vase fan=(list ,[p=@tas q=vase])]
|_ now=@da
++ beck
|= wru=(unit writ)
|+ hap=*
^- (unit)
=> .(hap ((hard path) hap))
?. ?=([@ @ @ *] hap) ~
=+ :* hyr=(slay i.hap)
fal=(slay i.t.hap)
dyc=(slay i.t.t.hap)
ved=(slay i.t.t.t.hap)
:: ved=(slay i.t.hap)
:: fal=(slay i.t.t.hap)
:: dyc=(slay i.t.t.t.hap)
tyl=t.t.t.t.hap
==
?. ?=([~ %$ %tas @] hyr) ~
?. ?=([~ %$ %p @] fal) ~
?. ?=([~ %$ %tas @] dyc) ~
?. ?=(^ ved) ~
=+ his=`@p`q.p.u.fal
=> .(wru ?^(wru wru [~ u=[p=[%lead his] q=his]])) :: XX dubious
=+ dis=(end 3 1 q.p.u.hyr)
=+ rem=(rsh 3 1 q.p.u.hyr)
|- ^- (unit)
?~ fan ~
?. =(dis p.i.fan) $(fan t.fan)
%- scry:(wink:(vent vil bud q.i.fan) now (shax now) ..^$)
[q.u.wru rem his q.p.u.dyc u.ved tyl]
::
++ dink :: vase by char
|= din=@tas ^- vase
?~(fan !! ?:(=(din p.i.fan) q.i.fan $(fan t.fan)))
::
++ dint :: input to vane
|= hap=path ^- @tas
?+ hap !!
[@ %ames *] %a
[@ %batz *] %b
[@ %clay *] %c
[@ %sync *] %c
[@ %term *] %d
[@ %http *] %e
==
::
++ doos :: sleep until
|= hap=path ^- (unit ,@da)
(doze:(wink:(vent vil bud (dink (dint hap))) now 0 (beck ~)) now [hap ~])
::
++ hurl :: start loop no id
|= ovo=ovum
^- [p=(list ovum) q=(list ,[p=@tas q=vase])]
(kick [[~ [[(dint p.ovo) ~] p.ovo ~] q.ovo] ~])
::
++ hymn :: start loop with id
|= [who=ship ovo=ovum]
^- [p=(list ovum) q=(list ,[p=@tas q=vase])]
(kick [[[~ %iron who] [[(dint p.ovo) ~] p.ovo ~] q.ovo] ~])
::
++ kick :: complete loop
|= mor=(list move)
=| ova=(list ovum)
|- ^- [p=(list ovum) q=(list ,[p=@tas q=vase])]
?~ mor
[(flop ova) fan]
:: ~& [%kick-move q.i.mor -.r.i.mor]
?> ?=(^ q.i.mor)
?~ t.q.i.mor
$(mor t.mor, ova [[i.q.i.mor r.i.mor] ova])
?> ?=(^ i.q.i.mor)
=- $(mor (weld p.nyx t.mor), fan q.nyx)
^= nyx
=+ naf=fan
|- ^- [p=(list move) q=_fan]
?~ naf [~ ~]
?. =(i.i.q.i.mor p.i.naf)
=+ tuh=$(naf t.naf)
[p.tuh [i.naf q.tuh]]
=+ ven=(vent vil bud q.i.naf)
=+ win=(wink:ven now (shax now) (beck p.i.mor))
=+ ^= yub
%- beat:win
[p.i.mor t.i.q.i.mor t.q.i.mor r.i.mor]
[p.yub [[p.i.naf ves:q.yub] t.naf]]
--
--
Parts of this document are generated automatically. Edits within the comments section will be preserved.