summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-10-16 06:43:28 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-10-16 06:43:28 -0700
commitc7b7e82868a5fb1cd024e7570f973f5807248379 (patch)
tree5770688e0977d1d64bf27ab98842053ab766e863 /lib.c
parentc9e0e299e93a5c4f9caf9df31aed18038650a7be (diff)
downloadtxr-c7b7e82868a5fb1cd024e7570f973f5807248379.tar.gz
txr-c7b7e82868a5fb1cd024e7570f973f5807248379.tar.bz2
txr-c7b7e82868a5fb1cd024e7570f973f5807248379.zip
Renaming some functions for consistency.
* combi.c (perm_list, perm_str, rperm_list, reperm_gen_fun, rperm_vec, comb_vec, rcomb_list, rcomb_vec, rcomb_str): Follow rename of list_vector to list_vec. * eval.c (vector_list_s): Global variable renamed to vec_list_s. (expand_qquote): Follow vector_list_s to vec_list_s. (eval_init): Follow renames of all identifiers. Functions num-chr, chr-num, vector-list and list-vector are registered under new names, while remaining registered under old names. * eval.h (vector_list_s): Declaration renamed. * filter.c (url_encode): Follow chr_num to chr_int rename. * lib.c (make_like, interpose, shuffle): Follow vector_list to vec_list rename. (tolist, replace, replace_list): Follow list_vector to list_vec rename. (num_chr): Renamed to int_chr. (chr_num): Renamed to chr_int. (vector_list): Renamed to vec_list. (list_vector): Renamed to list_vec. * lib.h (num_chr, chr_num, list_vector, vector_list): * Declarations renamed. * parser.y (vector): Follow vector_list to vec_list rename. * txr.1: Updated documentation for num-chr, chr-num, list-vector and vector-list with new names, and notes about the old names being supported, but obsolescent.
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/lib.c b/lib.c
index 20fb605e..a7493ef0 100644
--- a/lib.c
+++ b/lib.c
@@ -621,7 +621,7 @@ val make_like(val list, val thatobj)
if (list != thatobj) {
switch (type(thatobj)) {
case VEC:
- return vector_list(list);
+ return vec_list(list);
case STR:
case LIT:
case LSTR:
@@ -663,7 +663,7 @@ val tolist(val seq)
{
switch (type(seq)) {
case VEC:
- return list_vector(seq);
+ return list_vec(seq);
case STR:
case LIT:
case LSTR:
@@ -916,7 +916,7 @@ val replace_list(val list, val items, val from, val to)
val len = nil;
if (vectorp(items))
- items = list_vector(items);
+ items = list_vec(items);
else if (stringp(items))
items = list_str(items);
else if (!listp(items))
@@ -986,7 +986,7 @@ val replace_list(val list, val items, val from, val to)
if (!to || (len && ge(to, len))) {
if (from && zerop(from)) {
- return (listp(items)) ? items : list_vector(items);
+ return (listp(items)) ? items : list_vec(items);
} else {
val iter, i;
list_collect_decl (out, ptail);
@@ -998,7 +998,7 @@ val replace_list(val list, val items, val from, val to)
}
ptail = list_collect_nconc(ptail, if3(listp(items),
- items, list_vector(items)));
+ items, list_vec(items)));
return out;
}
} else {
@@ -1013,7 +1013,7 @@ val replace_list(val list, val items, val from, val to)
}
ptail = list_collect_nconc(ptail, append2(if3(listp(items), items,
- list_vector(items)),
+ list_vec(items)),
iter));
return out;
}
@@ -3736,12 +3736,12 @@ val chr_tolower(val ch)
return chr(towlower(c_chr(ch)));
}
-val num_chr(val ch)
+val int_chr(val ch)
{
return num_fast(c_chr(ch));
}
-val chr_num(val num)
+val chr_int(val num)
{
cnum n = c_num(num);
if (n < 0 || n > 0x10FFFF)
@@ -5368,7 +5368,7 @@ val vectorv(struct args *args)
return vec;
}
-val vector_list(val list)
+val vec_list(val list)
{
val vec = vector(zero, nil);
@@ -5381,7 +5381,7 @@ val vector_list(val list)
return vec;
}
-val list_vector(val vec)
+val list_vec(val vec)
{
list_collect_decl (list, ptail);
int i, len;
@@ -6191,7 +6191,7 @@ val interpose(val sep, val seq)
case LSTR:
return cat_str(interpose(sep, tolist(seq)), nil);
case VEC:
- return vector_list(interpose(sep, tolist(seq)));
+ return vec_list(interpose(sep, tolist(seq)));
default:
type_mismatch(lit("interpose: ~s is not a sequence"), seq, nao);
}
@@ -6334,7 +6334,7 @@ val shuffle(val seq)
case LCONS:
if (cdr(seq))
{
- val v = shuffle(vector_list(seq));
+ val v = shuffle(vec_list(seq));
val i, l;
for (l = seq, i = zero; l; i = succ(i), l = cdr(l))