reorganized build-ins and implement a circular queue as an example

This commit is contained in:
cozis
2022-08-18 19:01:26 +02:00
parent b5b3a3e315
commit 782985e8b7
36 changed files with 486 additions and 259 deletions
+3 -3
View File
@@ -57,7 +57,7 @@ typedef struct {
const StaticMapSlot *slots;
} StaticMapObject;
static Object *select(Object *self, Object *key, Heap *heap, Error *err);
static Object *select_(Object *self, Object *key, Heap *heap, Error *err);
static Object *copy(Object *self, Heap *heap, Error *err);
static int hash(Object *self);
@@ -67,7 +67,7 @@ static TypeObject t_staticmap = {
.size = sizeof (StaticMapObject),
.copy = copy,
.hash = hash,
.select = select,
.select = select_,
};
static Object *copy(Object *self, Heap *heap, Error *err)
@@ -103,7 +103,7 @@ Object *Object_NewStaticMap(StaticMapSlot slots[], void (*initfn)(StaticMapSlot[
return (Object*) obj;
}
static Object *select(Object *self, Object *key, Heap *heap, Error *error)
static Object *select_(Object *self, Object *key, Heap *heap, Error *error)
{
assert(self != NULL);
assert(self->type == &t_staticmap);