on master help sign in
updated links, added example-prefix
commit79d793b45b3035c87de8a0a6bb1676007c696d56 authorHenry Ault <henry@tlon.io> dateThu 14 Apr 2016, 14:07 (11 years ago) parent932d391
7 files changed+124−109
docs/programming/system/basic.md+9−9 docs/programming/system/generators.md+22−20 docs/programming/system/http.md+37−26 docs/programming/system/network.md+19−18 docs/programming/system/state.md+11−9 docs/programming/system/subject.md+2−3 docs/programming/system/subscriptions.md+24−24
docs/programming/system/basic.md+9−9
@@ -47,7 +47,7 @@ Switch desks to run commands from the `%examples` desk:
4747
4848Run an example:
4949
50− ~fintud-macrep:dojo> +euler1
50+ ~fintud-macrep:dojo> +examples-euler1
5151 233.168
5252
5353## Euler 1
@@ -62,14 +62,14 @@ Find the sum of all the multiples of 3 or 5 below 1000.
6262```
6363
6464Here is the hoon solution (which should be in your pier directory
65−under `/examples/gen/euler1.hoon`):
65+under `/gen/examples/euler1`):
6666
6767```
6868:: project euler 1
6969:: https://projecteuler.net/problem=1
70−:: run in dojo with +euler1
70+:: run in dojo with +examples-euler1
7171::
72−:::: /hoon/euler1/gen
72+:::: /hoon/euler1/examples/gen
7373 ::
7474:- %say |= *
7575:- %noun
@@ -108,7 +108,7 @@ Hoon is not generally whitespace sensitive, but we do have two
108108different kinds of whitespace: a single space and a gap, which
109109is two or more spaces or a linebreak. Tabs are taboo. Do not
110110use them. Really. For a more detailed explanation of when to
111−use spaces vs. gaps, see the [syntax section](docs/programming/core/twig/syntax) before the first
111+use spaces vs. gaps, see the syntax section before the first
112112excercises.
113113</blockquote>
114114
@@ -127,7 +127,7 @@ more detail later.
127127
128128### How to form expressions
129129
130−Hoon does not use reserved words to form expressions. (We did recently implement an alternative keyword syntax, which is not covered here. For more information, see the [syntax section](docs/programming/core/twig/syntax)). Instead,
130+Hoon does not use reserved words to form expressions. (We did recently implement an alternative keyword syntax, which is not covered here. For more information, see the [syntax section](/docs/programming/core/twig/syntax/). Instead,
131131expressions are formed with runes--diagraphs of two
132132ascii symbols. Each rune takes a specific number of
133133children--either expressions formed by other runes or literals
@@ -195,7 +195,7 @@ Let's step into each of the three arms within our core.
195195`|=` produces a function, much like a lambda in lisp. It takes two children:
196196
197197- A set of argument(s). In this case our argument set only
198− contains one: `a` which is required to be an atom or natural
198+ contains one: `a`, which is required to be an atom or natural
199199 number, denoted by `@`.
200200
201201- The body of the function itself, which is executed when the
@@ -254,7 +254,7 @@ recur.
254254
255255Please tweak your code to complete the following excercises.
256256
257−There are a few runes and some syntax that we have yet to cover that
257+There are a few runes and some syntaxes that we have yet to cover that
258258you will need to complete the excercises below. For these, please
259259refer to our cheatsheat at the bottom.
260260
@@ -262,7 +262,7 @@ refer to our cheatsheat at the bottom.
262262
263263- Change `++sum` to accept two variables, `a` and `b`. Pass `a`
264264 to three and `b` to five. Then run the code with `a` set to
265− `1.000` and b set to `2.000`.
265+ `1.000` and ` q` set to `2.000`.
266266
267267- Check if this new result is under one thousand. If it is,
268268 return the string 'result is less than one thousand'. If not,
docs/programming/system/generators.md+22−20
@@ -4,6 +4,8 @@ sort: 8
44title: Using Generators with Apps
55---
66
7+# Generators
8+
79Up until now we've poked apps directly. This requires the user
810to specify the mark, and it requires the app to accept the
911arguments in a way that's convenient for users to input. This is
@@ -12,7 +14,7 @@ the "plumbing" way to interact with apps. Generators are the
1214`|merge`, there are no marks in sight.
1315
1416We've used generators before, back in [Basic
15−Operation](http://urbit.org/docs/user/basic). At that point, we just used the generators
17+Operation](/docs/user/basic). At that point, we just used the generators
1618to produce values -- we didn't pipe their results into apps. In
1719the dojo cast, the role of a generator is to take a list of
1820arguments and produce a value, which is often, though not always,
@@ -52,22 +54,22 @@ abbreviated to `:my-app|my-generator <args>`. Because most
5254built-in commands are generators for the `:hood` app,
5355`:hood|generator <args>` can be shortened to `|generator <args>`.
5456
55−Let's write a generator for a modified version of `:pong` from
56−the chapter on [Network Messages](http://urbit.org/docs/user/network). Recall that `:pong`
57+Let's write a generator for a modified version of `:examples-pong` from
58+the chapter on [Network Messages](/docs/programming/system/network). Recall that `:examples-pong`
5759takes an urbit address, which is of mark `urbit`, and sends that
5860urbit the message `'howdy'`. First--without a generator--let's
59−make `:ping` that does the same, except that it lets the user
61+make `:examples-ping` that does the same, except that it lets the user
6062optionally specify the message as well.
6163
6264We'll need a new mark for our arguments. Let's call it
63−`ping-message`.
65+`examples-ping-message`.
6466
6567<blockquote class="blockquote">
6668For app-specific marks, it's good style to prefix the name of
6769the mark with the name of the app. Since many apps have
6870several such marks, subdirectories in `/mar` are rendered as
6971`-`, so that `ping-message` is written in
70−(`/mar/ping/message.hoon`).
72+(/mar/examples/ping/message.hoon).
7173</blockquote>
7274
7375```
@@ -139,7 +141,7 @@ several such marks, subdirectories in `/mar` are rendered as
139141--
140142```
141143
142−The app can easily be modified to use this (`/app/ping.hoon`):
144+The app can easily be modified to use this (`/app/examples/ping.hoon`):
143145
144146```
145147::
@@ -178,27 +180,27 @@ The app can easily be modified to use this (`/app/ping.hoon`):
178180Now we can run this with:
179181
180182```
181−~fintud-macrep:dojo> |start %ping
183+~fintud-macrep:dojo> |start %examples-ping
182184>=
183−~fintud-macrep:dojo> :ping &ping-message [~sampel-sipnym 'heyya']
185+~fintud-macrep:dojo> :examples-ping &ping-message [~sampel-sipnym 'heyya']
184186>=
185187```
186188
187−And on `~sampel-sipnym`, assuming it's running `:ping` as well,
189+And on `~sampel-sipnym`, assuming it's running `:examples-ping` as well,
188190we see `[%receiving 'heyya']`.
189191
190192This is an annoying way to invoke the app, though. The `[]` are
191193mandatory, and optional arguments are hard. Let's make a
192−generator, `+send` to make everything nicer. Since it's specific
193−to `:ping`, let's put it in `/gen/ping/send.hoon`:
194+generator, `+examples-send` to make everything nicer. Since it's specific
195+to `:examples-ping`, let's put it in `/gen/examples/ping/send.hoon`:
194196
195197```
196198:- %say
197199|= {^ {{to/@p message/?($~ {text/@t $~})} $~}
198−[%ping-message to ?~(message 'howdy' text.message)]
200+[%examples-ping-message to ?~(message 'howdy' text.message)]
199201```
200202
201−A couple of new things here. Firstly, `message/?($~ {text=@t $~})`
203+A couple of new things here. Firstly, `message/?($~ {text/@t $~})`
202204should be read as "the message is either null or a pair of text
203205and null". Generator argument lists are always null-terminated,
204206which makes it convenient to accept lists in tail position (which
@@ -232,9 +234,9 @@ would complain that it doesn't know whether `message` has
232234This is run as follows:
233235
234236```
235−~fintud-macrep:dojo> :ping|send ~sampel-sipnym
237+~fintud-macrep:dojo> :examples-ping|send ~sampel-sipnym
236238>=
237−~fintud-macrep:dojo> :ping|send ~sampel-sipnym 'how do you do'
239+~fintud-macrep:dojo> :examples-ping|send ~sampel-sipnym 'how do you do'
238240>=
239241```
240242
@@ -243,8 +245,8 @@ Which causes `~sampel-sipnym` to print `[%receiving 'howdy']` and
243245
244246**Exercises**:
245247
246−- Create a generator for `:sum` from [State](state) so that
247− you can run `:sum|add 5` to add numbers to it.
248+- Create a generator for `:examples-sum` from [State](state) so that
249+ you can run `:examples-sum|add 5` to add numbers to it.
248250
249−- Create a generator for `:click` from [Web Apps](web-apps) so
250− that you can run `:click|poke` to poke it.
251+- Create a generator for `:examples-click` from [Web Apps](web-apps) so
252+ that you can run `:examplesclick|poke` to poke it.
docs/programming/system/http.md+37−26
@@ -14,48 +14,59 @@ service periodically and print out an error when the response
1414code isn't 2xx. Here's `app/up.hoon`:
1515
1616```
17+:: Up-ness monitor. Accepts atom url, 'on', or 'off'
18+::
19+:::: /hoon/up/examples/app
20+ ::
1721/? 314
1822|%
1923++ move {bone card}
2024++ card
21− $% {%them wire (unit hiss)}
22− {%wait wire @da}
25+ $% {$hiss wire $~ $httr {$purl p/purl}}
26+ {$wait wire @da}
27+ ==
28+++ action
29+ $% {$on $~} :: enable polling('on')
30+ {$off $~} :: disable polling('off)
31+ {$target p/cord} :: set poll target('http://...')
2332 ==
2433--
25−|_ {hid/bowl on/_| in-progress=_| target/@t}
26−++ poke-cord
27− |= url/@t
28− ^- {(list move) _+>.$}
29− ?: =('off' url)
30− [~ +>.$(on |)]
31− ?: =('on' url)
32− :_ +>.$(on &, in-progress &)
33− ?: |(on in-progress)
34− ~
35− [ost.hid %them /request ~ (need (epur target)) %get ~ ~]~
36− [~ +>.$(target url)]
37−++ thou-request
34+|_ {hid/bowl on/_| in-progress/_| target/@t}
35+++ poke-atom
36+ |= url-or-command/@t ^- (quip move +>)
37+ =+ ^- act/action
38+ ?: ?=($on url-or-command) [%on ~]
39+ ?: ?=($off url-or-command) [%off ~]
40+ [%target url-or-command]
41+ ?- -.act
42+ $target [~ +>.$(target p.act)]
43+ $off [~ +>.$(on |)]
44+ $on
45+ :- ?: |(on in-progress) ~
46+ [ost.hid %hiss /request ~ %httr %purl (need (epur target))]~
47+ +>.$(on &, in-progress &)
48+ ==
49+++ sigh-httr
3850 |= {wir/wire code/@ud headers/mess body/(unit octs)}
51+ ~& 'arrive here'
3952 ^- {(list move) _+>.$}
4053 ?: &((gte code 200) (lth code 300))
4154 ~& [%all-is-well code]
4255 :_ +>.$
43− ?: on
44− [ost.hid %wait /timer (add ~s10 now.hid)]~
45− ~
56+ [ost.hid %wait /timer (add ~s10 now.hid)]~
4657 ~& [%we-have-a-problem code]
4758 ~& [%headers headers]
4859 ~& [%body body]
4960 :_ +>.$
50− ?: on
51− [ost.hid %wait /timer (add ~s10 now.hid)]~
52− ~
61+ [ost.hid %wait /timer (add ~s10 now.hid)]~
5362++ wake-timer
54− |= {wir/wire ~}
63+ |= {wir/wire $~} ^- (quip move +>)
5564 ?: on
5665 :_ +>.$
57− [ost.hid %them /request ~ (need (epur target)) %get ~ ~]~
66+ [ost.hid %hiss /request ~ %httr %purl (need (epur target))]~
5867 [~ +>.$(in-progress |)]
68+::
69+++ prep ~& target _`. ::
5970--
6071```
6172
@@ -173,14 +184,14 @@ Let's try it out:
173184```
174185~fintud-macrep:dojo> |start %up
175186>=
176−~fintud-macrep:dojo> :up &cord 'http://www.google.com'
187+~fintud-macrep:dojo> :examples-up &cord 'http://www.google.com'
177188>=
178189[%all-is-well 200]
179190[%all-is-well 200]
180−~fintud-macrep:dojo> :up &cord 'http://example.com'
191+~fintud-macrep:dojo> :examples-up &cord 'http://example.com'
181192>=
182193[%all-is-well 200]
183−~fintud-macrep:dojo> :up &cord 'http://google.com'
194+~fintud-macrep:dojo> :examples-up &cord 'http://google.com'
184195>=
185196[%we-have-a-problem 301]
186197[ %headers
docs/programming/system/network.md+19−18
@@ -10,12 +10,12 @@ Now we've learned enough hoon to do more interesting things.
1010Let's get our planets to talk to each other.
1111
1212All we've written up until now are just shell
13−commands that produce a value and then disappear. To listen for and receive messages from other planets, we'll need an app--let's look at a very simple one:
13+commands that produce a value and then disappear. To listen for and receive messages from other planets, we'll need an app. Let's look at a very simple one:
1414
1515```
1616:: There is no love that is not an echo
1717::
18−:::: /hoon/echo/app
18+:::: /hoon/echo/examples/app
1919 ::
2020/? 314
2121!:
@@ -37,10 +37,10 @@ with the following commands:
3737```
3838~fintud-macrep:dojo> |start %echo
3939>=
40−~fintud-macrep:dojo> :echo 5
40+~fintud-macrep:dojo> :examples-echo 5
4141[%argument 5]
4242>=
43−~fintud-macrep:dojo> :echo [1 2]
43+~fintud-macrep:dojo> :examples-echo [1 2]
4444[%argument [1 2]]
4545>=
4646```
@@ -90,7 +90,7 @@ app state is stored. It'll become clear why this is later on,
9090but for now pretend that `+>.$` is a magic invocation that means
9191"app state".
9292
93−Let's look at another example. Say we want to only accept a
93+Let's look at another example (edit your code in `/app/examples/echo/hoon` to reflect the code below). Say we want to only accept a
9494number, and then print out the square of that number.
9595
9696```
@@ -108,7 +108,7 @@ number, and then print out the square of that number.
108108
109109A few things have changed. Firstly, we no longer accept
110110arbitrary nouns because we can only square atoms (integers, in
111−this case an unsigned one). Thus, our argument is now `arg=@`.
111+this case an unsigned one). Thus, our argument is now `arg/@`.
112112Secondly, it's `++poke-atom` rather than `++poke-noun`.
113113
114114# Intro to marks
@@ -136,9 +136,9 @@ commands:
136136```
137137~fintud-macrep:dojo> |start %square
138138>=
139−~fintud-macrep:dojo> :square 6
139+~fintud-macrep:dojo> :examples-square 6
140140gall: %square: no poke arm for noun
141−~fintud-macrep:dojo> :square &atom 6
141+~fintud-macrep:dojo> :examples-square &atom 6
142142[%square 36]
143143>=
144144```
@@ -149,14 +149,14 @@ gall: %square: no poke arm for noun
149149Marks are powerful, and they're the backbone of urbit's data
150150pipeline, so we'll be getting quite used to them.
151151
152−**Exercises**:
152+**Exercise**:
153153
154154- Write an app that computes fizzbuzz on its input (as in the
155155 previous section).
156156
157157# Sending a message to another ship
158158
159−Let's write our first network message! Here's `/app/pong.hoon`:
159+Let's write our first network message! Here's `/app/examples/pong.hoon`:
160160
161161```
162162/? 314
@@ -184,15 +184,15 @@ Let's write our first network message! Here's `/app/pong.hoon`:
184184Run it with these commands:
185185
186186```
187−~fintud-macrep:dojo> |start %pong
187+~fintud-macrep:dojo> |start %examples-pong
188188>=
189−~fintud-macrep:dojo> :pong &urbit ~sampel-sipnym
189+~fintud-macrep:dojo> :pong &examples-urbit ~sampel-sipnym
190190>=
191191```
192192
193193Replace `~sampel-sipnym` with another urbit. The easiest thing to
194194do is to start a [moon](), a sub-identity of your urbit. Don't
195−forget to start the `%pong` app on that urbit too. You should
195+forget to start the `%examples-pong` app on that urbit too. You should
196196see, on the foreign urbit, this output:
197197
198198```
@@ -230,21 +230,22 @@ The general form of a move is
230230
231231-arvo part---->
232232`[bone term wire *]`
233− >-app/vane-specific part of move
233+
234+------------------------->app/vane-specific part of move
234235
235236Or, in pseudo-code:
236237
237238`["cause" sys-call/action tack-new-layer-on-cause action-specific
238239information]`
239240
240−Let's walk through each of these elements step by step
241+Let's walk through each of these elements step by step.
241242
242243#### Bones ("cause")
243244
244245If you look up `++bone` in `hoon.hoon`, you'll see that it's a
245246number (`@ud`), and that it's an opaque reference to a duct.
246−`++duct` in hoon.hoon is a list of `wire`s, where `wire` is an
247−alias for `path`. `++path` is a list of `span`s, which are ASCII
247+`++duct` in hoon.hoon is a list of `wire`s, where `++wire` is an
248+alias for `++path`. `++path` is a list of `++span`s, which are ASCII
248249text. Thus, a duct is a list of paths, and a bone is an opaque
249250reference to it (in the same way that a Unix file
250251descriptor is an opaque reference to a file structure). Thus, to
@@ -331,7 +332,7 @@ anything with this information right now, but we could.
331332- Extend either of the apps in the first two exercises to accept
332333 input over the network in the same way as `pong`.
333334
334−- Modify `pong` to print out a message when it receives acknowledgement.
335+- Modify `examples-pong` to print out a message when it receives acknowledgement.
335336
336337- Write two apps, `even` and `odd`. When you pass an atom to
337338 `even`, check whether it's even. If so, divide it by two and
docs/programming/system/state.md+11−9
@@ -4,11 +4,13 @@ sort: 4
44title: State
55---
66
7+# State
8+
79In the last section we built a few small apps that sent moves.
810These apps were entirely stateless, however. Most useful apps
911require some amount of state. Let's build a trivial stateful
1012app. It'll keep a running the sum of all the atoms we poke it with.
11−Here's `app/sum.hoon`:
13+Here's `app/examples/sum.hoon`:
1214
1315```
1416/? 314
@@ -24,16 +26,16 @@ Here's `app/sum.hoon`:
2426--
2527```
2628
27−We can start it with `|start %sum`, and then run it:
29+We can start it with `|start %examples-sum`, and then run it:
2830
2931```
30−~fintud-macrep:dojo> :sum &atom 5
32+~fintud-macrep:dojo> :examples-sum &atom 5
3133[%so-far 5]
3234>=
33−~fintud-macrep:dojo> :sum &atom 2
35+~fintud-macrep:dojo> :examples-sum &atom 2
3436[%so-far 7]
3537>=
36−~fintud-macrep:dojo> :sum &atom 15
38+~fintud-macrep:dojo> :examples-sum &atom 15
3739[%so-far 22]
3840>=
3941```
@@ -93,17 +95,17 @@ through the hassle of having to set up and write to a database.
9395
9496**Exercises**:
9597
96−- Modify `:sum` to reset the counter when you poke it with zero.
98+- Modify `:examples-sum` to reset the counter when you poke it with zero.
9799
98100- Write an app that prints out the previous value you poked it
99101 with. Sample output:
100102
101103```
102−~fintud-macrep:dojo> :last 7
104+~fintud-macrep:dojo> :examples-last 7
103105[%last 0]
104106>=
105−~fintud-macrep:dojo> :last [1 2 3]
107+~fintud-macrep:dojo> :examples-last [1 2 3]
106108[%last 7]
107109>=
108−~fintud-macrep:dojo> :last 'howdy'
110+~fintud-macrep:dojo> :examples-last 'howdy'
109111[%last [1 2 3]]
docs/programming/system/subject.md+2−3
@@ -22,8 +22,7 @@ noun (`*`). Its second child is the remainder of the program.
2222
2323Similarly, the rest of the program is a cell of the literal
2424`%noun`, which tells the shell that we're producing a value of
25−type `noun`, and the second child contains the code that we run
26−to actually produce our value of the type `noun`.
25+type `noun`, and the code that we run to actually produce our value of the type `noun`.
2726
2827`=<` is a rune that takes two children. The second child is the
2928context against which we run the first child. So in this case, we
@@ -102,4 +101,4 @@ Cheatsheet:
102101 ~]`
103102- `gte` tests whether `a` is greater than or equal to `b`.
104103- `mod` runs the modulo operation on two atoms.
105−- See the [basic math section]() for more info.
104+- See the basic math section in `/arvo/hoon.hoon` for more info.
docs/programming/system/subscriptions.md+24−24
@@ -10,8 +10,8 @@ more often we want to subscribe to updates from another app. You
1010could build a subscription model out of one-way pokes, but it's
1111such a common pattern that it's built into arvo.
1212
13−Let's take a look at two apps, `:source` and `:sink`. First,
14−`:source`:
13+Let's take a look at two apps, `:examples-source` and `:examples-sink`. First,
14+`:examples-source`:
1515
1616```
1717/? 314
@@ -34,7 +34,7 @@ Let's take a look at two apps, `:source` and `:sink`. First,
3434--
3535```
3636
37−And secondly, `:sink`:
37+And secondly, `:examples-sink`:
3838
3939```
4040/? 314
@@ -117,40 +117,40 @@ Cheat sheet:
117117Here's some sample output of the two working together:
118118
119119```
120−~fintud-macrep:dojo> |start %source
120+~fintud-macrep:dojo> |start %examples-source
121121>=
122−~fintud-macrep:dojo> |start %sink
122+~fintud-macrep:dojo> |start %examples-sink
123123>=
124−~fintud-macrep:dojo> :sink %on
124+~fintud-macrep:dojo> :examples-sink %on
125125[%subscribed-to pax=/the-path]
126126%successfully-subscribed]
127127>=
128−~fintud-macrep:dojo> :source 5
128+~fintud-macrep:dojo> :examples-source 5
129129[%received-data 5]
130130>=
131−~fintud-macrep:dojo> :sink %off
131+~fintud-macrep:dojo> :examples-sink %off
132132>=
133−~fintud-macrep:dojo> :source 6
133+~fintud-macrep:dojo> :examples-source 6
134134>=
135−~fintud-macrep:dojo> :sink %on
135+~fintud-macrep:dojo> :examples-sink %on
136136[%subscribed-to pax=/the-path]
137137%successfully-subscribed]
138138>=
139−~fintud-macrep:dojo> :source 7
139+~fintud-macrep:dojo> :examples-source 7
140140[%received-data 7]
141141>=
142142```
143143
144−###:source
144+###:examples-source
145145
146146Hopefully you can get a sense for what's happening here. When we
147−poke `:sink` with `%on`, `:sink` subscribes to `:source`, and so
148−whenever we poke `:source`, `:sink` gets the update and prints it
149−out. Then we unsubscribe by poking `:sink` with `%off`, and
150−`:sink` stops getting updates. We then resubscribe.
147+poke `:examples-sink` with `%on`, `:examples-sink` subscribes to `:examples-source`, and so
148+whenever we poke `:examples-source`, `:examples-sink` gets the update and prints it
149+out. Then we unsubscribe by poking `:examples-sink` with `%off`, and
150+`:examples-sink` stops getting updates. We then resubscribe.
151151
152152There's a fair bit going on in this code. Let's look at
153−`:source` first.
153+`:examples-source` first.
154154
155155Our definition of `move` is fairly specific, since we're only
156156going to sending one kind of move. The `%diff` move is a
@@ -205,12 +205,12 @@ that provides bone `o` with this subscription update: `[%noun
205205arg]`". This is fairly dense code, but what it's doing is
206206straightforward.
207207
208−###:sink
208+###:examples-sink
209209
210−`:source` should now make sense. `:sink` is a little longer,
210+`:examples-source` should now make sense. `:examples-sink` is a little longer,
211211but not much more complicated.
212212
213−In `:sink`, our definition of of `++move` is different. All
213+In `:examples-sink`, our definition of of `++move` is different. All
214214moves start with a `bone`, and we conventionally refer to the
215215second half as the "card", so that we can say a move is an action
216216that sends a card along a bone.
@@ -225,13 +225,13 @@ this, because its semantics are to cancel any subscriptions
225225coming over this duct. If your bone and wire are the same as
226226when you subscribed, then the cancellation will happen correctly.
227227
228−The only state we need for `:sink` is a boolean to indicate whether
229−we're already subscribed to `:source`. We use `available/?`,
228+The only state we need for `:examples-sink` is a boolean to indicate whether
229+we're already subscribed to `:examples-source`. We use `available/?`,
230230where `?` is the sign of type boolean (similar to `*`, `@`) (which defaults to true).
231231
232232In `++poke-noun` we check our input to see both if it's `%on` and
233233we're available. If so, we produce the move to subscribe to
234−`:source`:
234+`:examples-source`:
235235
236236```
237237[ost %peer /subscribe [our %source] /the-path]
@@ -241,7 +241,7 @@ Also, we set available to false (`|`) with `+>.$(available |)`.
241241
242242Otherwise, if our input is `%off` and we're already subscribed
243243(i.e. `available` is false), then we unsubscribe from
244−`:source`:
244+`:examples-source`:
245245
246246```
247247[ost %pull /subscribe [our %source] ~]