Index: doc/theses/rob/examples/ctor/array_ctor.c
===================================================================
--- doc/theses/rob/examples/ctor/array_ctor.c	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
+++ doc/theses/rob/examples/ctor/array_ctor.c	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
@@ -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/theses/rob/examples/ctor/copy_ctor.c
===================================================================
--- doc/theses/rob/examples/ctor/copy_ctor.c	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
+++ doc/theses/rob/examples/ctor/copy_ctor.c	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
@@ -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/theses/rob/examples/ctor/cv_ctor.c
===================================================================
--- doc/theses/rob/examples/ctor/cv_ctor.c	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
+++ doc/theses/rob/examples/ctor/cv_ctor.c	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
@@ -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/theses/rob/examples/ctor/enum_ctor.c
===================================================================
--- doc/theses/rob/examples/ctor/enum_ctor.c	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
+++ doc/theses/rob/examples/ctor/enum_ctor.c	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
@@ -0,0 +1,3 @@
+enum Colour {
+  R, G, B
+};
Index: doc/theses/rob/examples/ctor/expr_ctor.c
===================================================================
--- doc/theses/rob/examples/ctor/expr_ctor.c	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
+++ doc/theses/rob/examples/ctor/expr_ctor.c	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
@@ -0,0 +1,6 @@
+struct X {};
+void ?{}(X *, double);
+
+int f() {
+  X * x = malloc(sizeof(X)){ 1.5 };
+}
Index: doc/theses/rob/examples/ctor/global_ctor.c
===================================================================
--- doc/theses/rob/examples/ctor/global_ctor.c	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
+++ doc/theses/rob/examples/ctor/global_ctor.c	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
@@ -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/theses/rob/examples/ctor/hide_ctor.c
===================================================================
--- doc/theses/rob/examples/ctor/hide_ctor.c	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
+++ doc/theses/rob/examples/ctor/hide_ctor.c	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
@@ -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/theses/rob/examples/ctor/member.c
===================================================================
--- doc/theses/rob/examples/ctor/member.c	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
+++ doc/theses/rob/examples/ctor/member.c	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
@@ -0,0 +1,26 @@
+struct T {
+  int x;
+};
+const int val = 12223344;
+void ?{}(T * t) {
+  if (t->x == val) printf("uh-oh, constructed twice!\n");
+  t->x = val;
+}
+
+struct S {
+  T t1, t2;
+};
+
+void ?{}(S * this) {
+  // construct both members
+}
+
+void ?{}(S * this, int x) {
+  // forward
+  ?{}(this);
+  ?{}(&this->t1);
+}
+
+int main() {
+  S s = 5;
+}
Index: doc/theses/rob/examples/ctor/placement_ctor.c
===================================================================
--- doc/theses/rob/examples/ctor/placement_ctor.c	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
+++ doc/theses/rob/examples/ctor/placement_ctor.c	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
@@ -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/theses/rob/examples/ctor/return_dtor.c
===================================================================
--- doc/theses/rob/examples/ctor/return_dtor.c	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
+++ doc/theses/rob/examples/ctor/return_dtor.c	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
@@ -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/theses/rob/examples/ctor/static_ctor.c
===================================================================
--- doc/theses/rob/examples/ctor/static_ctor.c	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
+++ doc/theses/rob/examples/ctor/static_ctor.c	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
@@ -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/theses/rob/examples/ctor/union_ctor.c
===================================================================
--- doc/theses/rob/examples/ctor/union_ctor.c	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
+++ doc/theses/rob/examples/ctor/union_ctor.c	(revision cf68d04b367d8d879c5a9d03ac024235346ad5b9)
@@ -0,0 +1,6 @@
+struct Y { int a; };
+struct Z { double z; };
+union X {
+  Y y;
+  Z z;
+};
