Index: doc/rob_thesis/examples/ctor/array_ctor.c
===================================================================
--- doc/rob_thesis/examples/ctor/array_ctor.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
+++ doc/rob_thesis/examples/ctor/array_ctor.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
@@ -0,0 +1,16 @@
+struct X { int x, y, z; };
+void ?{}(X *);
+void ?{}(X *, int);
+void ?{}(X *, int, int);
+void ?{}(X *, int, int, int);
+void ^?{}(X *);
+void f() {
+  X x[10] = { { 1, 2, 3 }, { 4 }, { 7, 8 } };
+}
+
+void g() {
+  X x[10][10] = {
+    { { 1, 2, 3 }, { 4 } },
+    { { 7, 8 } }
+  };
+}
Index: doc/rob_thesis/examples/ctor/copy_ctor.c
===================================================================
--- doc/rob_thesis/examples/ctor/copy_ctor.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
+++ doc/rob_thesis/examples/ctor/copy_ctor.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
@@ -0,0 +1,14 @@
+struct A;
+void ?{}(A *);
+void ?{}(A *, A);
+void ^?{}(A *);
+
+A f(A x) {
+  return x;
+}
+
+int main() {
+	A y, z @= {};
+	f(y);
+	f(z);
+}
Index: doc/rob_thesis/examples/ctor/cv_ctor.c
===================================================================
--- doc/rob_thesis/examples/ctor/cv_ctor.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
+++ doc/rob_thesis/examples/ctor/cv_ctor.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
@@ -0,0 +1,10 @@
+struct S { int i; };
+void ?{}(S *, int);
+void ?{}(S *, S);
+
+int main() {
+  const int i = 5;
+  volatile int j = i;
+  const S s = { 11 };
+  volatile S s2 = s;
+}
Index: doc/rob_thesis/examples/ctor/enum_ctor.c
===================================================================
--- doc/rob_thesis/examples/ctor/enum_ctor.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
+++ doc/rob_thesis/examples/ctor/enum_ctor.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
@@ -0,0 +1,3 @@
+enum Colour {
+  R, G, B
+};
Index: doc/rob_thesis/examples/ctor/expr_ctor.c
===================================================================
--- doc/rob_thesis/examples/ctor/expr_ctor.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
+++ doc/rob_thesis/examples/ctor/expr_ctor.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
@@ -0,0 +1,6 @@
+struct X {};
+void ?{}(X *, double);
+
+int f() {
+  X * x = malloc(sizeof(X)){ 1.5 };
+}
Index: doc/rob_thesis/examples/ctor/global_ctor.c
===================================================================
--- doc/rob_thesis/examples/ctor/global_ctor.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
+++ doc/rob_thesis/examples/ctor/global_ctor.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
@@ -0,0 +1,9 @@
+struct X {
+  int y, z;
+};
+void ?{}(X *);
+void ?{}(X *, int, int);
+void ^?{}(X *);
+
+X a;
+X b = { 10, 3 };
Index: doc/rob_thesis/examples/ctor/hide_ctor.c
===================================================================
--- doc/rob_thesis/examples/ctor/hide_ctor.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
+++ doc/rob_thesis/examples/ctor/hide_ctor.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
@@ -0,0 +1,12 @@
+struct S { int x; };
+
+int main() {
+  S s0; // okay
+  {
+    void ?{}(S * s, int i) { s->x = i*2; }
+    void ?{}(S *s) { }
+//    void ^?{}(S *s ) { }
+    S s1; // error
+  }
+  S s2; // okay
+}
Index: doc/rob_thesis/examples/ctor/placement_ctor.c
===================================================================
--- doc/rob_thesis/examples/ctor/placement_ctor.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
+++ doc/rob_thesis/examples/ctor/placement_ctor.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
@@ -0,0 +1,51 @@
+struct memory_pool {
+  char * start;
+  char * cur;
+  size_t size;
+  char * free;
+};
+
+void ?{}(memory_pool * pool, size_t size) {
+  pool->[start, cur] = malloc(size);
+  pool->size = size;
+  printf("initializing memory pool with size %lu at location %p\n", pool->size, pool->start);
+}
+
+void ^?{}(memory_pool * pool) {
+  free(pool->start);
+}
+
+forall(dtype T | sized(T))
+T * allocate(memory_pool * pool, unsigned int array_size = 1) {
+  size_t size = sizeof(T) * array_size;
+  printf("allocating block of size %lu...", size);
+  if (pool->cur + size < pool->start + pool->size) {
+    T * x = (T*)pool->cur;
+    pool->cur += size;
+    printf("success!\n");
+    printf("next address is %p\n", pool->cur);
+    return x;
+  } else {
+    printf("failed!\n");
+    // fail to allocate
+    return 0;
+  }
+}
+
+struct A {
+  int x, y, z;
+};
+void ?{}(A * a) {
+  a->[x,y,z] = [123, 456, 789];
+}
+
+int main() {
+  memory_pool pool = { 1024 };
+
+  int * x = allocate(&pool);
+  A * a = allocate(&pool);
+  A * b = allocate(&pool, 1000);
+  a{};
+  printf("%p\n", x);
+  printf("%p %d %d %d\n", a, a->[x,y,z]);
+}
Index: doc/rob_thesis/examples/ctor/return_dtor.c
===================================================================
--- doc/rob_thesis/examples/ctor/return_dtor.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
+++ doc/rob_thesis/examples/ctor/return_dtor.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
@@ -0,0 +1,20 @@
+struct A;
+void ?{}(A *);
+void ^?{}(A *);
+
+void f(int i) {
+  A x;  // construct x
+  {
+    A y; // construct y
+    {
+      A z; // construct z
+      {
+        if (i == 0) return; // destruct x, y, z
+      }
+      if (i == 1) return; // destruct x, y, z
+      // destruct z
+    }
+    if (i == 2) return; // destruct x, y
+    // destruct y
+  }
+}
Index: doc/rob_thesis/examples/ctor/static_ctor.c
===================================================================
--- doc/rob_thesis/examples/ctor/static_ctor.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
+++ doc/rob_thesis/examples/ctor/static_ctor.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
@@ -0,0 +1,12 @@
+struct X {
+  int y, z;
+};
+void ?{}(X *);
+void ?{}(X *, int, int);
+void ^?{}(X *);
+
+int f(int x) {
+  static X a;
+  static X b = { x, x };
+  static X c = b;
+}
Index: doc/rob_thesis/examples/ctor/union_ctor.c
===================================================================
--- doc/rob_thesis/examples/ctor/union_ctor.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
+++ doc/rob_thesis/examples/ctor/union_ctor.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
@@ -0,0 +1,6 @@
+struct Y { int a; };
+struct Z { double z; };
+union X {
+  Y y;
+  Z z;
+};
Index: doc/rob_thesis/examples/intro/FileOutputStream.java
===================================================================
--- doc/rob_thesis/examples/intro/FileOutputStream.java	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
+++ doc/rob_thesis/examples/intro/FileOutputStream.java	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
@@ -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/rob_thesis/examples/intro/compound_lit.c
===================================================================
--- doc/rob_thesis/examples/intro/compound_lit.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
+++ doc/rob_thesis/examples/intro/compound_lit.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
@@ -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/rob_thesis/examples/intro/designation.c
===================================================================
--- doc/rob_thesis/examples/intro/designation.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
+++ doc/rob_thesis/examples/intro/designation.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
@@ -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/rob_thesis/examples/intro/ignore.c
===================================================================
--- doc/rob_thesis/examples/intro/ignore.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
+++ doc/rob_thesis/examples/intro/ignore.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
@@ -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/rob_thesis/examples/intro/ires.java
===================================================================
--- doc/rob_thesis/examples/intro/ires.java	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
+++ doc/rob_thesis/examples/intro/ires.java	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
@@ -0,0 +1,3 @@
+public interface ires {
+	public void write(String filename, String msg) throws Exception;
+}
Index: doc/rob_thesis/examples/intro/res.java
===================================================================
--- doc/rob_thesis/examples/intro/res.java	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
+++ doc/rob_thesis/examples/intro/res.java	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
@@ -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/rob_thesis/examples/intro/res1.java
===================================================================
--- doc/rob_thesis/examples/intro/res1.java	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
+++ doc/rob_thesis/examples/intro/res1.java	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
@@ -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/rob_thesis/examples/intro/res2.java
===================================================================
--- doc/rob_thesis/examples/intro/res2.java	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
+++ doc/rob_thesis/examples/intro/res2.java	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
@@ -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/rob_thesis/examples/intro/res3.java
===================================================================
--- doc/rob_thesis/examples/intro/res3.java	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
+++ doc/rob_thesis/examples/intro/res3.java	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
@@ -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/rob_thesis/examples/intro/tuple.cc
===================================================================
--- doc/rob_thesis/examples/intro/tuple.cc	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
+++ doc/rob_thesis/examples/intro/tuple.cc	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
@@ -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/rob_thesis/examples/intro/variadic.java
===================================================================
--- doc/rob_thesis/examples/intro/variadic.java	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
+++ doc/rob_thesis/examples/intro/variadic.java	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
@@ -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();
+  }
+}
Index: doc/rob_thesis/examples/scope_guard.h
===================================================================
--- doc/rob_thesis/examples/scope_guard.h	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
+++ doc/rob_thesis/examples/scope_guard.h	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
@@ -0,0 +1,29 @@
+#ifndef SCOPE_GUARD_H
+#define SCOPE_GUARD_H
+
+struct ScopeGuard {
+  void (*fn)(void *);
+  // Args args;
+};
+
+// forall(ttype Args, ttype Ret)
+// void ?{}(ScopeGuard(Args, Ret) * this) {
+void ?{}(ScopeGuard * this) {
+
+}
+
+// // inline
+// forall(ttype Args, ttype Ret)
+// void ?{}(ScopeGuard(Args, Ret) * this, Ret (*fn)(Args), Args args) {
+//   this->fn = fn;
+//   // this->args = args;
+// }
+
+// inline
+// forall(ttype Args, ttype Ret)
+// void ^?{}(ScopeGuard(Args, Ret) * this) {
+void ^?{}(ScopeGuard * this) {
+  this->fn(0);
+}
+
+#endif
Index: doc/rob_thesis/examples/test_scoped_guard.c
===================================================================
--- doc/rob_thesis/examples/test_scoped_guard.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
+++ doc/rob_thesis/examples/test_scoped_guard.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
@@ -0,0 +1,12 @@
+#include "scope_guard.h"
+
+extern "C" {
+  void free(void *);
+}
+
+int main() {
+  int * x = malloc(sizeof(10));
+  // ScopeGuard(int*, void) foo;
+  ScopeGuard foo;
+  foo.fn = free;
+}
Index: doc/rob_thesis/examples/tuples/assign.c
===================================================================
--- doc/rob_thesis/examples/tuples/assign.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
+++ doc/rob_thesis/examples/tuples/assign.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
@@ -0,0 +1,9 @@
+int x, z;
+double y;
+[double, double] f();
+
+int main () {
+  [x, y, z] = [f(), 3];       // multiple assignment
+  // [x, y, z] = 1.5;            // mass assignment
+}
+
Index: doc/rob_thesis/examples/tuples/cast.c
===================================================================
--- doc/rob_thesis/examples/tuples/cast.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
+++ doc/rob_thesis/examples/tuples/cast.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
@@ -0,0 +1,10 @@
+[int, int, int] f();
+[int, [int, int], int] g();
+
+int main() {
+  ([int, double])f();           // (1)
+  ([int, [int], int])g();         // (2)
+  printf("%d %d\n", ([void, [int, int]])g());      // (3) -- should work and doesn't -- tries to construct void object, but should ignore that component in terms of the type of the tuple
+  // ([int, int, int, int])g();    // (4) -- should not work and doesn't
+  // ([int, [int, int, int]])g();  // (5) -- should not work and doesn't
+}
Index: doc/rob_thesis/examples/tuples/ctor.c
===================================================================
--- doc/rob_thesis/examples/tuples/ctor.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
+++ doc/rob_thesis/examples/tuples/ctor.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
@@ -0,0 +1,10 @@
+struct S { int x; double y; };
+[void] ?{}(* [int, double] this, S s) {
+  this->0 = s.x;
+  this->1 = s.y;
+}
+int main() {
+  S s = { 123, 345 };
+  [int, double] x = s;
+  printf("%d %g\n", x);
+}
Index: doc/rob_thesis/examples/tuples/mrv.c
===================================================================
--- doc/rob_thesis/examples/tuples/mrv.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
+++ doc/rob_thesis/examples/tuples/mrv.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
@@ -0,0 +1,2 @@
+[int, int] foo();
+[double, int] bar();
Index: doc/rob_thesis/examples/tuples/mrv_1.c
===================================================================
--- doc/rob_thesis/examples/tuples/mrv_1.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
+++ doc/rob_thesis/examples/tuples/mrv_1.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
@@ -0,0 +1,34 @@
+#include <stdio.h>
+#include <ctype.h>
+struct mf_ret {
+  int freq;
+  char ch;
+};
+
+struct mf_ret most_frequent(const char * str) {
+  char freqs [26] = { 0 };
+  struct mf_ret ret = { 0, 'a' };
+  for (int i = 0; str[i] != '\0'; ++i) {
+    if (isalpha(str[i])) {        // only count letters
+      int ch = tolower(str[i]);   // convert to lower case
+      int idx = ch-'a';
+      if (++freqs[idx] > ret.freq) {  // update on new max
+        ret.freq = freqs[idx];
+        ret.ch = ch;
+      }
+    }
+  }
+  return ret;
+}
+
+void dothing(const char * str) {
+  struct mf_ret ret = most_frequent(str);
+  printf("%s -- %d %c\n", str, ret.freq, ret.ch);
+}
+
+int main() {
+  dothing("hello");
+  dothing("hello, world!");
+  dothing("aaabbbba");
+  dothing("");
+}
Index: doc/rob_thesis/examples/tuples/mrv_2.c
===================================================================
--- doc/rob_thesis/examples/tuples/mrv_2.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
+++ doc/rob_thesis/examples/tuples/mrv_2.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
@@ -0,0 +1,31 @@
+#include <stdio.h>
+#include <ctype.h>
+
+int most_frequent(const char * str, char * ret_ch) {
+  char freqs [26] = { 0 };
+  int ret_freq = 0;
+  for (int i = 0; str[i] != '\0'; ++i) {
+    if (isalpha(str[i])) {        // only count letters
+      int ch = tolower(str[i]);   // convert to lower case
+      int idx = ch-'a';
+      if (++freqs[idx] > ret_freq) {  // update on new max
+        ret_freq = freqs[idx];
+        *ret_ch = ch;
+      }
+    }
+  }
+  return ret_freq;
+}
+
+void dothing(const char * str) {
+  char ch;
+  int freq = most_frequent(str, &ch);
+  printf("%s -- %d %c\n", str, freq, ch);
+}
+
+int main() {
+  dothing("hello");
+  dothing("hello, world!");
+  dothing("aaabbbba");
+  dothing("");
+}
Index: doc/rob_thesis/examples/tuples/mrv_3.c
===================================================================
--- doc/rob_thesis/examples/tuples/mrv_3.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
+++ doc/rob_thesis/examples/tuples/mrv_3.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
@@ -0,0 +1,33 @@
+#include <stdio.h>
+#include <ctype.h>
+
+[int, char] most_frequent(const char * str) {
+  char freqs [26] = { 0 };
+  int ret_freq = 0;
+  char ret_ch = 'a';
+  for (int i = 0; str[i] != '\0'; ++i) {
+    if (isalpha(str[i])) {        // only count letters
+      int ch = tolower(str[i]);   // convert to lower case
+      int idx = ch-'a';
+      if (++freqs[idx] > ret_freq) {  // update on new max
+        ret_freq = freqs[idx];
+        ret_ch = ch;
+      }
+    }
+  }
+  return [ret_freq, ret_ch];
+}
+
+void dothing(const char * str) {
+  int freq;
+  char ch;
+  [freq, ch] = most_frequent(str);
+  printf("%s -- %d %c\n", str, ret_freq, ret_ch);
+}
+
+int main() {
+  dothing("hello");
+  dothing("hello, world!");
+  dothing("aaabbbba");
+  dothing("");
+}
Index: doc/rob_thesis/examples/variadic/new.c
===================================================================
--- doc/rob_thesis/examples/variadic/new.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
+++ doc/rob_thesis/examples/variadic/new.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
@@ -0,0 +1,13 @@
+forall(dtype T | sized(T)) T * malloc(void);
+
+forall(dtype T, ttype Params | sized(T) | { void ?{}(T *, Params); })
+T * new(Params p) {
+  return ((T*)malloc()){ p }; // construct result of malloc
+}
+
+struct S { int x, y; }; 
+void ?{}(S *, int, int);
+
+int main() {
+  S * s = new(3, 4);
+}
Index: doc/rob_thesis/examples/variadic/print.c
===================================================================
--- doc/rob_thesis/examples/variadic/print.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
+++ doc/rob_thesis/examples/variadic/print.c	(revision 9c14ae94c6baf3aa3a91be49b0076852ea86e5ef)
@@ -0,0 +1,11 @@
+forall(otype T, ttype Params |
+  { void print(T); void print(Params); })
+void print(T arg, Params rest) {
+  print(arg);
+  print(rest);
+}
+void print(const char * x) { printf("%s", x); }
+void print(int x) { printf("%d", x);  }
+int main() {
+  print("x = ", 123, ".");
+}
