summaryrefslogtreecommitdiff
path: root/desk/sur/tlon/cite.hoon
blob: 1d92a4697914cf2d6552a1fd2ad6f372fffe452b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/-  g=tlon-groups
=<  cite
|%
++  purse
  |=  =(pole knot)
  ^-  (unit cite)
  ?.  =(~.1 -.pole)  ~
  =.  pole  +.pole
  ?+    pole  ~
      [%chan agent=@ ship=@ name=@ rest=*]
    =/  ship  (slaw %p ship.pole)
    ?~  ship  ~
    `[%chan [agent.pole u.ship name.pole] rest.pole]
  ::
      [%desk ship=@ name=@ rest=*]
    =/  ship  (slaw %p ship.pole)
    ?~  ship  ~
    `[%desk [u.ship name.pole] rest.pole]
  ::
      [%group ship=@ name=@ ~]
    =/  ship  (slaw %p ship.pole)
    ?~  ship  ~
    `[%group u.ship name.pole]
  ==
::
++  parse 
  |=  =path
  ^-  cite
  (need (purse path))
::
++  print
  |=  c=cite
  |^  ^-  path
  :-  (scot %ud 1)
  ?-  -.c
    %chan   chan/(welp (nest nest.c) wer.c)
    %desk   desk/(welp (flag flag.c) wer.c)
    %group  group/(flag flag.c)
    %bait   bait/:(welp (flag grp.c) (flag gra.c) wer.c)
  ==
  ++  flag
    |=  f=flag:g
    ~[(scot %p p.f) q.f]
  ++  nest 
    |=  n=nest:g
    [p.n (flag q.n)]
  --
::
+$  cite
  $%  [%chan =nest:g wer=path]
      [%group =flag:g]
      [%desk =flag:g wer=path]
      [%bait grp=flag:g gra=flag:g wer=path]
      :: scry into groups when you receive a bait for a chat that doesn't exist yet
      :: work out what app
  ==
--