From 6e9e8e07abfed921264c100297844dd5969d6e42 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 7 Jan 2018 01:45:19 -0800 Subject: term: move near site of use. * eval.c (term): Function here from lib.c, and changed to static. It is used only by iapply. * lib.c (term): Function moved to eval.c. * lib.h (term): Declaration removed. --- eval.c | 7 +++++++ lib.c | 7 ------- lib.h | 1 - 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/eval.c b/eval.c index d82f2141..0a3ba209 100644 --- a/eval.c +++ b/eval.c @@ -1138,6 +1138,13 @@ static val applyv(val fun, struct args *args) return apply_intrinsic(fun, args_get_list(args)); } +static loc term(loc head) +{ + while (consp(deref(head))) + head = cdr_l(deref(head)); + return head; +} + static val iapply(val fun, struct args *args) { cnum index = 0; diff --git a/lib.c b/lib.c index fd60e1f7..48bf1807 100644 --- a/lib.c +++ b/lib.c @@ -660,13 +660,6 @@ loc tail(val cons) return cdr_l(cons); } -loc term(loc head) -{ - while (consp(deref(head))) - head = cdr_l(deref(head)); - return head; -} - val lastcons(val list) { val ret; diff --git a/lib.h b/lib.h index 6a65e617..cb91f751 100644 --- a/lib.h +++ b/lib.h @@ -535,7 +535,6 @@ val conses(val list); val lazy_conses(val list); val listref(val list, val ind); loc tail(val cons); -loc term(loc head); val lastcons(val list); val last(val list, val n); val nthlast(val pos, val list); -- cgit v1.2.3