view runtime/proghead.inc @ 242:0e7982adc76b

Make the successful return value from a match expression be truthy and the failure value false. This avoids an extra method call when checking the result and avoids allocating a new object when a match fails.
author Mike Pavone <pavone@retrodev.com>
date Sun, 05 Jan 2014 20:56:25 -0800
parents ab7c142090a0
children 632667d95d35
line wrap: on
line source

#include "object.h"
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include <gc/gc.h>

object * main_module;

char * methodNames[];

object * no_impl(uint32_t method_id, uint32_t num_args, object * self, va_list args)
{
	fprintf(stderr, "method %s(%d) is not implemented on object %p\n", methodNames[method_id], method_id, self);
	fprintf(stderr, "main_module %p\n", main_module);
	exit(1);
	return NULL;
}