mirror of
https://github.com/ilyakooo0/urbit.git
synced 2025-01-04 05:05:35 +03:00
graph: improved type naming
This commit is contained in:
parent
39933ca848
commit
233b61199d
@ -28,6 +28,7 @@
|
|||||||
+* this .
|
+* this .
|
||||||
def ~(. (default-agent this %|) bowl)
|
def ~(. (default-agent this %|) bowl)
|
||||||
grp ~(. group bowl)
|
grp ~(. group bowl)
|
||||||
|
gra ~(. graph bowl)
|
||||||
::
|
::
|
||||||
++ on-init on-init:def
|
++ on-init on-init:def
|
||||||
++ on-save !>(~)
|
++ on-save !>(~)
|
||||||
@ -88,9 +89,10 @@
|
|||||||
?> (can-join:grp resource src.bowl)
|
?> (can-join:grp resource src.bowl)
|
||||||
?~ path
|
?~ path
|
||||||
:: new subscribe
|
:: new subscribe
|
||||||
=/ =graph:store (get-graph:graph resource)
|
=/ [=graph:store mark=(unit mark:store)]
|
||||||
|
(get-graph:gra resource)
|
||||||
!> ^- update:store
|
!> ^- update:store
|
||||||
[%0 now.bowl [%add-graph resource graph ~]]
|
[%0 now.bowl [%add-graph resource graph mark]]
|
||||||
:: resubscribe
|
:: resubscribe
|
||||||
::
|
::
|
||||||
:: TODO: use action-log
|
:: TODO: use action-log
|
||||||
|
@ -77,9 +77,6 @@
|
|||||||
%archive-graph (archive-graph +.q.update)
|
%archive-graph (archive-graph +.q.update)
|
||||||
%unarchive-graph (unarchive-graph +.q.update)
|
%unarchive-graph (unarchive-graph +.q.update)
|
||||||
%run-updates (run-updates +.q.update)
|
%run-updates (run-updates +.q.update)
|
||||||
::
|
|
||||||
:: NOTE: cannot send these updates as pokes
|
|
||||||
::
|
|
||||||
%keys ~|('cannot send %keys as poke' !!)
|
%keys ~|('cannot send %keys as poke' !!)
|
||||||
%tags ~|('cannot send %tags as poke' !!)
|
%tags ~|('cannot send %tags as poke' !!)
|
||||||
%tag-queries ~|('cannot send %tag-queries as poke' !!)
|
%tag-queries ~|('cannot send %tag-queries as poke' !!)
|
||||||
@ -95,7 +92,6 @@
|
|||||||
graphs (~(put by graphs) resource [graph mark])
|
graphs (~(put by graphs) resource [graph mark])
|
||||||
update-logs (~(put by update-logs) resource (gas:orm-log ~ ~))
|
update-logs (~(put by update-logs) resource (gas:orm-log ~ ~))
|
||||||
==
|
==
|
||||||
^- (list card)
|
|
||||||
%- zing
|
%- zing
|
||||||
:~ (give [/updates /keys ~] [%add-graph resource graph mark])
|
:~ (give [/updates /keys ~] [%add-graph resource graph mark])
|
||||||
?~ mark ~
|
?~ mark ~
|
||||||
@ -437,23 +433,26 @@
|
|||||||
[%x %graph @ @ ~]
|
[%x %graph @ @ ~]
|
||||||
=/ =ship (slav %p i.t.t.path)
|
=/ =ship (slav %p i.t.t.path)
|
||||||
=/ =term i.t.t.t.path
|
=/ =term i.t.t.t.path
|
||||||
=/ graph=(unit [graph:store *]) (~(get by graphs) [ship term])
|
=/ result=(unit marked-graph:store)
|
||||||
?~ graph ~
|
(~(get by graphs) [ship term])
|
||||||
``noun+!>(-.u.graph)
|
?~ result ~
|
||||||
|
``noun+!>(u.result)
|
||||||
::
|
::
|
||||||
[%x %graph-subset @ @ @ @ ~]
|
[%x %graph-subset @ @ @ @ ~]
|
||||||
=/ =ship (slav %p i.t.t.path)
|
=/ =ship (slav %p i.t.t.path)
|
||||||
=/ =term i.t.t.t.path
|
=/ =term i.t.t.t.path
|
||||||
=/ start=(unit atom:store) (rush i.t.t.t.t.path dem:ag)
|
=/ start=(unit atom:store) (rush i.t.t.t.t.path dem:ag)
|
||||||
=/ end=(unit atom:store) (rush i.t.t.t.t.t.path dem:ag)
|
=/ end=(unit atom:store) (rush i.t.t.t.t.t.path dem:ag)
|
||||||
=/ graph=(unit [graph:store *]) (~(get by graphs) [ship term])
|
=/ graph=(unit marked-graph:store)
|
||||||
|
(~(get by graphs) [ship term])
|
||||||
?~ graph ~
|
?~ graph ~
|
||||||
``noun+!>(`graph:store`(subset:orm -.u.graph start end))
|
``noun+!>(`graph:store`(subset:orm p.u.graph start end))
|
||||||
::
|
::
|
||||||
[%x %node @ @ @ *]
|
[%x %node @ @ @ *]
|
||||||
=/ =ship (slav %p i.t.t.path)
|
=/ =ship (slav %p i.t.t.path)
|
||||||
=/ =term i.t.t.t.path
|
=/ =term i.t.t.t.path
|
||||||
=/ =index:store (turn t.t.t.t.path |=(=cord (slav %ud cord)))
|
=/ =index:store
|
||||||
|
(turn t.t.t.t.path |=(=cord (slav %ud cord)))
|
||||||
=/ node=(unit node:store) (get-node ship term index)
|
=/ node=(unit node:store) (get-node ship term index)
|
||||||
?~ node ~
|
?~ node ~
|
||||||
``noun+!>(u.node)
|
``noun+!>(u.node)
|
||||||
@ -461,7 +460,8 @@
|
|||||||
[%x %post @ @ @ *]
|
[%x %post @ @ @ *]
|
||||||
=/ =ship (slav %p i.t.t.path)
|
=/ =ship (slav %p i.t.t.path)
|
||||||
=/ =term i.t.t.t.path
|
=/ =term i.t.t.t.path
|
||||||
=/ =index:store (turn t.t.t.t.path |=(=cord (slav %ud cord)))
|
=/ =index:store
|
||||||
|
(turn t.t.t.t.path |=(=cord (slav %ud cord)))
|
||||||
=/ node=(unit node:store) (get-node ship term index)
|
=/ node=(unit node:store) (get-node ship term index)
|
||||||
?~ node ~
|
?~ node ~
|
||||||
``noun+!>(post.u.node)
|
``noun+!>(post.u.node)
|
||||||
@ -469,7 +469,8 @@
|
|||||||
[%x %node-children @ @ @ *]
|
[%x %node-children @ @ @ *]
|
||||||
=/ =ship (slav %p i.t.t.path)
|
=/ =ship (slav %p i.t.t.path)
|
||||||
=/ =term i.t.t.t.path
|
=/ =term i.t.t.t.path
|
||||||
=/ =index:store (turn t.t.t.t.path |=(=cord (slav %ud cord)))
|
=/ =index:store
|
||||||
|
(turn t.t.t.t.path |=(=cord (slav %ud cord)))
|
||||||
=/ node=(unit node:store) (get-node ship term index)
|
=/ node=(unit node:store) (get-node ship term index)
|
||||||
?~ node ~
|
?~ node ~
|
||||||
?- -.children.u.node
|
?- -.children.u.node
|
||||||
@ -482,7 +483,8 @@
|
|||||||
=/ =term i.t.t.t.path
|
=/ =term i.t.t.t.path
|
||||||
=/ start=(unit atom:store) (rush i.t.t.t.t.path dem:ag)
|
=/ start=(unit atom:store) (rush i.t.t.t.t.path dem:ag)
|
||||||
=/ end=(unit atom:store) (rush i.t.t.t.t.t.path dem:ag)
|
=/ end=(unit atom:store) (rush i.t.t.t.t.t.path dem:ag)
|
||||||
=/ =index:store (turn t.t.t.t.t.t.path |=(=cord (slav %ud cord)))
|
=/ =index:store
|
||||||
|
(turn t.t.t.t.t.t.path |=(=cord (slav %ud cord)))
|
||||||
=/ node=(unit node:store) (get-node ship term index)
|
=/ node=(unit node:store) (get-node ship term index)
|
||||||
?~ node ~
|
?~ node ~
|
||||||
?- -.children.u.node
|
?- -.children.u.node
|
||||||
@ -511,10 +513,11 @@
|
|||||||
++ get-node
|
++ get-node
|
||||||
|= [=ship =term =index:store]
|
|= [=ship =term =index:store]
|
||||||
^- (unit node:store)
|
^- (unit node:store)
|
||||||
=/ parent-graph=(unit [graph:store *]) (~(get by graphs) [ship term])
|
=/ parent-graph=(unit marked-graph:store)
|
||||||
|
(~(get by graphs) [ship term])
|
||||||
?~ parent-graph ~
|
?~ parent-graph ~
|
||||||
=/ node=(unit node:store) ~
|
=/ node=(unit node:store) ~
|
||||||
=/ =graph:store -.u.parent-graph
|
=/ =graph:store p.u.parent-graph
|
||||||
|-
|
|-
|
||||||
?~ index
|
?~ index
|
||||||
node
|
node
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/+ view=graph-view
|
/+ view=graph-view
|
||||||
/+ store=graph-store
|
/+ store=graph-store
|
||||||
/+ sigs=signatures
|
/+ sigs=signatures
|
||||||
/+ grph=graph
|
/+ graph
|
||||||
/+ default-agent
|
/+ default-agent
|
||||||
/+ dbug
|
/+ dbug
|
||||||
~% %graph-view-top ..is ~
|
~% %graph-view-top ..is ~
|
||||||
@ -26,7 +26,7 @@
|
|||||||
|_ =bowl:gall
|
|_ =bowl:gall
|
||||||
+* this .
|
+* this .
|
||||||
def ~(. (default-agent this %|) bowl)
|
def ~(. (default-agent this %|) bowl)
|
||||||
gra ~(. grph bowl)
|
gra ~(. graph bowl)
|
||||||
::
|
::
|
||||||
++ on-init
|
++ on-init
|
||||||
^- (quip card _this)
|
^- (quip card _this)
|
||||||
|
@ -13,8 +13,9 @@
|
|||||||
::
|
::
|
||||||
++ get-graph
|
++ get-graph
|
||||||
|= res=resource
|
|= res=resource
|
||||||
^- graph:store
|
^- marked-graph:store
|
||||||
(scry-for graph:store /graph/(scot %p entity.res)/[name.res])
|
%+ scry-for marked-graph:store
|
||||||
|
/graph/(scot %p entity.res)/[name.res]
|
||||||
::
|
::
|
||||||
++ peek-log
|
++ peek-log
|
||||||
|= res=resource
|
|= res=resource
|
||||||
|
@ -10,9 +10,13 @@
|
|||||||
::
|
::
|
||||||
+$ mark term
|
+$ mark term
|
||||||
+$ graph ((mop atom node) gth)
|
+$ graph ((mop atom node) gth)
|
||||||
|
+$ marked-graph [p=graph q=(unit mark)]
|
||||||
|
::
|
||||||
+$ node [=post children=internal-graph]
|
+$ node [=post children=internal-graph]
|
||||||
+$ graphs (map resource [p=graph q=(unit mark)])
|
+$ graphs (map resource marked-graph)
|
||||||
|
::
|
||||||
+$ tag-queries (jug term resource)
|
+$ tag-queries (jug term resource)
|
||||||
|
::
|
||||||
+$ update-log ((mop time logged-update) gth)
|
+$ update-log ((mop time logged-update) gth)
|
||||||
+$ update-logs (map resource update-log)
|
+$ update-logs (map resource update-log)
|
||||||
::
|
::
|
||||||
|
Loading…
Reference in New Issue
Block a user