Newer
Older
Tardis / lang / main.c
// SPDX-License-Identifier: MIT
// Copyright (c) 2023 John Watts and the LuminaSensum contributors

#include "number.h"
#include <stdio.h>

int lang_main(void) {
	printf("Hello world!\n");
	printf("symb %i\n", find_symbol("a"));
	printf("symb %i\n", find_symbol("b"));
	struct object *numA = number_create(5);
	struct object *numB = number_create(3);
	struct object *args[] = {numB};
	struct object *numC = dispatch_call(numA, "Add", 1, &args[0]);
	printf("numC value is %i\n", number_value(numC));
	printf("numA is %p\n", (void *)numA);
	printf("numB is %p\n", (void *)numB);
	printf("numC is %p\n", (void *)numC);
	object_drop(&numA);
	object_drop(&numB);
	object_drop(&numC);
	printf("numA is %p\n", (void *)numA);
	printf("numB is %p\n", (void *)numB);
	printf("numC is %p\n", (void *)numC);
	return 0;
}