summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-01-15 20:19:37 -0800
committerKaz Kylheku <kaz@kylheku.com>2014-01-15 20:19:37 -0800
commit9ba41588b1282bde4e113406923ec081124cded6 (patch)
tree5c5ace4694261fbe1f28eef5b8d0b51d6559fd4d
parenta0d5ba9831cf2a33144337ab8f0e6f2fd1e6f0cb (diff)
downloadtxr-9ba41588b1282bde4e113406923ec081124cded6.tar.gz
txr-9ba41588b1282bde4e113406923ec081124cded6.tar.bz2
txr-9ba41588b1282bde4e113406923ec081124cded6.zip
* arith.c: Revised error messages to refer to Lisp names instead
of C names of functions, or otherwise clarified them. * filter.c: Likewise. * lib.c: Likewise. * match.c: Likewise.
-rw-r--r--arith.c22
-rw-r--r--filter.c2
-rw-r--r--lib.c22
-rw-r--r--match.c8
4 files changed, 28 insertions, 26 deletions
diff --git a/arith.c b/arith.c
index 09828f59..450e8c5c 100644
--- a/arith.c
+++ b/arith.c
@@ -402,10 +402,10 @@ tail:
return chr(sum);
}
}
- uw_throwf(error_s, lit("plus: invalid operands ~s ~s"), anum, bnum, nao);
+ uw_throwf(error_s, lit("+: invalid operands ~s ~s"), anum, bnum, nao);
char_range:
uw_throwf(numeric_error_s,
- lit("plus: sum of ~s and ~s is out of character range"),
+ lit("+: sum of ~s and ~s is out of character range"),
anum, bnum, nao);
}
@@ -513,12 +513,12 @@ tail:
if (sum < 0 || sum > 0x10FFFF)
uw_throwf(numeric_error_s,
- lit("minus: difference of ~s and ~s is out of character range"),
+ lit("-: difference of ~s and ~s is out of character range"),
anum, bnum, nao);
return chr(sum);
}
}
- uw_throwf(error_s, lit("minus: invalid operands ~s ~s"), anum, bnum, nao);
+ uw_throwf(error_s, lit("-: invalid operands ~s ~s"), anum, bnum, nao);
}
val neg(val anum)
@@ -535,7 +535,7 @@ val neg(val anum)
case NUM:
return num(-c_num(anum));
default:
- uw_throwf(error_s, lit("neg: ~s is not a number"), anum, nao);
+ uw_throwf(error_s, lit("-: ~s is not a number"), anum, nao);
}
}
@@ -556,7 +556,7 @@ val abso(val anum)
return num(n < 0 ? -n : n);
}
default:
- uw_throwf(error_s, lit("abso: ~s is not a number"), anum, nao);
+ uw_throwf(error_s, lit("abs: ~s is not a number"), anum, nao);
}
}
@@ -670,7 +670,7 @@ tail:
break;
}
}
- uw_throwf(error_s, lit("mul: invalid operands ~s ~s"), anum, bnum, nao);
+ uw_throwf(error_s, lit("*: invalid operands ~s ~s"), anum, bnum, nao);
}
val trunc(val anum, val bnum)
@@ -1033,7 +1033,7 @@ tail:
goto tail;
}
- uw_throwf(error_s, lit("gt: invalid operands ~s ~s"), anum, bnum, nao);
+ uw_throwf(error_s, lit(">: invalid operands ~s ~s"), anum, bnum, nao);
}
val lt(val anum, val bnum)
@@ -1069,7 +1069,7 @@ tail:
goto tail;
}
- uw_throwf(error_s, lit("lt: invalid operands ~s ~s"), anum, bnum, nao);
+ uw_throwf(error_s, lit("<: invalid operands ~s ~s"), anum, bnum, nao);
}
val ge(val anum, val bnum)
@@ -1110,7 +1110,7 @@ tail:
goto tail;
}
- uw_throwf(error_s, lit("ge: invalid operands ~s ~s"), anum, bnum, nao);
+ uw_throwf(error_s, lit(">=: invalid operands ~s ~s"), anum, bnum, nao);
}
val le(val anum, val bnum)
@@ -1151,7 +1151,7 @@ tail:
goto tail;
}
- uw_throwf(error_s, lit("lt: invalid operands ~s ~s"), anum, bnum, nao);
+ uw_throwf(error_s, lit("<=: invalid operands ~s ~s"), anum, bnum, nao);
}
val numeq(val anum, val bnum)
diff --git a/filter.c b/filter.c
index fb69908b..f8633b7b 100644
--- a/filter.c
+++ b/filter.c
@@ -253,7 +253,7 @@ val filter_string_tree(val filter, val obj)
else if (type == fun_s)
return funcall1(filter, obj);
return obj;
- uw_throwf(error_s, lit("filter_string: invalid filter ~a"), filter, nao);
+ uw_throwf(error_s, lit("invalid filter ~a"), filter, nao);
}
}
}
diff --git a/lib.c b/lib.c
index 5f046edf..2f5264d7 100644
--- a/lib.c
+++ b/lib.c
@@ -503,7 +503,7 @@ val replace_list(val list, val items, val from, val to)
else if (stringp(items))
items = list_str(items);
else if (!listp(items))
- uw_throwf(error_s, lit("replace_list: cannot replace with ~s"), items, nao);
+ uw_throwf(error_s, lit("replace-list: cannot replace with ~s"), items, nao);
if (!list)
return items;
@@ -1323,9 +1323,9 @@ cnum c_num(val num)
mp_get_intptr(mp(num), &out);
return out;
}
- uw_throwf(error_s, lit("c_num: ~s is out of cnum range"), num, nao);
+ uw_throwf(error_s, lit("~s is out of cnum range"), num, nao);
default:
- type_mismatch(lit("c_num: ~s is not an integer"), num, nao);
+ type_mismatch(lit("~s is not an integer"), num, nao);
}
}
@@ -1645,7 +1645,7 @@ val string_extend(val str, val tail)
else if (fixnump(tail))
needed = tail;
else
- uw_throwf(error_s, lit("string_extend: tail ~s bad type"), str, nao);
+ uw_throwf(error_s, lit("string-extend: tail ~s bad type"), str, nao);
room = num(alloc - len - 1);
@@ -1659,7 +1659,7 @@ val string_extend(val str, val tail)
}
if (gt(needed, room))
- uw_throwf(error_s, lit("string_extend: overflow"), nao);
+ uw_throwf(error_s, lit("string-extend: overflow"), nao);
str->st.str = (wchar_t *) chk_realloc((mem_t *) str->st.str,
alloc * sizeof *str->st.str);
@@ -1943,7 +1943,7 @@ val replace_str(val str_in, val items, val from, val to)
val len_rep;
if (type(str_in) != STR)
- uw_throwf(error_s, lit("replace_str: string ~s of type ~s not supported"),
+ uw_throwf(error_s, lit("replace-str: string ~s of type ~s not supported"),
str_in, typeof(str_in), nao);
if (from == nil)
@@ -2003,7 +2003,7 @@ val replace_str(val str_in, val items, val from, val to)
for (s = 0; f != t; f++, s++)
str_in->st.str[f] = c_chr(vecref(items, num(s)));
} else {
- uw_throwf(error_s, lit("replace_str: source object ~s not supported"),
+ uw_throwf(error_s, lit("replace-str: source object ~s not supported"),
items, nao);
}
}
@@ -2034,7 +2034,7 @@ val cat_str(val list, val sep)
total += len_sep;
continue;
}
- uw_throwf(error_s, lit("cat_str: ~s is not a character or string"),
+ uw_throwf(error_s, lit("cat-str: ~s is not a character or string"),
item, nao);
}
@@ -2521,7 +2521,7 @@ val gensymv(val args)
val make_package(val name)
{
if (find_package(name)) {
- uw_throwf(error_s, lit("make_package: ~s exists already"), name, nao);
+ uw_throwf(error_s, lit("make-package: ~s exists already"), name, nao);
} else {
val obj = make_obj();
obj->pk.type = PKG;
@@ -3014,7 +3014,7 @@ val func_get_form(val fun)
{
type_check(fun, FUN);
if (fun->f.functype != FINTERP)
- uw_throwf(error_s, lit("func_get_form: ~a is not an interpreted function"),
+ uw_throwf(error_s, lit("func-get-form: ~a is not an interpreted function"),
fun, nao);
return fun->f.f.interp_fun;
}
@@ -3684,7 +3684,7 @@ val vector_list(val list)
val vec = vector(zero);
if (!listp(list))
- uw_throwf(error_s, lit("vector_list: list expected, not ~s"), list, nao);
+ uw_throwf(error_s, lit("vector-list: list expected, not ~s"), list, nao);
for (; consp(list); list = cdr(list))
vec_push(vec, car(list));
diff --git a/match.c b/match.c
index d46eced7..853926c2 100644
--- a/match.c
+++ b/match.c
@@ -1266,7 +1266,7 @@ val format_field(val obj, val modifier, val filter, val eval_fun)
for (; modifier; pop(&modifier)) {
val item = first(modifier);
if (regexp(item)) {
- uw_throw(query_error_s, lit("format_field: regex modifier in output"));
+ uw_throw(query_error_s, lit("bad field format: regex modifier in output"));
} else if (keywordp(item)) {
plist = modifier;
break;
@@ -1294,7 +1294,8 @@ val format_field(val obj, val modifier, val filter, val eval_fun)
else if (stringp(v))
sep = v;
else
- uw_throwf(query_error_s, lit("format_field: bad modifier object: ~s"),
+ uw_throwf(query_error_s,
+ lit("bad field format: bad modifier object: ~s"),
item, nao);
}
}
@@ -1311,7 +1312,8 @@ val format_field(val obj, val modifier, val filter, val eval_fun)
filter = get_filter(filter_sym);
if (!filter) {
- uw_throwf(query_error_s, lit("format_field: ~s specifies unknown filter"),
+ uw_throwf(query_error_s,
+ lit("bad field format: ~s specifies unknown filter"),
filter_sym, nao);
}
}