@@ -17,18 +17,18 @@ Let's take a look at two apps, `:source` and `:sink`. First,
20−++ move ,[bone %diff mark *]
20+++ move {bone $diff mark *}
22−|_ [hid=bowl state=~]
22+|_ {hid/bowl state/$~}
23++ poke-noun
23++ poke-noun
25− ^- [(list move) _+>.$]
25+ ^- {(list move) _+>.$}
27 %+ turn (prey /the-path hid)
27 %+ turn (prey /the-path hid)
28− |=([o=bone *] [o %diff %noun arg])
28+ |=({o/bone *} `move`[o %diff %noun arg])
30− |= pax=path
30+ |= pax/path
31− ^- [(list move) _+>.$]
31+ ^- {(list move) _+>.$}
32 ~& [%subscribed-to pax=pax]
32 ~& [%subscribed-to pax=pax]
@@ -39,17 +39,17 @@ And secondly, `:sink`:
42−++ move ,[bone card]
42+++ move {bone card}
44− $% [%peer wire [@p term] path]
44+ $% {$peer wire {@p term} path}
45− [%pull wire [@p term] ~]
45+ {$pull wire {@p term} $~}
49−|_ [bowl available=?]
49+|_ {bowl available/?}
50++ poke-noun
50++ poke-noun
52− ^- [(list move) _+>.$]
52+ ^- {(list move) _+>.$}
53 ?: &(=(%on arg) available)
53 ?: &(=(%on arg) available)
54 [[[ost %peer /subscribe [our %source] /the-path] ~] +>.$(available |)]
54 [[[ost %peer /subscribe [our %source] /the-path] ~] +>.$(available |)]
55 ?: &(=(%off arg) !available)
55 ?: &(=(%off arg) !available)
@@ -57,13 +57,13 @@ And secondly, `:sink`:
57 ~& ?:(available %not-subscribed %subscribed)
57 ~& ?:(available %not-subscribed %subscribed)
59++ diff-noun
59++ diff-noun
60− |= [wir=wire arg=*]
60+ |= {wir/wire arg/*}
61− ^- [(list move) _+>.$]
61+ ^- {(list move) _+>.$}
62 ~& [%recieved-data arg]
62 ~& [%recieved-data arg]
65− |= [wir=wire error=(unit tang)]
65+ |= {wir/wire error/(unit tang)}
66− ^- [(list move) _+>.$]
66+ ^- {(list move) _+>.$}
68 ~& %successfully-subscribed
68 ~& %successfully-subscribed
@@ -151,7 +151,7 @@ whenever we poke `:source`, `:sink` gets the update and prints it
151out. Then we unsubscribe by poking `:sink` with `%off`, and
151out. Then we unsubscribe by poking `:sink` with `%off`, and
152`:sink` stops getting updates. We then resubscribe.
152`:sink` stops getting updates. We then resubscribe.
154−There's a fair bit going on in this code, Let's look at
154+There's a fair bit going on in this code. Let's look at
155`:source` first.
155`:source` first.
157Our definition of `move` is fairly specific, since we're only
157Our definition of `move` is fairly specific, since we're only
@@ -176,12 +176,12 @@ In our case, we don't care what path you subscribed on, and all
176we do is print out that you subscribed. Arvo keeps track of your
176we do is print out that you subscribed. Arvo keeps track of your
177subscriptions, so you don't have to. You can access your
177subscriptions, so you don't have to. You can access your
178subscribers by looking at `sup` in the bowl that's passed in.
178subscribers by looking at `sup` in the bowl that's passed in.
179−`sup` is of type `(map bone ,[@p path])`, which associates bones
179+`sup` is of type `(map bone {@p path})`, which associates bones
180with the urbit who subscribed, and which path they subscribed on.
180with the urbit who subscribed, and which path they subscribed on.
181−If you want to talk to your subscribers, send them messages along
181+If you want to communicate with your subscribers, send them messages along
182their bone.
182their bone.
184−`++poke-noun` spams the given arguement to all our subscribers.
184+`++poke-noun` "spams" the given arguement to all our subscribers.
185There's a few things we haven't seen before. Firstly, `:_(a b)`
185There's a few things we haven't seen before. Firstly, `:_(a b)`
186is the same as `[b a]`. It's just a convenient way of formatting
186is the same as `[b a]`. It's just a convenient way of formatting
187things when the first thing in a cell is much more complicated
187things when the first thing in a cell is much more complicated
@@ -199,11 +199,11 @@ who are subscribed on a path that begins with the given path.
199"Prey" is short for "prefix".
199"Prey" is short for "prefix".
201Now we have the list of relevant subscribers. This a list of
201Now we have the list of relevant subscribers. This a list of
202−triples, `[bone @p path]`, where the only thing we really need is
202+triples, `{bone @p path}`, where the only thing we really need is
203the bone because we don't care what urbit they are or what exact
203the bone because we don't care what urbit they are or what exact
204path they subscribed on. Thus, our transformer function takes
204path they subscribed on. Thus, our transformer function takes
205−`[o=bone *]` and produces `[o %diff %noun arg]`, which is a move
205+`{o=bone *}` and produces `[o %diff %noun arg]`, which is a move
206−that means "tell bone `o` this subscription update: `[%noun
206+that provides bone `o` with this subscription update: `[%noun
207arg]`". This is fairly dense code, but what it's doing is
207arg]`". This is fairly dense code, but what it's doing is
208straightforward.
208straightforward.
@@ -227,8 +227,8 @@ this, because its semantics are to cancel any subscriptions
227coming over this duct. If your bone and wire are the same as
227coming over this duct. If your bone and wire are the same as
228when you subscribed, then the cancellation will happen correctly.
228when you subscribed, then the cancellation will happen correctly.
230−The only state we need for `:sink` is a loobean to tell whether
230+The only state we need for `:sink` is a boolean to indicate whether
231−we're already subscribed to `:source`. We use `available=?`,
231+we're already subscribed to `:source`. We use `available/?`,
232where `?` is the sign of type boolean (similar to `*`, `@`) (which defaults to true).
232where `?` is the sign of type boolean (similar to `*`, `@`) (which defaults to true).
234In `++poke-noun` we check our input to see both if it's `%on` and
234In `++poke-noun` we check our input to see both if it's `%on` and
@@ -273,7 +273,7 @@ Moving forward, `++reap` is given the wire we attempted to
273subscribe over, possibly along with an error message in cases of
273subscribe over, possibly along with an error message in cases of
274failure. `(unit type)` means "either `~` or `[~ type]`, which
274failure. `(unit type)` means "either `~` or `[~ type]`, which
275means it's used like Haskell's "maybe" or C's nullability. If
275means it's used like Haskell's "maybe" or C's nullability. If
276−`error` is `~`, then the subscription was successful, so we tell
276+`error` is `~`, then the subscription was successful and we tell
277that to the user. Otherwise, we print out the error message.
277that to the user. Otherwise, we print out the error message.
279Excercises XX
279Excercises XX