blob: 85a3d2c0258da740907cae5bae54474dd4568276 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
typedef struct list_t {
void *content;
struct list_t *next;
} list_t;
void *list(void *head, void *tail) {
list_t *ret = gc_alloc(sizeof (*ret));
ret->content = head;
ret->next = (list_t *) tail;
return ret;
}
void *nil() {
return (void *) 0;
}
void *head(void *list) {
return list->head;
}
void *tail(void *list) {
return list->tail;
}
void *has_tail(void *list) {
return list->tail;
}
|