about summary refs log tree commit diff stats
path: root/tutorial
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-10-21 20:56:49 -0700
committerKartik K. Agaram <vc@akkartik.com>2021-10-21 20:56:49 -0700
commit42002973c13e464ae77e3d352cd14b338f00f8c6 (patch)
treed7602d5ca3c232fdd8979017390f891647561b4e /tutorial
parentb044bd42644d20c84d87cf41731cd0a520febfa4 (diff)
downloadmu-42002973c13e464ae77e3d352cd14b338f00f8c6.tar.gz
.
Diffstat (limited to 'tutorial')
-rw-r--r--tutorial/index.md4
-rw-r--r--tutorial/task6-error-runbook.txt20
-rw-r--r--tutorial/task6.mu4
3 files changed, 26 insertions, 2 deletions
diff --git a/tutorial/index.md b/tutorial/index.md
index 237a17e5..2ec0af6a 100644
--- a/tutorial/index.md
+++ b/tutorial/index.md
@@ -260,3 +260,7 @@ real, during a real programming session.
 
 (Also, don't forget to delete the statement you typed in before you move on to
 trying out the next one.)
+
+Runbooks are a handy tool for working with computers. In a runbook you write
+instructions to your future self or for others you're working with. They're
+instructions for programming people, not computers.
diff --git a/tutorial/task6-error-runbook.txt b/tutorial/task6-error-runbook.txt
new file mode 100644
index 00000000..23725722
--- /dev/null
+++ b/tutorial/task6-error-runbook.txt
@@ -0,0 +1,20 @@
+If I encounter an error that looks like this:
+  fn main: stmt copy: output 'm' not in a register
+
+then I should do the following:
+  - find the function mentioned (here `main`);
+  - look for a statement that contains the mentioned output (here `m`) before
+    the `<-`; and
+  - replace the statement with a version of the same instruction that writes
+    to an inout in memory. (Here, replace `m <- copy` with `copy-to m`.)
+
+===
+
+If I encounter an error that looks like this:
+  label table: get-slice: key not found: copy-to
+
+then I should do the following:
+  - look for a statement with the same instruction (here `copy-to`) whose
+    first inout is not a variable stored in memory; and
+  - email Kartik (http://akkartik.name/contact) to ask why this message is so
+    much less helpful then the previous one.
diff --git a/tutorial/task6.mu b/tutorial/task6.mu
index ad97065d..0a921cac 100644
--- a/tutorial/task6.mu
+++ b/tutorial/task6.mu
@@ -1,6 +1,6 @@
 fn main {
   var m: int
-  var reg/edx: int <- copy 0
+  var r/edx: int <- copy 0
   # insert a single statement below
-
+  copy-to r, 3
 }