Index: doc/theses/rob/examples/intro/FileOutputStream.java
===================================================================
--- doc/theses/rob/examples/intro/FileOutputStream.java	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
+++ doc/theses/rob/examples/intro/FileOutputStream.java	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
@@ -0,0 +1,38 @@
+import java.io.IOException;
+import java.io.FileNotFoundException;
+
+public class FileOutputStream implements AutoCloseable {
+	public static int throwOnWrite;
+	public static int throwOnClose;
+	public static int throwOnOpen;
+
+	public static int numWrites;
+	public static int numCloses;
+	public static int numOpens;
+
+	private String filename;
+	private <EX extends Throwable> void doexcept(EX ex, boolean pred) throws EX {
+		if (pred) {
+			System.out.println("Stream: " + filename + " threw exception: " + ex);
+			throw ex;
+		}
+	}
+
+	public FileOutputStream(String filename) throws FileNotFoundException {
+		doexcept(new FileNotFoundException(), throwOnOpen == ++numOpens);
+		System.out.println("Opened file: " + filename);
+		this.filename = filename;
+	}
+	public void write(byte[] bytes) throws IOException {
+		doexcept(new IOException(), throwOnWrite == ++numWrites);
+		System.out.println("wrote message: " + new String(bytes) + " to file: " + filename);
+	}
+	public void close() throws IOException {
+		System.out.println("Closing file: " + filename);
+		filename = null;
+		doexcept(new IOException(), throwOnClose == ++numCloses);
+	}
+	protected void finalize() {
+		if (filename != null) System.out.println("Finalize closing file: " + filename);
+	}
+}
Index: doc/theses/rob/examples/intro/compound_lit.c
===================================================================
--- doc/theses/rob/examples/intro/compound_lit.c	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
+++ doc/theses/rob/examples/intro/compound_lit.c	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
@@ -0,0 +1,16 @@
+int printf(const char *, ...);
+
+struct A { int x, y; };
+int f(struct A a, int z) {
+	printf("%d %d %d\n", a.x, a.y, z);
+}
+int g(int * x) {
+	if (x == 0) printf("NULL\n");
+	else printf("%d\n", *x);
+}
+
+int main() {
+	f((struct A){ 3, 4 }, (int){ 5 } = 10);
+	g((int[]){ 1, 2, 3 });
+	g(&(int){ 0 });
+}
Index: doc/theses/rob/examples/intro/designation.c
===================================================================
--- doc/theses/rob/examples/intro/designation.c	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
+++ doc/theses/rob/examples/intro/designation.c	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
@@ -0,0 +1,24 @@
+int printf(const char *, ...);
+
+struct A {
+  int w, x, y, z;
+};
+
+void print(struct A a) {
+	printf("{ %d, %d, %d, %d }\n", a.w, a.x, a.y, a.z);
+}
+
+int main() {
+	struct A a0 = { .x=4, .z=1, .x=8 };
+	struct A a1 = { 1, .y=7, 6 };
+	struct A a2[3] = { [2]=a0, [0]=a1, { .z=3 } };
+
+	print(a0);
+	print(a1);
+	printf("{\n");
+	for (int i = 0; i < 3; i++) {
+		printf("  ");
+		print(a2[i]);
+	}
+	printf("}\n");
+}
Index: doc/theses/rob/examples/intro/ignore.c
===================================================================
--- doc/theses/rob/examples/intro/ignore.c	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
+++ doc/theses/rob/examples/intro/ignore.c	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
@@ -0,0 +1,22 @@
+struct __ignore_t__ {
+};
+__ignore_t__ __ignore__;
+
+forall(dtype T | sized(T))
+__ignore_t__ ?=?(__ignore_t__ * dst, T src) {
+	return *dst;
+}
+
+forall(dtype T | sized(T) | { void ?{}(T *, T); })
+T ?=?(T * dst, __ignore_t__ src) {
+	return *dst;
+}
+
+int main() {
+	int x = 123, y = 456, z = 789;
+	double j = 3.14, i = 8.77;
+	[x, __ignore__, z] = [y, z, x];
+	[i, j, __ignore__] = [0, i, j];
+	printf("%d %d %d\n", x, y, z);
+	printf("%g %g\n", i, j);
+}
Index: doc/theses/rob/examples/intro/ires.java
===================================================================
--- doc/theses/rob/examples/intro/ires.java	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
+++ doc/theses/rob/examples/intro/ires.java	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
@@ -0,0 +1,3 @@
+public interface ires {
+	public void write(String filename, String msg) throws Exception;
+}
Index: doc/theses/rob/examples/intro/res.java
===================================================================
--- doc/theses/rob/examples/intro/res.java	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
+++ doc/theses/rob/examples/intro/res.java	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
@@ -0,0 +1,34 @@
+public class res {
+	private ires res;
+	public res(ires res) {
+		this.res = res;
+	}
+
+	public void dotest(String msg, int open, int write, int close) {
+		try {
+			System.out.println(msg);
+			FileOutputStream.throwOnOpen = open;
+			FileOutputStream.throwOnWrite = write;
+			FileOutputStream.throwOnClose = close;
+			res.write("foo.txt", "output message");
+		} catch (Exception ex) {
+		}
+		FileOutputStream.numOpens = 0;
+		FileOutputStream.numWrites = 0;
+		FileOutputStream.numCloses = 0;
+		System.gc();
+		System.runFinalization();
+		System.out.println();
+		System.out.flush();
+	}
+
+	public static void dotest(ires res) {
+		res r = new res(res);
+		r.dotest("Exception on open 1",  1, 0, 0);
+		r.dotest("Exception on open 2",  2, 0, 0);
+		r.dotest("Exception on write 1", 0, 1, 0);
+		r.dotest("Exception on write 2", 0, 2, 0);
+		r.dotest("Exception on close 1", 0, 0, 1);
+		r.dotest("Exception on close 2", 0, 0, 2);
+	}
+}
Index: doc/theses/rob/examples/intro/res1.java
===================================================================
--- doc/theses/rob/examples/intro/res1.java	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
+++ doc/theses/rob/examples/intro/res1.java	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
@@ -0,0 +1,16 @@
+import java.io.IOException;
+
+public class res1 implements ires {
+	public void write(String filename, String msg) throws IOException {
+	  FileOutputStream out = new FileOutputStream(filename);  // may throw FileNotFoundException
+	  FileOutputStream log = new FileOutputStream("log.txt"); //  or SecurityException
+	  out.write(msg.getBytes()); // may throw an IOException
+	  log.write(msg.getBytes()); // may throw an IOException
+	  log.close(); // may throw an IOException
+	  out.close(); // may throw an IOException
+	}
+
+	public static void main(String[] args) {
+		res.dotest(new res1());
+	}
+}
Index: doc/theses/rob/examples/intro/res2.java
===================================================================
--- doc/theses/rob/examples/intro/res2.java	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
+++ doc/theses/rob/examples/intro/res2.java	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
@@ -0,0 +1,22 @@
+import java.io.IOException;
+
+public class res2 implements ires {
+  public void write(String filename, String msg) throws Exception {
+    FileOutputStream out = new FileOutputStream(filename); // may throw FileNotFoundException
+    try {
+      FileOutputStream log = new FileOutputStream("log.txt"); //  or SecurityException
+      try {
+        out.write(msg.getBytes()); // may throw an IOException
+        log.write(msg.getBytes()); // may throw an IOException
+      } finally {
+        log.close(); // may throw an IOException
+      }
+    } finally {
+      out.close(); // may throw an IOException
+    }
+  }
+
+  public static void main(String[] args) {
+    res.dotest(new res2());
+  }
+}
Index: doc/theses/rob/examples/intro/res3.java
===================================================================
--- doc/theses/rob/examples/intro/res3.java	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
+++ doc/theses/rob/examples/intro/res3.java	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
@@ -0,0 +1,17 @@
+import java.io.IOException;
+
+public class res3 implements ires {
+  public void write(String filename, String msg) throws Exception {
+    try (
+      FileOutputStream out = new FileOutputStream(filename); // may throw FileNotFoundException
+      FileOutputStream log = new FileOutputStream("log.txt"); //  or SecurityException
+    ) {
+      out.write(msg.getBytes()); // may throw an IOException
+      log.write(msg.getBytes()); // may throw an IOException
+    }
+  }
+
+  public static void main(String[] args) {
+    res.dotest(new res3());
+  }
+}
Index: doc/theses/rob/examples/intro/tuple.cc
===================================================================
--- doc/theses/rob/examples/intro/tuple.cc	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
+++ doc/theses/rob/examples/intro/tuple.cc	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
@@ -0,0 +1,10 @@
+#include <iostream>
+#include <tuple>
+using namespace std;
+
+int main() {
+	tuple<int, int, int> triple(10, 20, 30);
+	cout << get<1>(triple) << endl;
+	tuple_element<2, tuple<int, float, double>>::type x = 3.14;
+	cout << tuple_size<decltype(triple)>::value << endl;
+}
Index: doc/theses/rob/examples/intro/variadic.java
===================================================================
--- doc/theses/rob/examples/intro/variadic.java	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
+++ doc/theses/rob/examples/intro/variadic.java	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
@@ -0,0 +1,25 @@
+class variadic {
+  int sum(int... args) {
+    int s = 0;
+    for (int x : args) {
+      s += x;
+    }
+    print(args.length, " ", args[0], " ", args[args.length-1], "\n");
+    return s;
+  }
+
+  void print(Object... objs) {
+    for (Object obj : objs) {
+      System.out.print(obj);
+    }
+  }
+
+  public void run() {
+    print("The sum from 1 to 10 is ", sum(1,2,3,4,5,6,7,8,9,10), ".\n");
+    print(sum(new int[]{1, 2,3}), "\n");
+  }
+
+  public static void main(String args[]) {
+    new variadic().run();
+  }
+}
