2019-11-09 02:18:29 +03:00
|
|
|
:: Print what your agent is doing.
|
|
|
|
::
|
2019-11-19 07:36:21 +03:00
|
|
|
|= [loud=? =agent:gall]
|
2019-12-04 02:05:42 +03:00
|
|
|
=| bowl-print=_|
|
2019-11-19 07:36:21 +03:00
|
|
|
^- agent:gall
|
2019-12-04 02:05:42 +03:00
|
|
|
|^
|
2019-11-19 07:36:21 +03:00
|
|
|
|_ =bowl:gall
|
2019-11-09 02:18:29 +03:00
|
|
|
+* this .
|
|
|
|
ag ~(. agent bowl)
|
|
|
|
::
|
|
|
|
++ on-init
|
2019-11-19 07:36:21 +03:00
|
|
|
^- (quip card:agent:gall agent:gall)
|
2019-12-04 02:05:42 +03:00
|
|
|
%- (print bowl "{<dap.bowl>}: on-init")
|
2019-11-09 02:18:29 +03:00
|
|
|
=^ cards agent on-init:ag
|
|
|
|
[cards this]
|
|
|
|
::
|
|
|
|
++ on-save
|
|
|
|
^- vase
|
2019-12-04 02:05:42 +03:00
|
|
|
%- (print bowl "{<dap.bowl>}: on-save")
|
2019-11-09 02:18:29 +03:00
|
|
|
on-save:ag
|
|
|
|
::
|
|
|
|
++ on-load
|
|
|
|
|= old-state=vase
|
2019-11-19 07:36:21 +03:00
|
|
|
^- (quip card:agent:gall agent:gall)
|
2019-12-04 02:05:42 +03:00
|
|
|
%- (print bowl "{<dap.bowl>}: on-load")
|
2019-11-09 02:18:29 +03:00
|
|
|
=^ cards agent (on-load:ag old-state)
|
|
|
|
[cards this]
|
|
|
|
::
|
|
|
|
++ on-poke
|
|
|
|
|= [=mark =vase]
|
2019-11-19 07:36:21 +03:00
|
|
|
^- (quip card:agent:gall agent:gall)
|
2019-12-04 02:05:42 +03:00
|
|
|
%- (print bowl "{<dap.bowl>}: on-poke with mark {<mark>}")
|
2019-11-09 06:32:21 +03:00
|
|
|
?: ?=(%verb mark)
|
2019-12-04 02:05:42 +03:00
|
|
|
?- !<(?(%loud %bowl) vase)
|
|
|
|
%loud `this(loud !loud)
|
|
|
|
%bowl `this(bowl-print !bowl-print)
|
|
|
|
==
|
2019-11-09 02:18:29 +03:00
|
|
|
=^ cards agent (on-poke:ag mark vase)
|
|
|
|
[cards this]
|
|
|
|
::
|
|
|
|
++ on-watch
|
|
|
|
|= =path
|
2019-11-19 07:36:21 +03:00
|
|
|
^- (quip card:agent:gall agent:gall)
|
2019-12-04 02:05:42 +03:00
|
|
|
%- (print bowl "{<dap.bowl>}: on-watch on path {<path>}")
|
2019-11-09 02:18:29 +03:00
|
|
|
=^ cards agent (on-watch:ag path)
|
|
|
|
[cards this]
|
|
|
|
::
|
|
|
|
++ on-leave
|
|
|
|
|= =path
|
2019-11-19 07:36:21 +03:00
|
|
|
^- (quip card:agent:gall agent:gall)
|
2019-12-04 02:05:42 +03:00
|
|
|
%- (print bowl "{<dap.bowl>}: on-leave on path {<path>}")
|
2019-11-09 02:18:29 +03:00
|
|
|
=^ cards agent (on-leave:ag path)
|
|
|
|
[cards this]
|
|
|
|
::
|
|
|
|
++ on-peek
|
|
|
|
|= =path
|
|
|
|
^- (unit (unit cage))
|
2019-12-04 02:05:42 +03:00
|
|
|
%- (print bowl "{<dap.bowl>}: on-peek on path {<path>}")
|
2019-11-09 02:18:29 +03:00
|
|
|
(on-peek:ag path)
|
|
|
|
::
|
|
|
|
++ on-agent
|
2019-11-19 07:36:21 +03:00
|
|
|
|= [=wire =sign:agent:gall]
|
|
|
|
^- (quip card:agent:gall agent:gall)
|
2019-12-04 02:05:42 +03:00
|
|
|
%- (print bowl "{<dap.bowl>}: on-agent on wire {<wire>}, {<-.sign>}")
|
2019-11-09 06:32:21 +03:00
|
|
|
=^ cards agent (on-agent:ag wire sign)
|
2019-11-09 02:18:29 +03:00
|
|
|
[cards this]
|
|
|
|
::
|
|
|
|
++ on-arvo
|
|
|
|
|= [=wire =sign-arvo]
|
2019-11-19 07:36:21 +03:00
|
|
|
^- (quip card:agent:gall agent:gall)
|
2019-12-04 02:05:42 +03:00
|
|
|
%- (print bowl "{<dap.bowl>}: on-arvo on wire {<wire>}, {<[- +<]:sign-arvo>}")
|
2019-11-09 02:18:29 +03:00
|
|
|
=^ cards agent (on-arvo:ag wire sign-arvo)
|
|
|
|
[cards this]
|
|
|
|
::
|
|
|
|
++ on-fail
|
|
|
|
|= [=term =tang]
|
2019-11-19 07:36:21 +03:00
|
|
|
^- (quip card:agent:gall agent:gall)
|
2019-12-04 02:05:42 +03:00
|
|
|
%- (print bowl "{<dap.bowl>}: on-fail with term {<term>}")
|
2019-11-09 02:18:29 +03:00
|
|
|
=^ cards agent (on-fail:ag term tang)
|
|
|
|
[cards this]
|
|
|
|
--
|
2019-12-04 02:05:42 +03:00
|
|
|
::
|
|
|
|
++ print
|
|
|
|
|= [=bowl:gall =tape]
|
|
|
|
^+ same
|
|
|
|
=? . bowl-print
|
|
|
|
%- (slog >bowl< ~)
|
|
|
|
.
|
|
|
|
?. loud same
|
|
|
|
%- (slog leaf+tape ~)
|
|
|
|
same
|
|
|
|
--
|