rosella/builtin.h

48 lines
1.3 KiB
C

#ifndef BUILTIN_H_85dfb9ef1b9889cd01b60306e12f5e8e
#define BUILTIN_H_85dfb9ef1b9889cd01b60306e12f5e8e
#include <assert.h>
#include <inttypes.h>
#include <stdbool.h>
#include "gc.h"
/* Names of fundamental builtin values */
#define BI_UNDEFINED "undefined"
#define BI_STRUCTURE "structure"
#define BI_TEMPLATE "template"
#define BI_LAMBDA "lambda"
#define BI_POS_NAN "+NaN"
#define BI_NEG_NAN "-NaN"
#define BI_POS_INFINITY "+infinity"
#define BI_NEG_INFINITY "-infinity"
/* Names of builtin functions */
#define BI_STRING_TO_NUMBER "string->number"
#define BI_FREEZE "freeze!"
#define BI_IMMUTABLE_P "immutable?"
#define TEMPLATE_SLOT_GLOBAL_VARS 0
#define TEMPLATE_SLOT_INSTANCE_VARS 1
#define TEMPLATE_SLOT_FRAME_VARS 2
#define TEMPLATE_SLOT_BYTE_CODE 3
#define TEMPLATE_SLOT_TAIL_CALL 4
#define TEMPLATE_SLOTS 5
#define LAMBDA_SLOT_GLOBAL_VARS 0
#define LAMBDA_SLOT_INSTANCE_VARS 1
#define LAMBDA_SLOT_FRAME_VARS 2
#define LAMBDA_SLOT_BYTE_CODE 3
#define LAMBDA_SLOT_TAIL_CALL 4
#define LAMBDA_SLOTS 5
value_t get_template_type(void);
value_t get_lambda_type(void);
void builtin_init(void);
void register_builtin(const char *name, value_t value);
value_t lookup_builtin(const char *name);
#endif
/* vim:set sw=2 expandtab: */