shrub/main/app/shell/core.hook

237 lines
6.8 KiB
Plaintext
Raw Normal View History

2014-09-26 04:10:17 +04:00
:: Shell
2014-09-12 06:11:03 +04:00
::
2014-09-26 04:10:17 +04:00
:::: /hook/core/shell/app
2014-09-12 06:11:03 +04:00
::
/? 314
/- term-line
2014-09-26 04:10:17 +04:00
/= seeb /~ !>(.)
2014-09-12 06:11:03 +04:00
::
:::: structures
::
|% ::
++ gift ::
2014-09-27 05:01:17 +04:00
$% [%rush p=%txt q=cord] ::
[%mean p=ares] ::
2014-09-12 06:11:03 +04:00
[%nice ~] ::
2014-10-01 01:53:37 +04:00
[%meta p=vase] ::
2014-09-12 06:11:03 +04:00
== ::
++ hapt ,[p=ship q=path] ::
++ move ,[p=bone q=(mold note gift)] ::
++ note ::
$% $: %g ::
2014-09-23 02:20:47 +04:00
$% [%cide p=span] ::
[%show p=hapt q=ship r=path] ::
[%sire p=term q=span] ::
2014-09-23 05:00:25 +04:00
[%mess p=hapt q=ship r=cage] ::
2014-09-25 04:37:29 +04:00
[%meta p=vase] ::
2014-09-12 06:11:03 +04:00
== == == ::
2014-09-23 05:00:25 +04:00
++ coma ::
2014-09-26 04:10:17 +04:00
$% [%start p=term q=(list twig)] ::
2014-09-23 05:00:25 +04:00
[%end p=cord] ::
[%path p=path] ::
2014-09-25 04:37:29 +04:00
[%hoon p=twig] ::
2014-10-01 01:53:37 +04:00
[%pipe p=term q=(list twig) r=term s=(list twig)] ::
2014-09-23 05:00:25 +04:00
== ::
2014-09-12 06:11:03 +04:00
++ sign ::
$% $: %g ::
2014-09-23 02:20:47 +04:00
$% [%gone p=hapt] ::
2014-09-12 06:11:03 +04:00
[%mean p=ares] ::
2014-09-23 02:20:47 +04:00
[%nice ~] ::
2014-09-26 04:54:51 +04:00
[%rush p=mark q=*] ::
[%rust p=mark q=*] ::
2014-09-12 06:11:03 +04:00
== == == ::
--
!:
:::: program
::
2014-10-01 01:53:37 +04:00
|_ $: hid=hide
pid=@u
pax=_`path`/=try=
act=(unit span)
pip=(map span span)
pop=(map span span)
==
2014-09-23 05:00:25 +04:00
++ maybe
|* fel=_rule
;~ pose
(stag ~ fel)
(easy ~)
==
::
++ args
2014-10-01 01:53:37 +04:00
(more ace wide:(vang | pax))
::
++ pipe
;~ plug
;~(pfix bar sym)
(ifix [sel ser] args)
;~(pfix bar ;~(plug sym args))
==
2014-09-23 05:00:25 +04:00
::
2014-09-23 02:20:47 +04:00
++ parse
2014-09-23 05:00:25 +04:00
^- $+(nail (like coma))
2014-09-25 04:37:29 +04:00
=+ paf=?.(=('0' &3.pax) pax pax(&3 (scot da/lat.hid)))
2014-09-23 02:20:47 +04:00
;~ pose
2014-09-25 04:37:29 +04:00
(stag %start ;~(pfix col ;~(plug sym args(pax paf))))
2014-09-23 05:00:25 +04:00
(stag %end ;~(pfix sem sym))
2014-09-23 02:20:47 +04:00
(stag %path (sear plex rood):(vang | pax))
2014-10-01 01:53:37 +04:00
(stag %pipe pipe(pax paf))
(stag %hoon tall:(vang | paf))
2014-09-23 02:20:47 +04:00
==
::
2014-09-27 05:01:17 +04:00
++ peer
|= [ost=bone you=ship pax=path]
^- [(list move) _+>]
?~ pax `+>.$
?+ i.pax `+>.$
%in
?~ t.pax `+>.$
?. (~(has by cub.hid) i.t.pax) `+>.$
2014-10-01 01:53:37 +04:00
?: (~(has by pop) i.t.pax) `+>.$
2014-09-27 05:01:17 +04:00
:_ +>.$(act `i.t.pax)
[(print ost you ~) ~]
==
::
2014-09-12 06:11:03 +04:00
++ poke-txt
|= [ost=bone you=ship txt=cord]
^- [(list move) _+>]
2014-09-27 05:01:17 +04:00
?: =('\\' (end 3 1 txt))
?+ (rsh 3 1 txt)
:_ +>.$
:~ (print ost you leaf/"no command" ~)
[ost %give %nice ~]
==
%c =. act ~
:_ +>.$
:~ (print ost you ~)
[ost %give %nice ~]
==
==
?^ act
:_ +>.$
:- [ost %give %nice ~]
(spam /in/[u.act] %rush %txt txt)
2014-09-25 04:37:29 +04:00
=+ com=(rush txt parse)
?~ com
2014-09-23 05:00:25 +04:00
:_ +>.$
:~ [ost %give %nice ~]
2014-09-25 04:37:29 +04:00
(print ost you leaf/"Clarify {(trip txt)}" ~)
2014-09-23 05:00:25 +04:00
==
2014-09-25 04:37:29 +04:00
?- -.u.com
2014-09-23 02:20:47 +04:00
%path
2014-09-25 04:37:29 +04:00
=. pax p.u.com
2014-09-23 05:00:25 +04:00
:_ +>.$
:~ [ost %give %nice ~]
2014-09-25 04:37:29 +04:00
(print ost you leaf/"=% {(spud p.u.com)}" ~)
2014-09-23 05:00:25 +04:00
==
2014-09-23 02:20:47 +04:00
::
%start
2014-09-26 04:10:17 +04:00
=+ cil=(scot %ud pid)
=. pid +(pid)
2014-09-23 02:20:47 +04:00
:_ +>.$
2014-09-25 04:37:29 +04:00
:~ :^ ost %pass /child/[cil]/main
:+ %g %meta !>
:* %mess [our.hid cil imp.hid] you
2014-09-26 04:10:17 +04:00
(cat 3 p.u.com '-args') (slap seeb [%clsg q.u.com])
2014-09-25 04:37:29 +04:00
==
2014-09-27 05:01:17 +04:00
[ost %pass /child/[cil]/out %g %show [our.hid cil imp.hid] you /out]
2014-09-26 04:10:17 +04:00
[ost %pass /child/[cil] %g %sire p.u.com cil] :: XX strange order?
2014-09-25 04:37:29 +04:00
(print ost you leaf/"running {(trip p.u.com)}" ~)
2014-09-23 02:20:47 +04:00
==
::
%end
:_ +>.$
2014-09-25 04:37:29 +04:00
=* cil p.u.com
2014-09-26 04:10:17 +04:00
:* (print ost you leaf/"killing {(trip cil)}" ~)
%+ murn (~(tap by cub.hid)) |= [a=span b=term]
?. =(b cil) ~
%- some
[ost %pass /child/[a] %g %cide a]
2014-09-23 02:20:47 +04:00
==
2014-10-01 01:53:37 +04:00
::
%pipe
=+ cia=(scot %ud pid)
=+ cib=(scot %ud +(pid))
=. pid +(+(pid))
=. pip (~(put by pip) cia cib)
=. pop (~(put by pop) cib cia)
:_ +>.$
:~ :^ ost %pass /child/[cia]/main
:+ %g %meta !>
:* %mess [our.hid cia imp.hid] you
(cat 3 p.u.com '-args') (slap seeb [%clsg q.u.com])
==
:^ ost %pass /child/[cib]/main
:+ %g %meta !>
:* %mess [our.hid cib imp.hid] you
(cat 3 r.u.com '-args') (slap seeb [%clsg s.u.com])
==
[ost %pass /child/[cia]/out %g %show [our.hid cia imp.hid] you /out]
[ost %pass /child/[cia] %g %sire p.u.com cia] :: XX strange order?
[ost %pass /child/[cib]/out %g %show [our.hid cib imp.hid] you /out]
[ost %pass /child/[cib] %g %sire r.u.com cib] :: XX strange order?
(print ost you leaf/"running {(trip p.u.com)} into {(trip r.u.com)}" ~)
==
2014-09-25 04:37:29 +04:00
::
%hoon
:_ +>.$
2014-09-26 04:10:17 +04:00
:~ (print ost you (sell (slap seeb p.u.com)) ~)
2014-09-25 04:37:29 +04:00
[ost %give %nice ~]
==
2014-09-12 06:11:03 +04:00
==
::
2014-09-26 04:54:51 +04:00
++ purr
|= [ost=bone pax=path typ=type sih=sign]
2014-09-12 06:11:03 +04:00
^- [(list move) _+>]
2014-09-25 04:37:29 +04:00
:: ~& [%shell-pour -.sih (,@ta +<.sih)]
2014-09-26 04:54:51 +04:00
::=+ sih=((hard sign) sih)
2014-09-23 03:06:55 +04:00
?~ pax ~& %no-path !!
2014-09-23 02:20:47 +04:00
?+ &1.pax ~& %strange-path !!
2014-09-23 03:06:55 +04:00
%print
2014-09-27 05:01:17 +04:00
`+>.$
2014-09-23 03:06:55 +04:00
::
2014-09-23 02:20:47 +04:00
%child
2014-09-23 03:06:55 +04:00
?~ |1.pax ~& %no-child !!
?~ |2.pax
2014-09-23 02:20:47 +04:00
?> ?=(%gone +<.sih)
2014-09-27 05:01:17 +04:00
:- [ost %give %nice ~]~
+>.$(act ?:(=(act [~ &2.pax]) ~ act))
:_ +>.$
2014-09-23 03:06:55 +04:00
?+ &3.pax ~& %strange-child-path !!
2014-09-23 05:00:25 +04:00
%main
?> ?=(?(%nice %mean) +<.sih)
[ost %give +.sih]~
2014-09-27 05:01:17 +04:00
%out
2014-09-23 03:06:55 +04:00
?. ?=(?(%rust %rush) +<.sih) ~
2014-10-01 01:53:37 +04:00
?: (~(has by pip) &2.pax)
(spam /in/(~(got by pip) &2.pax) %meta (slot 3 typ sih))
2014-09-26 04:54:51 +04:00
:_ ~
%^ print ost our.hid
2014-10-01 01:53:37 +04:00
?+ p.sih
2014-09-26 04:54:51 +04:00
[(sell (slot 15 [typ sih]))]~
%tang
;;((list tank) q.sih)
2014-09-23 02:20:47 +04:00
==
2014-09-26 04:54:51 +04:00
== ==
2014-09-23 02:20:47 +04:00
::
++ print
2014-09-25 04:37:29 +04:00
|= [ost=bone you=ship tan=(list tank)]
2014-09-27 05:01:17 +04:00
=+ ^= pro
?^ act
(rap 3 (~(got by cub.hid) u.act) '(' u.act ') ' ~)
?. =('0' &3.pax)
(spat pax)
(rap 3 '/' &1.pax '/' &2.pax '=' ?~(|3.pax ~ [(spat |3.pax)]~))
2014-09-23 03:06:55 +04:00
:* ost %pass /print %g %mess
2014-09-23 02:20:47 +04:00
[our.hid +.imp.hid] you
2014-09-27 05:01:17 +04:00
%term-line !>(`term-line`[pro tan])
2014-09-23 02:20:47 +04:00
==
2014-10-01 01:53:37 +04:00
::
2014-09-27 05:01:17 +04:00
++ spam
|= [pax=path gip=gift]
^- (list move)
%+ turn
(~(tap in (~(get ju pus.hid) pax)))
|=(a=bone [a %give gip])
2014-09-12 06:11:03 +04:00
--