more agent

This commit is contained in:
jackfoxy 2023-06-04 11:27:03 -07:00
parent 0319ab201b
commit 7030e15b6c
2 changed files with 60 additions and 3 deletions

View File

@ -16,7 +16,7 @@
|_ =bowl:gall
+* this .
default ~(. (default-agent this %|) bowl)
default ~(. (default-agent this %n) bowl)
++ on-init
^- (quip card _this)
~& > '%obelisk init'
@ -30,13 +30,36 @@
^- (quip card _this)
`this(state !<(state-0 old))
::++ on-poke |=(cage !!)
++ on-poke on-poke:default
++ on-poke ::on-poke:default
|= [=mark =vase]
^- (quip card _this)
?> ?=(%charlie-action mark)
=/ act !<(action vase)
?- -.act
%push
?: =(our.bowl target.act)
`this(values [value.act values])
?> =(our.bowl src.bowl)
:_ this
[%pass /pokes %agent [target.act %charlie] %poke mark vase]~
::
%pop
?: =(our.bowl target.act)
`this(values ?~(values ~ t.values))
?> =(our.bowl src.bowl)
:_ this
[%pass /pokes %agent [target.act %charlie] %poke mark vase]~
::++ on-watch |=(path !!)
++ on-watch on-watch:default
::++ on-leave |=(path `..on-init)
++ on-leave on-leave:default
::++ on-peek |=(path ~)
++ on-peek on-peek:default
++ on-peek :: on-peek:default
|= =path
^- (unit (unit cage))
?+ path (on-peek:default path)
[%x %values ~] ``noun+!>(values)
==
::++ on-agent |=([wire sign:agent:gall] !!)
++ on-agent on-agent:default
::++ on-arvo |=([wire sign-arvo] !!)

34
urql/mar/bill.hoon Normal file
View File

@ -0,0 +1,34 @@
|_ bil=(list dude:gall)
++ grow
|%
++ mime `^mime`[/text/x-bill (as-octs:mimes:html hoon)]
++ noun bil
++ hoon
^- @t
|^ (crip (of-wall:format (wrap-lines (spit-duz bil))))
::
++ wrap-lines
|= taz=wall
^- wall
?~ taz ["~"]~
:- (weld ":~ " i.taz)
%- snoc :_ "=="
(turn t.taz |=(t=tape (weld " " t)))
::
++ spit-duz
|= duz=(list dude:gall)
^- wall
(turn duz |=(=dude:gall ['%' (trip dude)]))
--
++ txt (to-wain:format hoon)
--
++ grab
|%
++ noun (list dude:gall)
++ mime
|= [=mite len=@ud tex=@]
~_ tex
!<((list dude:gall) (slap !>(~) (ream tex)))
--
++ grad %noun
--