64 lines
1.1 KiB
C
64 lines
1.1 KiB
C
|
|
#include <stdlib.h>
|
|
|
|
#include <gc/linked_list/struct.h>
|
|
|
|
#include "kind.h"
|
|
|
|
#include "list/struct.h"
|
|
#include "null/struct.h"
|
|
#include "boolean/struct.h"
|
|
#include "identifier/struct.h"
|
|
#include "integer/struct.h"
|
|
#include "quote/struct.h"
|
|
#include "user_lambda/struct.h"
|
|
#include "builtin_lambda/struct.h"
|
|
#include "environment/struct.h"
|
|
|
|
struct value_inheritance;
|
|
|
|
struct value
|
|
{
|
|
struct link internally_referenced, reaped, grey, white, externally_referenced;
|
|
size_t external_refcount;
|
|
// size_t garbage_collection_count;
|
|
// no need to initalize or maintain, entirely handled by GC.
|
|
|
|
const struct value_inheritance* inheritance;
|
|
|
|
enum value_kind kind;
|
|
|
|
union
|
|
{
|
|
struct null_value null;
|
|
|
|
struct boolean_value boolean;
|
|
|
|
struct identifier_value identifier;
|
|
|
|
struct integer_value integer;
|
|
|
|
struct quote_value quote;
|
|
|
|
struct list_value list;
|
|
|
|
struct user_lambda_value user_lambda;
|
|
|
|
struct builtin_lambda_value builtin_lambda;
|
|
|
|
struct environment_value environment;
|
|
} subclass;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|