@@ -33,7 +33,7 @@ demonstrates important principles that more laconic code would not. Save it as
3333
3434```
3535!:
36−:- %say
36+|= [msg=tape key=@ud]
3737=+ ^= caesar
3838 |%
3939 ++ alpha "abcdefghijklmnopqrstuvwxyz"
@@ -76,8 +76,6 @@ demonstrates important principles that more laconic code would not. Save it as
7676 =+ s=(trim (mod n length) m)
7777 (weld q.s p.s)
7878 --
79−|= [* [msg=tape key=@ud ~] ~]
80−:- %noun
8179=. msg (cass msg)
8280:- (shift.caesar msg key)
8381(unshift.caesar msg key)
@@ -91,24 +89,23 @@ that has been shifted left. It also converts any uppercase input into lowercase.
9189Try it out in the Dojo:
9290
9391```
94−> +caesar "test" 2
92+> +caesar ["test" 2]
9593["vguv" "rcqr"]
9694
97−> +caesar "test" 26
95+> +caesar ["test" 26]
9896["test" "test"]
9997
100−> +caesar "test" 28
98+> +caesar ["test" 28]
10199["vguv" "rcqr"]
102100
103−> +caesar "test" 104
101+> +caesar ["test" 104]
104102["test" "test"]
105103
106−> +caesar "tESt" 2
104+> +caesar ["tESt" 2]
107105["vguv" "rcqr"]
108106
109−> +caesar "test!" 2
107+> +caesar ["test!" 2]
110108nest-fail
111−
112109```
113110
114111### Examining Our Code
@@ -120,7 +117,7 @@ itself before reading the explanation.
120117
121118```
122119!:
123−:- %say
120+|= [msg=tape key=@ud]
124121=+ ^= caesar
125122 |%
126123```
@@ -128,34 +125,23 @@ itself before reading the explanation.
128125The `!:` in the first line of the above code enables a full stack trace in the
129126event of an error.
130127
131−`:- %say` begins to construct a cell with `%say` as the head, and the code that
132−follows as the tail. This causes the Arvo to interpret the file as a
133−[`%say` generator](/docs/tutorials/generators).
128+`|= [msg=tape key=@ud]` creates a gate that takes a cell. The head of this cell
129+is a `tape`, which is a string type that's a list of `cord`s. Tapes are represented
130+as text surrounded by double-quotes, such as this: `"a tape"`. We give this input tape the face `msg`.
131+The tail of our cell is a `@ud` -- an unsigned decimal atom -- that we give the face `key`.
134132
135−`=+` adds a noun the subject, `=^ caesar` names that noun, and `|%` is used
133+`=+` adds a noun to the subject, `=^ caesar` names that noun, and `|%` is used
136134to create a core that contains the following arms. This results in having a core
137135with the face `caesar` that we can call.
138136
139137Now let's look at the rest of the program that is outside of our core:
140138
141139```
142−|= [* [msg=tape key=@ud ~] ~]
143−:- %noun
144140=. msg (cass msg)
145141:- (shift.caesar msg key)
146142(unshift.caesar msg key)
147143```
148144
149−The top line creates a gate with `|=`. The sample of that gate follows the
150−scheme used by `%say` generators: it's a 3-tuple whose parts allow for different
151−kinds of data. We only need non-optional arguments, though, so we only fill in
152−the second part. There we take a `msg` argument and a `key` argument. We use a
153−`*` and a `~` in the first part (Arvo data) and third part (optional arguments),
154−respectively, because we aren't using them here. See the
155−[generator documentation](/docs/tutorials/generators) for more information.
156−
157−`:- %noun` simply labels the output of this program as the `%noun` mark.
158−
159145`=. msg (cass msg)` changes the input string `msg` to lowercases. `=.` changes
160146the leg of the subject to something else. In our case, the leg to be changed is
161147`msg`, and the thing to replace it is `(cass msg)`. `cass` is a standard-library
@@ -238,7 +224,7 @@ If the above test finds that its condition to be false, we trigger a recursion
238224that constructs our `map`: $(chart (~(put by chart) i.a i.b), a t.a, b t.b)`.
239225This code recursively adds an entry in our `map` where the head of the tape `a`
240226maps to the value of the head of tape `b` with `~(put by chart)`, our calling
241−of the `put` arm of the `by` map-engien core. The recursion also "consumes"
227+of the `put` arm of the `by` map-engine core. The recursion also "consumes"
242228those heads with every iteration by changing `a` and `b` to their tails.
243229
244230Perhaps now you can understand why this arm is named `zipper`. It's putting two
@@ -333,7 +319,7 @@ If we then give our arm Caesar's famous statement, and get our left- and
333319right-ciphers.
334320
335321```
336−> +caesar "i came i saw i conquered" 4
322+> +caesar ["i came i saw i conquered" 4]
337323["m geqi m wea m gsruyivih" "e ywia e ows e ykjmqanaz"]
338324```
339325
@@ -341,10 +327,10 @@ Now, to decode, we can put either of our ciphers in with the appropriate key and
341327look for the legible result.
342328
343329```
344−> +caesar "m geqi m wea m gsruyivih" 4
330+> +caesar ["m geqi m wea m gsruyivih" 4]
345331["q kium q aie q kwvycmzml" "i came i saw i conquered"]
346332
347−> +caesar "e ywia e ows e ykjmqanaz" 4
333+> +caesar ["e ywia e ows e ykjmqanaz" 4]
348334["i came i saw i conquered" "a usew a kso a ugfimwjwv"]
349335```
350336
@@ -353,7 +339,9 @@ look for the legible result.
353339
3543401. Take the example generator and modify it to add a second layer of shifts.
355341
356−2. Extend the example generator to allow for using characters other than a-z.
342+2. Extend the example generator to allow for use of characters other than a-z.
357343
3583443. Build a gate that can take a Caesar shifted `tape` and produce
359345possible unshifted `tapes`.
346+
347+4. Modify the example generator into a `%say` generator.