JSON parsing and Gall agent communication

%. is %- in reverse. gives the sample, and then the gate. like =<

app, sur, mar

“grab from a json”

grab arm takes and turns into something else. take from incoming json, turn into a noun.

cmd is validation function that takes a noun and turns it into command (or crashes).

Using Pick as a reference.

++  grab
  |%
  ++  json
    |=  jon=^json  :: ^ to get the _next_ thing named json. not the one above
    %-  cmd  :: call/apply the 'cmd' mold to whatever is below.
             :: need to turn something into a command.
    %.  jon
    %-  of   :: will return a function. takes a piece of json. wants key/value pair
    :~  [%delete ~]  :: this is a list. pick a head from this list that we understand. keys are commands, tails will "functions" 

These are all dejs things

of gets one head/key. object. { foo: "hello" } ot expects an array, many heads/keys ["hello" 123] se string as aura. "foo" as set, many keys { a: 'a', b: 'b' }

Hoon inline cell creation Building a single file

frond:enjs:format - makes json from key/value pair

when that works. then build json to have at each action in app/pick.hoon

(pairs:enjs:format some-list-here) -> will go from hoon/lists to json

everything goes out as text. they are sent as cards.

wind note gift - a card is this. cards are emitted by gall agents

when there are state changes, effects may be pushed out. this is all agent-perspective first. agents don’t care who is listening or if they even exist. it’s not request-initiated, it’s self-initiated.

  • how pick-cmd poke named?
  • This is because of filepath: mar/pick/cmd.hoon -> pick-cmd poke

:_(1 2) :: [2 1] constructs a cell, inverted.