refactor lisp runtime to use vec_t* instead of ivec_t*

bit nicer to look at, should have about the same painful performance
hit anyway.
This commit is contained in:
2025-08-20 22:43:23 +01:00
parent 6e2db6825d
commit 13142dc7f3
4 changed files with 15 additions and 23 deletions

14
alisp.h
View File

@@ -53,7 +53,9 @@ typedef struct Vector
void *data;
} vec_t;
#define VEC_MULT 2
#define VEC_MULT 2
#define VEC_DEFAULT_CAPACITY 8
void vec_free(vec_t *);
void vec_ensure_free(vec_t *, u64);
void vec_append(vec_t *, void *, u64);
@@ -103,12 +105,6 @@ typedef struct
lisp_t *car, *cdr;
} cons_t;
typedef struct
{
// 2 levels of indirection... disgusting
void *data;
} lvec_t;
/// System context - essentially something to help with system management
typedef struct
{
@@ -129,7 +125,7 @@ lisp_t *cons(sys_t *, lisp_t *, lisp_t *);
i64 as_int(lisp_t *);
sv_t *as_sym(lisp_t *);
cons_t *as_cons(lisp_t *);
void *as_vec(lisp_t *);
vec_t *as_vec(lisp_t *);
#define CAR(L) (as_cons(L)->car)
#define CDR(L) (as_cons(L)->cdr)
@@ -174,6 +170,6 @@ tag_t get_tag(lisp_t *);
lisp_t *tag_int(i64);
lisp_t *tag_sym(sv_t *);
lisp_t *tag_cons(cons_t *);
lisp_t *tag_vec(lvec_t *);
lisp_t *tag_vec(vec_t *);
#endif