+const Object builtin$true = { BOOLEAN, (Instance)(bool){ true } };
+const Object builtin$false = { BOOLEAN, (Instance)(bool){ false } };
+const Object builtin$nil = { VOID, { 0 } };
+
+struct StringConcatenation
+{
+ size_t referenceCount;
+ Object left;
+ Object right;
+};
+
+Object List_construct(size_t allocate)
+{
+ Object* items = malloc(sizeof(Object) * allocate);
+ Object result = { LIST, (Instance)(List){ allocate, 0, items } };
+ return result;
+}
+
+void List_append(Object* list, Object item)
+{
+ assert(list->type == LIST);
+
+ if(list->instance.list.allocated == list->instance.list.length)
+ {
+ list->instance.list.allocated *= 2;
+ list->instance.list.items = realloc(
+ list->instance.list.items,
+ sizeof(Object) * list->instance.list.allocated
+ );
+ }
+
+ list->instance.list.items[list->instance.list.length] = item;
+ list->instance.list.length++;
+}
+
+Object List_get(Object* list, Object index)
+{
+ assert(list->type == LIST);
+ assert(index.type == INTEGER);
+
+ return list->instance.list.items[index.instance.integer];
+}
+
+struct Stack
+{
+ uint16_t length;
+ Object items[256];
+};
+
+void Stack_initialize(Stack* self)
+{
+ self->length = 0;
+}
+
+void Stack_push(Stack* self, Object item)
+{
+ assert(self->length < 256);
+ self->items[self->length] = item;
+ self->length++;
+}
+
+Object Stack_pop(Stack* self)
+{
+ assert(self->length > 0);
+ self->length--;
+ return self->items[self->length];
+}
+
+Object Object_rereference(Object self)
+{
+ switch(self.type)
+ {
+ case BOOLEAN:
+ case CLOSURE:
+ case INTEGER:
+ case STRING_LITERAL:
+ case VOID:
+ return self;
+
+ case STRING_CONCATENATION:
+ self.instance.string_concatenation->referenceCount++;
+ return self;
+
+ case STRUCTURE:
+ self.instance.structure->reference_count++;
+ return self;
+
+ default:
+ assert(false);
+ }
+}
+
+Object Structure_construct(size_t length, const char** symbol_list, Object* value_list)
+{
+ Structure* structure = malloc(sizeof(Structure));
+ structure->reference_count = 1;
+ structure->length = length;
+ structure->symbol_list = malloc(sizeof(const char*) * length);
+ structure->value_list = malloc(sizeof(Object) * length);
+
+ // TODO Don't allow assignment of mutable structures, as this screws up reference counting
+ for(size_t i = 0; i < length; i++)
+ {
+ structure->symbol_list[i] = symbol_list[i];
+ structure->value_list[i] = Object_rereference(value_list[i]);
+ }
+
+ Object result = { STRUCTURE, (Instance)structure };
+
+ return result;
+}
+
+Object Structure_get(Object* self, const char* symbol)
+{
+ assert(self->type == STRUCTURE);
+
+ for(size_t i = 0; i < self->instance.structure->length; i++)
+ {
+ if(self->instance.structure->symbol_list[i] == symbol)
+ {
+ return self->instance.structure->value_list[i];
+ }
+ }
+
+ assert(false);
+}
+