summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Weiner <hannes@cmpxchg.org>2010-02-13 15:42:45 +0100
committerJohannes Weiner <hannes@cmpxchg.org>2010-02-13 15:42:45 +0100
commit2eaca5c3105ac57ccd6d22b5cccd1affed6d52a3 (patch)
tree8388cf33a8ccbb1a762da2ee97f08e36aed1e785
parent707c507297e16c8fe06c8c6a83f515be54f8c84a (diff)
list: rename sheep_make_list() to sheep_make_cons()
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
-rw-r--r--include/sheep/list.h2
-rw-r--r--sheep/list.c20
-rw-r--r--sheep/module.c6
-rw-r--r--sheep/read.c4
-rw-r--r--sheep/string.c4
-rw-r--r--sheep/vm.c4
6 files changed, 20 insertions, 20 deletions
diff --git a/include/sheep/list.h b/include/sheep/list.h
index 9daf62e..5458c67 100644
--- a/include/sheep/list.h
+++ b/include/sheep/list.h
@@ -17,7 +17,7 @@ struct sheep_list {
extern const struct sheep_type sheep_list_type;
-sheep_t sheep_make_list(struct sheep_vm *, sheep_t, sheep_t);
+sheep_t sheep_make_cons(struct sheep_vm *, sheep_t, sheep_t);
static inline struct sheep_list *sheep_list(sheep_t sheep)
{
diff --git a/sheep/list.c b/sheep/list.c
index aef8c39..d113393 100644
--- a/sheep/list.c
+++ b/sheep/list.c
@@ -35,7 +35,7 @@ static sheep_t do_list_concat(struct sheep_vm *vm, sheep_t base, sheep_t tail)
node = sheep_list(base);
node->head = pos->head;
- node->tail = sheep_make_list(vm, NULL, NULL);
+ node->tail = sheep_make_cons(vm, NULL, NULL);
base = node->tail;
}
return base;
@@ -48,7 +48,7 @@ static sheep_t list_concat(struct sheep_vm *vm, sheep_t a, sheep_t b)
sheep_protect(vm, a);
sheep_protect(vm, b);
- result = pos = sheep_make_list(vm, NULL, NULL);
+ result = pos = sheep_make_cons(vm, NULL, NULL);
sheep_protect(vm, result);
pos = do_list_concat(vm, result, a);
@@ -68,13 +68,13 @@ static sheep_t list_reverse(struct sheep_vm *vm, sheep_t sheep)
sheep_protect(vm, sheep);
- new = sheep_make_list(vm, NULL, NULL);
+ new = sheep_make_cons(vm, NULL, NULL);
sheep_protect(vm, new);
for (old = sheep_list(sheep); old->head; old = sheep_list(old->tail)) {
sheep_t new_head;
- new_head = sheep_make_list(vm, old->head, new);
+ new_head = sheep_make_cons(vm, old->head, new);
sheep_unprotect(vm, new);
sheep_protect(vm, new_head);
@@ -197,7 +197,7 @@ const struct sheep_type sheep_list_type = {
.format = format_list,
};
-sheep_t sheep_make_list(struct sheep_vm *vm, sheep_t head, sheep_t tail)
+sheep_t sheep_make_cons(struct sheep_vm *vm, sheep_t head, sheep_t tail)
{
struct sheep_list *list;
@@ -228,7 +228,7 @@ static sheep_t builtin_cons(struct sheep_vm *vm, unsigned int nr_args)
{
sheep_t item, list, new;
- new = sheep_make_list(vm, NULL, NULL);
+ new = sheep_make_cons(vm, NULL, NULL);
if (sheep_unpack_stack("cons", vm, nr_args, "ol", &item, &list))
return NULL;
@@ -244,13 +244,13 @@ static sheep_t builtin_list(struct sheep_vm *vm, unsigned int nr_args)
{
sheep_t list;
- list = sheep_make_list(vm, NULL, NULL);
+ list = sheep_make_cons(vm, NULL, NULL);
sheep_protect(vm, list);
while (nr_args--) {
sheep_t new;
- new = sheep_make_list(vm, NULL, list);
+ new = sheep_make_cons(vm, NULL, list);
sheep_list(new)->head = sheep_vector_pop(&vm->stack);
sheep_unprotect(vm, list);
@@ -345,7 +345,7 @@ static sheep_t builtin_map(struct sheep_vm *vm, unsigned int nr_args)
sheep_protect(vm, mapper);
sheep_protect(vm, old);
- new = sheep_make_list(vm, NULL, NULL);
+ new = sheep_make_cons(vm, NULL, NULL);
sheep_protect(vm, new);
l_old = sheep_list(old);
@@ -355,7 +355,7 @@ static sheep_t builtin_map(struct sheep_vm *vm, unsigned int nr_args)
l_new->head = sheep_call(vm, mapper, 1, l_old->head);
if (!l_new->head)
goto out;
- l_new->tail = sheep_make_list(vm, NULL, NULL);
+ l_new->tail = sheep_make_cons(vm, NULL, NULL);
l_new = sheep_list(l_new->tail);
l_old = sheep_list(l_old->tail);
}
diff --git a/sheep/module.c b/sheep/module.c
index 997349c..4ff83fc 100644
--- a/sheep/module.c
+++ b/sheep/module.c
@@ -210,10 +210,10 @@ void sheep_module_builtins(struct sheep_vm *vm)
{
load_path = sheep_module_shared(vm, &vm->main,
"load-path",
- sheep_make_list(vm,
+ sheep_make_cons(vm,
sheep_make_string(vm, "."),
- sheep_make_list(vm,
+ sheep_make_cons(vm,
sheep_make_string(vm, "examples"),
- sheep_make_list(vm, NULL, NULL))));
+ sheep_make_cons(vm, NULL, NULL))));
sheep_vm_variable(vm, "module", &sheep_nil);
}
diff --git a/sheep/read.c b/sheep/read.c
index 5ecb480..e72e9ba 100644
--- a/sheep/read.c
+++ b/sheep/read.c
@@ -115,7 +115,7 @@ static sheep_t read_list(struct sheep_reader *reader,
sheep_t list, pos;
int c;
- list = pos = sheep_make_list(vm, NULL, NULL);
+ list = pos = sheep_make_cons(vm, NULL, NULL);
sheep_protect(vm, list);
for (c = next(reader, 0); c != EOF; c = next(reader, 0)) {
@@ -132,7 +132,7 @@ static sheep_t read_list(struct sheep_reader *reader,
return NULL;
if (node->head == &sheep_eof)
break;
- pos = node->tail = sheep_make_list(vm, NULL, NULL);
+ pos = node->tail = sheep_make_cons(vm, NULL, NULL);
}
barf(reader, "end of file while reading list");
diff --git a/sheep/string.c b/sheep/string.c
index b758599..89b1661 100644
--- a/sheep/string.c
+++ b/sheep/string.c
@@ -203,7 +203,7 @@ static sheep_t builtin_split(struct sheep_vm *vm, unsigned int nr_args)
sheep_protect(vm, token_);
pos = orig = sheep_strdup(string);
- list_ = sheep_make_list(vm, NULL, NULL);
+ list_ = sheep_make_cons(vm, NULL, NULL);
sheep_protect(vm, list_);
token = sheep_rawstring(token_);
@@ -228,7 +228,7 @@ static sheep_t builtin_split(struct sheep_vm *vm, unsigned int nr_args)
item = sheep_make_string(vm, do_split(&pos, token));
list->head = item;
- list->tail = sheep_make_list(vm, NULL, NULL);
+ list->tail = sheep_make_cons(vm, NULL, NULL);
list = sheep_list(list->tail);
}
sheep_free(orig);
diff --git a/sheep/vm.c b/sheep/vm.c
index f58560c..268c34a 100644
--- a/sheep/vm.c
+++ b/sheep/vm.c
@@ -55,13 +55,13 @@ static void setup_argv(struct sheep_vm *vm, int ac, char **av)
struct sheep_list *p;
sheep_t list;
- list = sheep_make_list(vm, NULL, NULL);
+ list = sheep_make_cons(vm, NULL, NULL);
sheep_protect(vm, list);
p = sheep_list(list);
while (ac--) {
p->head = sheep_make_string(vm, *av);
- p->tail = sheep_make_list(vm, NULL, NULL);
+ p->tail = sheep_make_cons(vm, NULL, NULL);
p = sheep_list(p->tail);
av++;
}