urbit/main/app/shell/core.hook
2014-09-22 23:06:55 +00:00

102 lines
3.0 KiB
Plaintext

:: Terminal
::
:::: /hook/core/terminal/app
::
/? 314
/- term-line
::
:::: structures
::
|% ::
++ gift ::
$% [%mean p=ares] ::
[%nice ~] ::
== ::
++ hapt ,[p=ship q=path] ::
++ move ,[p=bone q=(mold note gift)] ::
++ note ::
$% $: %g ::
$% [%cide p=span] ::
[%show p=hapt q=ship r=path] ::
[%sire p=term q=span] ::
[%mess p=hapt q=ship r=[%term-line vase]] ::
== == == ::
++ sign ::
$% $: %g ::
$% [%gone p=hapt] ::
[%mean p=ares] ::
[%nice ~] ::
[%rush p=%txt q=cord] ::
[%rust p=%txt q=cord] ::
== == == ::
--
!:
:::: program
::
|_ [hid=hide pax=_`path`%]
++ parse
;~ pose
(stag %start ;~(pfix col (plus ;~(pose low nud hep))))
(stag %end ;~(pfix sem (plus ;~(pose low nud hep))))
(stag %path (sear plex rood):(vang | pax))
==
::
++ poke-txt
|= [ost=bone you=ship txt=cord]
^- [(list move) _+>]
=+ paf=(rush txt parse)
?~ paf
:_ +>.$ :_ ~
(print ost you "Yup, {(trip txt)}")
?- -.u.paf
%path
:_ +>.$(pax +.u.paf) :_ ~
(print ost you "=% {(spud +.u.paf)}")
::
%start
:_ +>.$
=+ cil=(crip +.u.paf)
:~ [ost %pass /child/[cil]/lines %g %show [our.hid cil imp.hid] you /lines]
[ost %pass /child/[cil] %g %sire cil cil] :: XX strange order?
(print ost you "running {+.u.paf}")
==
::
%end
:_ +>.$
=+ cil=(crip +.u.paf)
:~ (print ost you "killing {+.u.paf}")
[ost %pass /child/[cil] %g %cide cil]
==
==
::
++ pour
|= [ost=bone pax=path sih=*]
^- [(list move) _+>]
=+ sih=((hard sign) sih)
:_ +>.$
?~ pax ~& %no-path !!
?+ &1.pax ~& %strange-path !!
%print
?> ?=(?(%nice %mean) +<.sih)
[ost %give +.sih]~
::
%child
?~ |1.pax ~& %no-child !!
?~ |2.pax
?> ?=(%gone +<.sih)
~
?+ &3.pax ~& %strange-child-path !!
%lines
?. ?=(?(%rust %rush) +<.sih) ~
:_ ~ (print ost our.hid :(welp (trip &2.pax) ": " (trip q.sih)))
==
==
::
++ print
|= [ost=bone you=ship lin=tape]
:* ost %pass /print %g %mess
[our.hid +.imp.hid] you
%term-line !>(`term-line`[(spat pax) leaf/lin ~])
==
--