make symbols and add nil

This commit is contained in:
2023-10-01 18:00:25 -07:00
parent c30e469df9
commit 39b4e049b7
6 changed files with 130 additions and 27 deletions

View File

@@ -3,7 +3,7 @@
#define SYMBOL_TABLE_SIZE 2048
typedef char * symbol_t;
typedef unsigned int symbol_t;
#define TYPE_SYMBOL 1
#define TYPE_NUMBER 2
@@ -18,7 +18,6 @@ typedef char * symbol_t;
#define floatp(x) (x->type == TYPE_FLOAT)
#define listp(x) (x->type == TYPE_LIST)
typedef struct cell {
uint8_t type;
union {
@@ -35,5 +34,14 @@ typedef struct cell {
};
};
};
} cell_t;
};
symbol_t intern_symbol(const char *s);
symbol_t make_symbol(const char *s);
static auto NIL = make_symbol("nil");
cell head(cell x);
cell tail(cell x);

View File

@@ -3,6 +3,7 @@
namespace neopxl {
void start();
bool blink(bool);
void blink();
void stop();
} // namespace neopxl