mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-15 10:02:47 +03:00
Merge pull request #2450 from urbit/m/dbug-state-slapper
dbug: allow complex, hoon-based state queries
This commit is contained in:
commit
54d1e7eb63
@ -1,8 +1,12 @@
|
||||
:: +dbug: tell /lib/dbug app to print some generic state
|
||||
::
|
||||
:: :app +dbug
|
||||
:: the entire state
|
||||
:: :app +dbug %bowl
|
||||
:: the entire bowl
|
||||
:: :app +dbug [direction] [specifics]
|
||||
:: :app +dbug [%state 'thing']
|
||||
:: data at thing.state. allows for complex hoon, like '(lent thing)'
|
||||
:: :app +dbug [direction specifics]
|
||||
:: all in subs matching the parameters
|
||||
:: direction: %incoming or %outgoing
|
||||
:: specifics:
|
||||
@ -19,14 +23,14 @@
|
||||
*
|
||||
:: inline arguments
|
||||
::
|
||||
args=?(~ [what=?(%bowl %state) ~] [=what =about ~])
|
||||
args=?(~ [what=?(%bowl %state) ~] [=poke ~])
|
||||
:: named arguments
|
||||
::
|
||||
~
|
||||
==
|
||||
:- %dbug
|
||||
?- args
|
||||
~ [%state *about]
|
||||
[@ ~] [what.args *about]
|
||||
[@ * ~] [what about]:args
|
||||
~ [%state '']
|
||||
[@ ~] ?-(what.args %bowl [%bowl ~], %state [%state ''])
|
||||
[[@ *] ~] poke.args
|
||||
==
|
||||
|
@ -3,11 +3,11 @@
|
||||
:: usage: %-(agent:dbug your-agent)
|
||||
::
|
||||
|%
|
||||
+$ what
|
||||
$? %bowl
|
||||
%state
|
||||
%incoming
|
||||
%outgoing
|
||||
+$ poke
|
||||
$% [%bowl ~]
|
||||
[%state grab=cord]
|
||||
[%incoming =about]
|
||||
[%outgoing =about]
|
||||
==
|
||||
::
|
||||
+$ about
|
||||
@ -31,12 +31,17 @@
|
||||
=^ cards agent (on-poke:ag mark vase)
|
||||
[cards this]
|
||||
=/ dbug
|
||||
!<([=what =about] vase)
|
||||
!<(poke vase)
|
||||
=; out=^vase
|
||||
((slog (sell out) ~) [~ this])
|
||||
?- what.dbug
|
||||
?- -.dbug
|
||||
%bowl !>(bowl)
|
||||
%state on-save:ag
|
||||
::
|
||||
%state
|
||||
=? grab.dbug =('' grab.dbug) '-'
|
||||
%+ slap
|
||||
(slop on-save:ag !>([bowl=bowl ..zuse]))
|
||||
(ream grab.dbug)
|
||||
::
|
||||
%incoming
|
||||
!>
|
||||
|
Loading…
Reference in New Issue
Block a user